Open GoogleCodeExporter opened 8 years ago
The solution seems to be to not use {'bounds': true} and extend a
google.maps.LatLngBounds object with all the marker positions and pass it to a
$('#map').gmap('get', 'map').fitBounds() call
Original comment by timrcha...@gmail.com
on 9 Apr 2012 at 9:00
s/solution/workaround/g
Original comment by timrcha...@gmail.com
on 9 Apr 2012 at 9:00
Yep, it will only get wider and wider unless you specifically set bounds to
null, $('#x').gmap('set', 'bounds', null).
Just reset the bounds variable to null then clearing.
Original comment by johansalllarsson
on 9 Apr 2012 at 9:02
I think you could call clear like this too $('#x').gmap('clear', 'bounds');
Original comment by johansalllarsson
on 9 Apr 2012 at 9:04
Thanks for the tips. I'll give 'em a spin later this evening.
Original comment by timrcha...@gmail.com
on 9 Apr 2012 at 9:39
I do not believe $('#x').gmap('clear', 'bounds') works, but $('#x').gmap('set',
'bounds', null) does.
Have you thought about maybe adding a 'reset' API call which will reset the
gmap instance to its initial state (e.g. $('#x').gmap(options))? Not sure how
you'd feel about that.
Original comment by timrcha...@gmail.com
on 10 Apr 2012 at 4:19
Original issue reported on code.google.com by
timrcha...@gmail.com
on 9 Apr 2012 at 8:06