Page 1 of 1

Map is not centered

Posted: Mon Jun 17, 2013 4:51 pm
by Bachi

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


Map is not centered

Posted: Mon Jun 17, 2013 5:08 pm
by Kateryna Grynko

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.


Map is not centered

Posted: Mon Jun 17, 2013 5:15 pm
by Bachi

Map is not centered

Posted: Mon Jun 17, 2013 7:56 pm
by Kateryna Grynko

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