Tagged: POI list
May 2, 2013 at 8:54 am #12453
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?May 2, 2013 at 10:13 am #12458
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.May 2, 2013 at 10:41 am #12461ChrisKeymaster
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.May 2, 2013 at 12:12 pm #12463
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.
- You must be logged in to reply to this topic.