Hello

I hope I'm posting in the right place, I'm new to Google Groups.

I am developing a Google Maps tool for driving directions. I get the
"from" and the "to" from a DB, so I can't fully use the Javascript
version. My goal is to have something similar to the printing page for
Google Directions. (Example:
http://maps.google.com/maps?f=d&saddr=toronto&daddr=ajax&hl=de&geocode=&mra=ls&sll=44.535945,-77.436805&sspn=2.748745,6.586304&ie=UTF8&t=h&z=11&pw=2)
I have a big map with the whole route on it (that works). And a list
of directions (that works), plus the option to show mini-maps for the
directions, similar to the example above.

So if the user clicks "show mini map for this step", a little map
appears with that particular cutout of the map, with the blue-line for
directions (again, check the example above).

It seems that I can't get the zoom level to work though. It always
shows me the whole route, instead of a zoom up of that particular
step. This is how I'm trying:


function show_mini_map(lat_lon, id)
      {
      document.getElementById('map_'+id).style.display = 'block';
      mini_map = new GMap2(document.getElementById('map_'+id));

      mini_map.setCenter(new GLatLng(lat_lon));
      mini_map.addControl(new GSmallZoomControl());

      sdir = new GDirections(mini_map);

      sdir.load("from: <?php print($result['from_lat_lon']); ?> to: <?
php print($result['to_lat_lon']); ?> ", {'locale': 'DE'});*/

      mini_map.panTo(lat_lon);
      }

The "mini_map.panTo()" doesn't work though.
The two PHP bits are the start and end point of the whole route,
whereas the "lat_lon" that the JS function gets, is the current point.

I hope you guys understand what I'm trying to do. If not, I'll try to
be clearer.
(btw: just using Google Directions print page isn't an option, my boss
wants it to fit the layout of the page)

One more thing: I have a link "show all mini maps", that loops as many
times as there are steps of the route, and every time the function
above is called to make the map. Sometimes the mini map is grey and
says "zoom level not available for this area" (which isn't true).
Sometimes it works though. My guess is, the API gets messed up because
it has to make this many maps at once. But I don't know. What do you
think?

Thanks alot for your help!

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to