Reply To: getPoi()

Home Forums MapPress Support getPoi() Reply To: getPoi()

#10331
Chris
Keymaster

Hi,

I’m not sure what your requirements are, but the number passed to getPoi() is the index of that POI in the map you’re displaying.  So one way to prevent it from changing for a specific POI is to keep that POI in the same position in the map’s POI list – for example always place it at the top of the list.  You can control the list sort order by dragging and dropping in the map editor (for maps), or using the action ‘mappress_sort_pois’ (for mashups).

If you’re doing a mashup, and it’s linked to the unerlying posts, then you can also try changing the template to use the postid instead of the index.  There’s a javascript method getPoiById(postid) for that purpose.