I am loading API by google loader
google.load("maps", "2");
The procedure to get the error is as follow:
1. Add some GMarker to the map.
for (i = 0; i < locations.length; i++) {
//add gmarker
var geoPoint1 = new
GLatLng(locations[i].LatitudeWGS84, locations[i].LongitudeWGS84);
var marker = createMarker(geoPoint1,
locations[i].GeoLocationId, locations[i].FullName);
batchMarker.push(marker);
bounds.extend(geoPoint1);
}
//show markers
$mmgr.addMarkers(batchMarker, 3);
$mmgr.refresh();
2. Each GMarker handle their click event, add a GPolyline to the map
and use the
GMarker latlng as starting point.
function createMarker(latlng, locationId, titleText)
{
var baseIcon = new GIcon(G_DEFAULT_ICON);
var marker = new GMarker(latlng, { icon: baseIcon,
title: titleText, draggable: false });
//add polyline callback
GEvent.addListener(marker, "click", function()
{ CreateRoute(marker) });
return marker;
}
function CreateRoute(marker) {
var vertex = [];
vertex.push(marker.getLatLng());
var polyline = createGPolyline(vertex, '#FF0000', 2,
0.5);
polyline.enableDrawing();
$gmap.addOverlay(polyline);
}
3. Add some vertex, Click on the last vertex and end drawing.
4. Click on another GMarker to trigger the event handler to draw
GPolyline -> error
without "strict" and vml
error line: function Nh(){x(pd).sV();eval(arguments[1])}
with "strict" and vml
error line: function Hk(a){$j(Fk).cS();eval(a)}
a is null
--
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-api?hl=en.