mapp0_zoommarker

Home Forums MapPress Support mapp0_zoommarker

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #9881
    pixie
    Participant

    Can we display a Zoom link to the finished map – like the one we see when setting up the map on the admin side. But in the info box for website users to see and use to zoom in on that location?

    #9888
    Chris
    Keymaster

    Yes, it’s actually part of 2.38.3 beta – why don’t you give that version a try and see if it works for you?  If not there’s a javascript function you can call for the same effect.

    #9889
    pixie
    Participant

    Thank you
    I will try the beta……..
    if that does not work can you point me in the direction of the js fix please.

    #9907
    pixie
    Participant

    Hi Chris,

    Can you please let me know how to call the zoom function with js.

    #9908
    Chris
    Keymaster

    The javascript function is only available in the beta.

    This will zoom in on a POI by index number. 0 is the first POI on the map, 1 is the second, and so on:

    <a href='#' onclick='mapp0.getPoi(0).zoomIn(); return false;' >$text</a>

    You can also read the POIs by postid:

    mapp0.getPoiById(1234);

    Note that ‘mapp0’ is the default name for the first displayed map.  See the FAQ for info about how to choose another name.

    If you want to open the POI first, use:

    mapp0.getPoi(0).open(true);

    The ‘true’ value means to open the POI and show its viewport (for example, for a city the plugin will show the entire city).  ‘false’ means don’t zoom, and a number will zoom the map to that zoom level (0-15).

    Both the open and zoom link are available in PHP.  If you have a poi object you can use:

    echo $poi->get_open_link();
    echo $poi->get_zoom_link();

    You can see the file ‘mappress_poi.php’ for the code for those functions.

    #9946
    ftadoug
    Participant

    Hi Chris,

    Right now when I use the ‘zoom’ function, the poi is centered and the info window opens up. But often the info window is partially skewed (at least in my map). How can the zoom function work so that the info window is completely visible?

    I like how prezoom the info window opens and the map moves itself so that the info window is completely visible. It would be great to include this in the next beta version.

    http://dev.fresnohousing.org/about/properties/

    Doug

    #9955
    Chris
    Keymaster

    Hi ftadoug:

    I know what you mean.  The reason is that when zooming, the map has to be exactly centered on the poi, otherwise it would zoom in on the wrong location.  If the map’s not tall enough, the infowindow may not be fully visible.

    I’m not sure if it will help, but one workaround is to just make your map slightly taller so there’s room for the full infowindow.

    I’ll see if there’s anything I can do in the plugin.  I tried to center, zoom, and then open the infowindow, but then the map seems to jump around a lot, rather than having the effect of smoothly zooming on a point.

    Google probably came to the same conclusion – maps.google.com works exactly the same way if you shrink the window a bit.

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.