Skip to content
Snippets Groups Projects
Commit cac6162f authored by Rebecca White's avatar Rebecca White
Browse files

GPolygon.fromEncoded() and GPolyline.fromEncoded() don't take style arguments...

GPolygon.fromEncoded() and GPolyline.fromEncoded() don't take style arguments the same way as the regular constructors--styles have to be attributes of the encoded polyline/polygon object, rather than being arguments to the constructor
parent 7f80beb9
No related branches found
No related tags found
No related merge requests found
...@@ -68,6 +68,23 @@ Drupal.gmap.addHandler('gmap', function (elem) { ...@@ -68,6 +68,23 @@ Drupal.gmap.addHandler('gmap', function (elem) {
style[3] = '#' + style[3]; style[3] = '#' + style[3];
style[4] = style[4] / 100; style[4] = style[4] / 100;
} }
if (shape.type == 'encoded_line') {
shape.color = style[0];
shape.weight = style[1];
shape.opacity = style[2];
}
else if (shape.type == 'encoded_polygon') {
$.each(shape.polylines, function(i, polyline) {
polyline.color = style[0];
polyline.weight = style[1];
polyline.opacity = style[2];
});
shape.fill = true;
shape.color = style[3];
shape.opacity = style[4];
shape.outline = true;
}
$.each(style, function (i, n) { $.each(style, function (i, n) {
cargs.push(n); cargs.push(n);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment