Closed (fixed)
Project:
GMap Module
Version:
6.x-1.1-rc1
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
23 Nov 2009 at 23:06 UTC
Updated:
18 Dec 2009 at 22:32 UTC
I've been able to dynamically add shapes through Javascript in GEvent's addoverlay event listener function:
var route = window.gdir.getRoute(0);
var length = route.getNumSteps();
var shapes = new Array();
shapes.type = 'line';
shapes.style = new Array('000000', 3, 25, 'ffff00', 45);
var points = new Array();
for(var i = 0; i < length; i++) {
var step = route.getStep(i);
points.push(new Array(step.getLatLng().lat(), step.getLatLng().lng()));
}
shapes.points = points;
Drupal.gmap.getMap('gmap-auto2map-gmap0').change('clearshapes', -1);
However, even though this properly (I think) updates Drupal.gmap.getMap('gmap-auto2map-gmap0').vars.shapes, it doesn't display the line of the route on the map. Should I be invoking some other method?
Comments
Comment #1
tyabut commentedI figured it out a few weeks ago :)