POI list links anchored to map on page

Home Forums MapPress Support POI list links anchored to map on page

Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #12453
    not2old2learn
    Participant

    I would like to use the POI list under a map, however, because the list is longer than the view on a mobile phone I would like the user to be able to click on a POI link and it act like an anchor and take them back to the map where the POI has been opened. As it is now, user clicks on POI and doesn’t realize the infowindow just opened on the map above because its out of view. So is there a way to have a back to the top like anchor for each POI in the list which takes them back to the map?

    #12458
    not2old2learn
    Participant

    Since I’m using a table under the map anyway (more detailed than what the POI list can give me) I found that if I use the following type of format for the text link in the each row of the first column I can get the corresponding POI to open, problem, how to incorporate an anchor tag. I tried rapping the tag, tried replacing the # with the #nameofanchor, etc but only can get map infowindow to open, can’t get anchor to jump back up to map. <a href=”#” onclick=”mapp0.getPoi(10).open(); return false;”>Show me Gibraltar Heights on map</a>

    I tried replacing the # with #gibraltarmap above and added the <a name=”gibraltarmap”></a> just before the map div on the page.  If I can get this to work I can have each link in my table correspond to the map poi and when user clicks it will take them back to map where infowindow is open. Thanks in advance for help.

    #12461
    Chris
    Keymaster

    Hi,

    That’s an interesting one, I’m not sure but you might try removing the ‘return false’ – it cancels the normal event handling for the anchor (since normally there is no ‘#’ anchor), so it probably prevents moving the focus to your anchor.

    Altenatively, you could use jQuery, to explicitly focus the anchor.  For example:

    mapp0.getPoi(10).open(); jQuery('#myanchor').focus(); return false;

    By the way, you can also modify the poi list template if you’d prefer to use that instead of the table plugin.  It’s called ‘map_poi_list.php’ and there is some info in the documentation about how to copy it to your theme.

    #12463
    not2old2learn
    Participant

    I removed the ‘return false’ and it worked. Will experiment with the jQuery too. Problem with using your POI whether I customize it or not is the fact that both the POI map pins and POI polygon show up in the list, only need one type to show up. Thanks Chris for the quick response.

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