getPoi()

Home Forums MapPress Support getPoi()

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #10320
    ftadoug
    Participant

    Hi Chris,

    Is there a way to control the number that gets generated in the getPoi() portion when listing the poi links under the map? I don’t want the number to change every time a new POI is added.

    Thanks.

    Doug

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

     

    #10346
    ftadoug
    Participant

    Hi Chris,

    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.

    I want to control how the list is generated so that when a new poi is added the  poi order doesn’t change. Here is a link: http://dev.fresnohousing.org/quality-housing/properties/by-location/

    Doug

    #10365
    Chris
    Keymaster

    Hi,

    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:

    [mappress sort="false"]

     

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