0

I have a gmap module (https://www.drupal.org/project/gmap) view that serves the map of locations. I also have a list of those locations under the map. I need to establish a relationship - a class, a rel attribute, or something like this, based on the node id, so that when I click the marker, the correct element in the list can be identified.

I tried adding identification to the marker objects so that they can be related to the list items on click. I have tried the hook_gmap() and the theming preprocess functions to add an attribute to the markers and failed.

I have also tried to hook into the Google Maps marker events, but could not do it without overriding the native infobubble events, which I don't want to override.

The actual question:

How can I pass information to markers created with GMap, so that they can be aware of the node id? Some html attribute like class or rel would be ideal. Adding it as a part of icon image path, like image.jpg?nid=1111 would also do the trick.

  • What module are you using to create the markers? – DarkteK Jun 20 '16 at 17:56
  • I use a gmap module. – Alexei Rayu Jun 20 '16 at 18:19
  • Notice that you are simply stated facts, without asking any explicit questions. What is exactly that you don't understand in the task you described? – kiamlaluno Jun 21 '16 at 4:38
  • Clarified the question. Getting an impression that this question in the context of the GMap module may not be solvable. – Alexei Rayu Jun 21 '16 at 4:45
1

I suggest you to use this module to create views related to your nodes to create gmap with markers:

https://www.drupal.org/project/ip_geoloc

  • 1
    Thank you for your response DarkeK. I am aware that there are limited ways to pass the data to markers in other setups. I would prefer to not rebuild the complete functionality though, if there is a way it can be made with GMap. – Alexei Rayu Jun 21 '16 at 4:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.