Page 1 of 1

Map won't center

Posted: Sun Apr 26, 2015 12:55 pm
by Shruti Desai

Hi,

I'm trying to show some markers on the map and I need it to center to a marker.
I tried 1) map.PanTo 2) map.setCenter 3) Tried setting the center in options 4) Tried doing a map.refresh() on page show.
None of the solutions work for me.


Map won't center

Posted: Sun Apr 26, 2015 2:20 pm
by Bruce Stuart

Are you sure the position you are sending to these methods is a properly formatted position object ?!? As defined in the Google maps API reference ...


Map won't center

Posted: Sun Apr 26, 2015 2:46 pm
by Shruti Desai

Yes I'm sending a LatLng object.

codenew google.maps.LatLng(44.983206, -93.265909)/code


Map won't center

Posted: Sun Apr 26, 2015 3:00 pm
by Bruce Stuart

Shruti,

there's some code on this thread that works for both me and the person that posted the thread - the map centers at the position given without issue....

Perhaps try it?

https://getsatisfaction.com/apperyio/...

best,

Bruce


Map won't center

Posted: Wed Apr 29, 2015 6:59 pm
by Shruti Desai

Thanks Bruce. I appreciate it.
I put this bug on hold and started working on some other bugs. I'll try the solution out when I get back to this one.