I am trying to use GPolyline or GDirections with custom maps. When I
use custom maps I am getting javascript errors. If I remove the custom
maps it is fine.
Code with no custom maps:
map.setCenter(new GLatLng(43.15, -79.3), 11);
geocoder = new GClientGeocoder();
var directions = new GDirections(map);
directions.load("from: 43 Castlereagh St, Niagara-on-the-Lake ON to:
14184 Niagara Parkway, Queenston, ON L0S 1J0");
map.addOverlay(directions);
The map loads with the directions overlay.
I add custom maps:
var custommap = new GMapType(tilelayers, new GMercatorProjection(14),
"Chart", {errorMessage:"No data available"});
map.addMapType(custommap);
map.setCenter(new GLatLng(43.15, -79.3), 11, custommap);
geocoder = new GClientGeocoder();
var directions = new GDirections(map);
directions.load("from: 43 Castlereagh St, Niagara-on-the-Lake ON to:
14184 Niagara Parkway, Queenston, ON L0S 1J0");
The custom maps show, and I get the start/end point markers for the
route, but no route itself. In FireFox I get this javascript error:
c is undefined, main.js line 608
Of.prototype=new $b;Of.prototype.fromL...-f))*-this.Ds[b]);return new
s(d,c)};
In Internet Explorer I get x is undefined on the same line.
When I scroll the map I also get the same error which I do not get
without the custom maps.
You can see the result here:
http://1812.spidermonkey-cms.com/page/plan_your_trip
--
You received this message because you are subscribed to the Google Groups
"Google Maps API V2" 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.