Reply To: Switching to different POIs on map from article

Home Forums MapPress Support Switching to different POIs on map from article Reply To: Switching to different POIs on map from article

#12625
Chris
Keymaster

Hi Robert,

There’s a function called get_open_link() in ‘mappress_poi.php’ that does something similar.

You can take a look at that code, or try adding javascript like this to whatever element you want to be clickable (an anchor, div, etc. – the code below is for an anchor):

<a href='#' onclick='mapp0.getPoi(0).open(true); return false;'>Click me!</a>

‘mapp0’ means the first map on the page, you can also use the “name” parameter of the shortcode to assign a different name. getPoi(0) means get the first POI, getPoi(1) is the 2nd, and so on. And .open(true) means open and zoom in – set to false to just open the marker.