Hi, I wrote code like bellow <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title>Control Initialization</title> <script src=" http://maps.google.com/maps?file=api&v=2.x&key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type="text/javascript"></script> <script type="text/javascript"> //<![CDATA[ function initialize() { if (GBrowserIsCompatible()) { // define the crosshair tile layer and its required functions var crossLayer = new GTileLayer(new GCopyrightCollection(""), 0, 15); crossLayer.getTileUrl = function(tile, zoom) { return "./include/tile_crosshairs.png"; } crossLayer.isPng = function() {return true;} // Create a new map type incorporating the tile layer var layerTerCross = [ G_PHYSICAL_MAP.getTileLayers()[0], crossLayer ]; var mtTerCross = new GMapType(layerTerCross, G_PHYSICAL_MAP.getProjection(), "Ter+"); var map = new GMap2(document.getElementById("map_canvas"), { size: new GSize(679,596)} ); var directionsPanel = document.getElementById("route"); var directions = new GDirections(map, directionsPanel); directions.loadFromWaypoints(new Array(new GLatLng(17.4482222222222,78.4628027777778),new GLatLng(17.4481027777778,78.4611583333333)),{getPolyline: true}); GEvent.addListener(directions,"load",function(){ var poly = directions.getPolyline();poly.color ="#00400040"; map.addOverlay(poly); }); var directionsPanel = document.getElementById("route"); var directions = new GDirections(map, directionsPanel); directions.loadFromWaypoints(new Array(new GLatLng(17.4469444444444,78.4653722222222),new GLatLng(17.4482222222222,78.4628027777778)),{getPolyline: true}); GEvent.addListener(directions,"load",function(){ var poly = directions.getPolyline();poly.color ="#00400040"; map.addOverlay(poly); }); var directionsPanel = document.getElementById("route"); var directions = new GDirections(map, directionsPanel); directions.loadFromWaypoints(new Array(new GLatLng(17.4447944444444,78.4664444444444),new GLatLng(17.4469444444444,78.4653722222222)),{getPolyline: true}); GEvent.addListener(directions,"load",function(){ var poly = directions.getPolyline();poly.color ="#00400040"; map.addOverlay(poly); });map.setCenter(new GLatLng (17.4447944444444,78.4664444444444), 18);map.addMapType(G_PHYSICAL_MAP); map.addMapType(mtTerCross);map.addControl(new GLargeMapControl()) var mapControl = new GHierarchicalMapTypeControl(); // Set up map type menu relationships mapControl.clearRelationships(); mapControl.addRelationship(G_SATELLITE_MAP, G_HYBRID_MAP, "Labels", false); mapControl.addRelationship(G_PHYSICAL_MAP, mtTerCross, "Crosshairs"); // Add control after you've specified the relationships map.addControl(mapControl); } } //]]> </script> </head> <body scroll = no onload="initialize()" onunload="GUnload()"> <div id="map_canvas" style="width: 100%; height: 100%"></div> <div id="route" style="FLOAT:right; width: 25%; height: 480px"></div> </body> </html> I am getting the error like " *'undefined' is null or not an object " *please let me know the solution for that error On Thu, Dec 3, 2009 at 7:47 PM, Rossko <[email protected]> wrote:
> > > In My I have markers like 1, 2, 3, ...... I want to get the drive path > like > > > 1 ----> 2 ------>3--> and so on but it is showing me drive path like > > > 1---->2---->5------>6 > > GDirections does what you tell it to. From 1 to 2 to 5. Or from 1 to > 2 to 3. Your last code dump doesn't show any of that, so no-one can > help you further, and more code dumps probably will not be welcomed. > > *If* you mean, you have a number of places to visit in one trip but > don't know the best order to visit them in, GDirections will not solve > that for you. The maps API has no features to do that. > > > > Pls let me know the solution. > > It would be a well-known problem for you to solve, often called the > "Travelling Salesman Problem". > > -- > > 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]<google-maps-api%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-maps-api?hl=en. > > > -- B.VenkataRathnam -- 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.
