Zoom not centering

Home Forums MapPress Support Zoom not centering

This topic contains 1 reply, has 2 voices, and was last updated by  Chris 2 weeks, 5 days ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #18095

    nbdr
    Participant

    Hi Chris,

    I’ve noticed that when I set a zoom greater than 14, it tends to move to the left of the point. Doesn’t matter if I am doing it when initializing the map:

    new Mappress_Map(array("center"=>$mapCenter,"zoom"=>10,"width" => "99.9%", "height"=>$mapHeight))

    or recentering via JS like so:

    mapp0.zoom = 10;
    mapp0.center.lat = centerPoint.lat;
    mapp0.center.lng = centerPoint.lng;
    mapp0.recenter();

    Either way, it moves off to the left, on mobile devices on zoom level 10, the original point completely goes off screen. Am I missing something?

    #18096

    Chris
    Keymaster

    Hi,

    I can only guess, but this could be caused by the map not being centered at the exact lat/lng of the POI (I assume you’re centering on a POI?). Or, it could be the map isn’t displaying at the correct size, in which can you’ll need to call the resize() method.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.