4

I have a content type with a Location text field and a Geofield. The Geofield is geocoding the Location field into a coordinate and displaying it to a Google Map embed on the page.

This is working quite well and the map is always marked at the correct location. The problem I have is that the Google Map is quite useless because it doesn't allow the user to do anything with it.

The map shows the location but doesn't allow the user to get directions to it or get the address or anything. When the user clicks on the marker on the map they get a shout out box with the name of the event not the location.

Is there any way I can have the Google Map be more useful? ie add a Directions To button or something like that?

  • I don't know how you'd go about doing this, but I've used the Geofield module too and something like this would be an awesome addition, have you added it as an issue to the module itself? – Andrew Morris May 1 '14 at 14:38
0

I added directions links to my markers, and to the view's attachment that contains a list of locations displayed on the map. To do this create the directions links:

  1. Added my content type's Post Address field (from the addressfield module) to the views list of available fields.
  2. Re-wrote the Post Address fields view output with the following:

    <a href="http://maps.google.com/maps?daddr=[field_cstore_address-premise],[field_cstore_address-thoroughfare],[field_cstore_address-locality],[field_cstore_address-administrative_area],[field_cstore_address-postal_code]">Directions</a>
    

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