Shruti Desai
Posts: 0
Joined: Wed Apr 15, 2015 2:57 pm

Map won't center

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.

Bruce Stuart
Posts: 0
Joined: Fri Oct 24, 2014 4:42 am

Map won't center

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 ...

Shruti Desai
Posts: 0
Joined: Wed Apr 15, 2015 2:57 pm

Map won't center

Yes I'm sending a LatLng object.

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

Bruce Stuart
Posts: 0
Joined: Fri Oct 24, 2014 4:42 am

Map won't center

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

Shruti Desai
Posts: 0
Joined: Wed Apr 15, 2015 2:57 pm

Map won't center

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.

Return to “Issues”