setView changes zoom, but not poistion

35 views
Skip to first unread message

Andy Wallace

unread,
Aug 29, 2013, 2:46:15 PM8/29/13
to leafl...@googlegroups.com
So, I have a map set up. I create it with a specific center and zoom:

    ------ creating map ------ 
    o.LatLng {lat: 38.339400819574706, lng: -121.08654709359783)
    Zoom: 8


The user messes around, changes position, zooms in, regular stuff. I have a "reset map" button,
which is supposed to go back to the original map setting. When it gets called:

================ reset map ================== 
I get the current position/zoom:
    Current center:  {lat: 38.3868805698475, lng: -120.4815673828125} 
    Current zoom: 9 

And then use setView with these parameters:
 ------ setting view ------ 
o.LatLng {lat: 38.339400819574706, lng: -121.08654709359783, equals: function, toString: function, distanceTo: function…}
Zoom: 8 

The zoom changes, but the map position doesn't. Well, most of the time the position doesn't change. Sometimes
it does, but I want it to always work.

Any ideas? 

thanks,
Andy


Reply all
Reply to author
Forward
0 new messages