Bachi
Posts: 0
Joined: Mon Apr 22, 2013 1:47 am

Map is not centered

Hi,
Map is not centering and therefore the objects on the map can be seen on the current interface.
Is there anything wrong at below?

When it loads at first time;

function showPropertiesInMap(res){
if(!map)
map = Appery("listmap").gmap;
$("#j_64").css({height:screen.height});
$("#j_64").attr("width","100%");
$("#j_65").attr("width","100%");
$("#j_65").css({height:screen.height});

This is how it re-sets;

function saveMapCenter(){
if(map){
var cen = map.getCenter();
localStorage.setItem('mapCenter', cen.lat()+','+cen.lng());
}
}

function resetMap(){
$("#j_64").css({height:screen.height});
$("#j_64").attr("width","100%");
$("#j_65").attr("width","100%");
$("#j_65").css({height:screen.height});
if(!map) return;
var mc = localStorage.getItem('mapCenter');
if(mc){
mc = mc.split(',');
map.setCenter(new google.maps.LatLng(mc[0], mc[1]));

Thank you,
Bachi Nyangar

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Map is not centered

Hi,

Please send us a public link to your app so we can take a look.

Also try using another symbol to separate latitude and longitude (for, example, space instead of comma). The comma can be a decimal separator in the system. And then you get 4 values ​​instead of 2.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Map is not centered

Hi Bachi,

Please test it on device. The map is centered, but you seem to test on computer, where the size map is equal to your screen size. Image

Return to “Issues”