Hi TND
What you could do is create a circle (google.maps.Circrle) with a radius of
20,25,50 miles with a transparent fill and stroke (unless you want them to
see the circle) then tell the map to .fitBounds to the circle's .getBounds
method like so:
var myLatLng = new google.maps.LatLng(35.265,-80.326);
var circleOptions = {
center: myLatLng,
fillOpacity: 0,
strokeOpacity:0,
map: myMapObject,
radius: 32186 /* 20 miles */
}
var myCircle = new google.maps.Circle(circleOptions);
myMap.fitBounds(myCircle.getBounds());
I'm not sure that this code works as I just jotted it down but something
like that should work. Maybe that will point you in the right direction.
Jason
On Thu, Apr 22, 2010 at 7:32 PM, The Net Duck <[email protected]> wrote:
> HI
> I'm trying to zoom my map in our out based on the distance my users
> set. For instance, a user might say they want to see a map with
> objects around them at 50 miles or maybe 20 miles etc. I want the
> google map to only zoom out to 25 miles from their given point.
>
> I have their given point but I don't know how to manipulate the zoom
> level in such a way that they only see X distance from their current
> point.
>
> Thanks!
>
> - The Net Duck
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Maps JavaScript API v3" group.
> To post to this group, send email to
> [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-maps-js-api-v3%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-maps-js-api-v3?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" 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-js-api-v3?hl=en.