Hi There
I am trying to show a route on a map ...
So I have say 10 places I want to visit in that route so I create a
string like "from: -33.918755, 151.226293 to: -33.901500, 151.214972
to: -33.883360, 151.194047 to: -33.892990, 151.205410 to: -33.918755,
151.226293"
and then overlay the polyline ...
directions = new GDirections(map);
GEvent.addListener(directions, 'load', foobar);
directions.load(routes, {getPolyline:true});
function foobar() {
var polyline = directions.getPolyline();
map.addOverlay(polyline);
}
I notice that when the points are many and I construct a string with
from: and to: it doesnt seem to work but the load(query:String,
queryOpts?:GDirectionsOptions) does not seem to have any limit on the
number of points.....unline loadFromWaypoints(waypoints:Array,
queryOpts?:GDirectionsOptions) from the api........
When I create my own polyline and over lay the polyline as shown
below I have no such problem... I can overlay as many points as I
want...
var points = [
new GLatLng(41.08 , -81.4),
];
var polyline = new GPolyline(points, '#ff0000', 5, 0.7);
// Add the polyline to the map using map.addOverlay()
map.addOverlay(polyline);
Could anyone help me out here
Cheers
Priya
On Jul 15, 11:53 pm, "[email protected]" <[email protected]>
wrote:
> On Jul 14, 6:53 pm, newbie <[email protected]> wrote:
>
>
>
> > Hi There
> > I am trying to basically show apolylineroute on a map with heaps of
> >points
> > is there a limit on the number of point entries
> > The load fromwaypointshas a limit of 25 but I use load
>
> > directions = newGDirections(map);
> > GEvent.addListener(directions, 'load', onGDirectionsLoad);
> > directions.load(routes, {getPolyline:true});
>
> > Also I tried using just thepolylineand giving it a array of LatLngs
> > but they all seem to be originating from one point I want the route
> >polylineto be in an orderly fashion i.e from (40,-83) to (39.9,-83)
> > and so on....
>
> > var routes='from: 40 , -83 to: 39.95653 , -83.04347 to: 41.02898 ,
> > -81.97102 to: 40.62318 , -82.37682 to: 40.72463 , -82.27537........";
>
> If you are looking for something like
> this:http://www.geocodezip.com/example_geo2.asp?waypts=yes&addr1=(40,-83)&...
>
> Then 25 waypoints is the maximum you can do for a dynamically
> generated route. If it is not dynamic, you can capture the pieces of
> the route (25 at a time) and combine them.
>
> What are you trying to accomplish?
>
> -- Larry
>
> > Any help would be appreciated
> > Cheers
> > Priya
>
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---