By olivesandtrees on
I've had GMap working nicely throughout my site from the home page to content nodes but recently ran into issues when trying to put it into a custom panel. When I add the node that usually displays the map into a panel all I get is the latitude, longitude and a link to Google Maps. The built-in "Location map" block which actually displays the interactive map is no where to be found. Panels does have an option to add Custom blocks, but "Location map" is not in there. Anyone know how to fix this issue?
Most of the work arounds I've read are for Drupal 6, and I can't seem to get them to work for me.
Comments
Solution
You should configure your panel > contexts and add 'Location' context. Once that, be sure in site configuration > location > main settings, that is marked "Enable the display of Locations". Finally you reach into your panel > content and you should be able to add your 'location map' content under 'Miscellaneous' section.
IMPORTANT: Configure your node content type > Locative Information > Collection settings as follow:
Location name: allow
City: allow
state/province: allow
country: require <-- think this is the important one, anyway this configuration worked for me.
If not, the map will not appear.
Good luck!
Invalid nid
I tried ur suggestion but it gave me this notice on my panels configuration screen:
"Notice: Undefined index: nid in location_context_create_location() (line 50 of ...\sites\all\modules\location\plugins\contexts\location.inc)"
And when I view my node (paneled) it shows me the google map with a marker in a small box but I do not think a coordinate is being detected because it's all blue...
I tried configuring as what you have suggested, context> location
no relationships (although I also tried with using 'Node Location' > Node being viewed) still no go.
All other settings location have been set up properly as well. (e.g. Allow city, require country etc.., set to display location map in location settings)
Thanks!
Alternative way
That's true, raises differents errors... better you open an issue in Drupal's community. Thanks.