hi I have a problem with displaying number of routes simultaneously. On a map I need to display routes from different lat/longs to one destination. I am able to display nine routes even though I gave in my html page over thirty routes.
my question is how many routes can be displayed simultaneously in the described scenario or is there a way around it My html code is as follows: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas- microsoft-com:vml"> <head> <title>Google Maps JavaScript API Example: Simple Directions</ title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"/ > <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"> // Create a directions object and register a map and DIV to hold the // resulting computed directions var map; var directions; var directionsArray=[]; var colors = ['#FF0000', '#FF00FF', '#0000FF','#00FFFF','#0000FF','#0000A0','#FF0080','#800080','#FFFF00','#C0C0C0','#000000','#804000','#808000','#408080']; var i = 0; var baseIcon = new GIcon(G_DEFAULT_ICON); function initialize() { map = new GMap2(document.getElementById("map_canvas")); map.setCenter(new GLatLng(17.403041,78.477399), 12); map.addControl(new GSmallMapControl()); route1 = [new GLatLng(17.403041,78.477399),new GLatLng (17.401677,78.480829),new GLatLng(17.44422,78.380324)]; route2 = [new GLatLng(17.508351,78.415499),new GLatLng (17.498302,78.389473),new GLatLng(17.496444,78.340665),new GLatLng (17.44422,78.380324)]; route4 = [new GLatLng(17.368984,78.496499),new GLatLng (17.325185,78.493666),new GLatLng(17.403294,78.404163),new GLatLng (17.44422,78.380324)]; route5 = [new GLatLng(17.479597,78.389831),new GLatLng (17.466108,78.494009),new GLatLng(17.44422,78.380324)]; route6 = [new GLatLng(17.480738,78.554621),new GLatLng (17.480878,78.538842),new GLatLng(17.421803,78.512095),new GLatLng (17.44422,78.380324)]; route7 = [new GLatLng(17.460655,78.364005),new GLatLng (17.455661,78.365293),new GLatLng(17.455649,78.368819),new GLatLng (17.44422,78.380324)]; route8 = [new GLatLng(17.504579,78.387212),new GLatLng (17.503226,78.385119),new GLatLng(17.493282,78.395044),new GLatLng (17.44422,78.380324)]; route9 = [new GLatLng(17.494838,78.321559),new GLatLng (17.479597,78.389831),new GLatLng(17.447966,78.382684),new GLatLng (17.44422,78.380324)]; route10 = [new GLatLng(17.47081,78.509496),new GLatLng (17.4511,78.536081),new GLatLng(17.432189,78.522854),new GLatLng (17.356809,78.506323),new GLatLng(17.44422,78.380324)]; route11 = [new GLatLng(17.446744,78.446271),new GLatLng (17.451479,78.438246),new GLatLng(17.399732,78.498083),new GLatLng (17.44422,78.380324)]; route12 = [new GLatLng(17.508815,78.415514),new GLatLng (17.492484,78.384272),new GLatLng(17.492994,78.342977),new GLatLng (17.44422,78.380324)]; route14 = [new GLatLng(17.440901,78.345821),new GLatLng (17.440901,78.345821),new GLatLng(17.44422,78.380324)]; route15 = [new GLatLng(17.447114,78.511251),new GLatLng (17.446544,78.502265),new GLatLng(17.44422,78.380324)]; route16 = [new GLatLng(17.427984,78.405547),new GLatLng (17.470408,78.368052),new GLatLng(17.462786,78.351613),new GLatLng (17.44422,78.380324)]; route17 = [new GLatLng(17.503808,78.291598),new GLatLng (17.495478,78.359506),new GLatLng(17.501425,78.391213),new GLatLng (17.44422,78.380324)]; route20 = [new GLatLng(17.496495,78.405193),new GLatLng (17.457708,78.36658),new GLatLng(17.44422,78.380324)]; route21 = [new GLatLng(17.470984,78.509534),new GLatLng (17.445426,78.464599),new GLatLng(17.445426,78.464513),new GLatLng (17.44422,78.380324)]; route22 = [new GLatLng(17.449356,78.362203),new GLatLng (17.455825,78.368812),new GLatLng(17.460655,78.364263),new GLatLng (17.460574,78.364177),new GLatLng(17.44422,78.380324)]; route23 = [new GLatLng(17.447063,78.350101),new GLatLng (17.447063,78.350101),new GLatLng(17.455825,78.368812),new GLatLng (17.44422,78.380324)]; route40 = [new GLatLng(17.460082,78.536439),new GLatLng (17.398974,78.4153),new GLatLng(17.44422,78.380324)]; route41= [new GLatLng(17.338361,78.571379),new GLatLng (17.3681,78.537433),new GLatLng(17.372497,78.512546),new GLatLng (17.44422,78.380324)]; route42= [new GLatLng(17.448648,78.537776),new GLatLng (17.433009,78.442553),new GLatLng(17.44422,78.380324)]; route43= [new GLatLng(17.442261,78.357103),new GLatLng (17.381792,78.433871),new GLatLng(17.44422,78.380324)]; route44= [new GLatLng(17.447784,78.508974),new GLatLng (17.438017,78.413669),new GLatLng(17.44422,78.380324)]; route45= [new GLatLng(17.359593,78.422542),new GLatLng (17.482924,78.389153),new GLatLng(17.44422,78.380324)]; route46= [new GLatLng(17.394967,78.430617),new GLatLng (17.45877,78.364335),new GLatLng(17.455825,78.368812),new GLatLng (17.44422,78.380324)]; route47= [new GLatLng(17.456226,78.537769),new GLatLng (17.445291,78.469541),new GLatLng(17.44422,78.380324)]; route48= [new GLatLng(17.466051,78.363018),new GLatLng (17.440249,78.389915),new GLatLng(17.441659,78.38984),new GLatLng (17.44422,78.380324)]; route50= [new GLatLng(17.455198,78.420875),new GLatLng (17.441524,78.436668),new GLatLng(17.44422,78.380324)]; <!--var routes = [route1,route2,route4,route5,route6,route7,route8,route9,route10,route11,route12,route14,route15,route16,route17,route20,route21];-- > var routes = [route1,route2,route4,route5,route6,route7,route8,route9,route10,route11,route12,route14,route15,route16,route17,route20,route21,route22,route23,route40,route41,route42,route43,route44,route45,route46,route47,route48,route50]; // var routes = [route1,route50]; for(j = 0; j <= routes.length; j++) { directionsArray[j] = new GDirections(); GEvent.addListener(directionsArray [j],"load",onGDirectionsLoad); directionsArray[j].loadFromWaypoints(routes[j], {getPolyline:true}); } } function onGDirectionsLoad() { var polyline = directionsArray[i].getPolyline(); polyline.setStrokeStyle({color:colors[i],weight:5,opacity: 0.7}); map.addOverlay(polyline); i++; } </script> </head> <body onload="initialize()"> <div id="map_canvas" style="width: 100%; height: 500px; float:left; border: 1px solid black;"></div> <div id="route" style="width: 25%; height:480px; float:right; border; 1px solid black;"></div> <br/> </body> </html> help me out..
-- 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.
