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).
I am using the links generated when the poi list is visible. I am then turning the list off and hand-coding the links into my text. But often when I make an update the poi order changes and then I have to make modifications to my hand coding so that everything works correctly. I am not using a mashup currently.
If you’re just using a single map with all the locations (and not a mashup) then you can just drag and drop the POIs to set their sort order in the map editor (you’ll need version 2.38.5 or later). Then use the shortcode argument ‘sort=”false”‘ to turn off sorting by title: