[Drupal] How to display gmap on in node view page

| | 1 min read

In one of my recent projects a requirement was to add a gmap to a node view page. I thought of writing it down so that some one may find this useful.

The module which I used to accomplish this is,

This Module has two sub modules named "Geolocation Google Maps" and "Geolocation HTML5".

The Geolocation Google Maps module Provides pretty cool widget for the users to select the location by clicking on the map. They can either type in the location and or simply select the location by clicking on the map.

The Geolocation HTML5 module defines the location using the Geo location API

  • Step 1

    Download and enable the geolocation and Geolocation Google Maps modules.

  • Step 2

    Go to structure -> content types -> your-content-type -> manage fields. Add a new field with field type geolocation and widget google map.

  • Step 3

    Go to manage display and from the format drop down list of location field select Dynamic Google Map.

  • Step 4

    Now Go to add content of your-content-type. you will see a widget with a map. You can select the location by clicking on the map, or you can type in the location in the text area provided above the map.

  • Step 5

    Now in the node view page you will able to see a location within a google maps formatter.