Reply To: mapp0_zoommarker

Home Forums MapPress Support mapp0_zoommarker Reply To: mapp0_zoommarker

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