You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google Maps JavaScript API v3
geocoder returns a suggested viewport in its response
which I capture like with "results[0].geometry.viewport" in the JSON
response
I wanted to simply use the suggested viewport's lat lng for my map
zoom level instead of trying to code a switch which would zoom based
on the geometry.location_type response. See my current code below:
switch (results[0].geometry.location_type)
{
case "ROOFTOP":
map.setZoom(18);
break;
default:
map.setZoom(6);
}
Can I use something like setBounds(bounds:LatLngBounds)? If so what
would the sample code look like?
I tried :
map.setBounds(results[0].geometry.viewport)
but that did not work.
Rossko
unread,
Jul 6, 2010, 9:48:23 AM7/6/10
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google Maps JavaScript API v3
> I tried :
> map.setBounds(results[0].geometry.viewport)
> but that did not work.