1

I would like to know how to embed a Google map on a page, so that the the "directions" icon is showing. I had previously used the Simple Gmap module, but it doesn't provide the icon which I need.

1

1 Answer 1

0

You could create a custom region in your theme, then include a block with unaltered text that directly makes a call to the Google Maps API. This allows you the most flexibility since you work directly with the API - however this is only practical with a static location. If you are using something like a geo location module to assign destination parameters or other, you will need to adjust this.

EDIT:

in hindsight, depending on your needs, you probably don't need to create a dedicated region in your theme.

To create an unaltered text area (D7):

1) goto admin/config/content/formats

2) 'add text format'

3) Name: unaltered, Roles: Administrator ONLY! - giving others access to this has MAJOR security issues, so make sure it is admin only.

4) Save, and move it to the bottom of the list, Save Changes (this makes sure it's not the default

Get the google maps API address:

1) go here: https://developers.google.com/maps/web/

2) setup a google developer account (all google api's require this - its free).

3) goto Google Maps Embed API on that page

4) read the page, and setup your api call as you want.

5) copy the code

In admin/structure/blocks:

1) 'Add block'

2) title: < none > (with spaces removed) or as desired

3) Body: paste code from google API - adjust the dimensions as desired (width and height as given by the API call)

4) Text format: unaltered

5) save

6) put the block in the appropriate region

2
  • Thank you. Unfortunately my lack of experience in Drupal does not allow me to fully understand how to implement your solution. Your answer is valuable though and I hope that I will eventually find a desfription of the proces. If you could provide some hints to start with, I'll then dig into the problem more in depth. Thank you in advance. Commented Jun 14, 2014 at 9:48
  • I made an edit to my answer with further instructions
    – Geoff
    Commented Jun 14, 2014 at 13:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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