[Drupal] Display Maps based on the search result using GMap, Views and Location modules in Drupal 7

By | 09th Feb 2015 | 1 min read

Hey guys my requirement is to create a view attached with a map(highlight the map with the results) for that you have to enabling Location, GMap, views module.

Create a view display as page to get all results based on the search (normal exposed view to search). To add map to this result add one more display called 'attachment' to the same view and add all the fields that you added the display page and all the filter added in the display page (refer pic1,pic2).
Pic1.png

pic2.png

Before doing following steps you have to set up location module (refer pic5).
pic5.png

1. Add a display attachment to the view
2. Select format as GMap
Set GMap settings:
a) Set Data Source as location.module
b) You can set the Marker / fallback marker to us as 'Big blue' (or anything that you would like to mark) (Refer pic3).
pic3.png
3. Add all the filters you added into the this display also
4. Set the attachment settings (refer pic4).
pic4.png
a) Select which display you want this attachment feature (for eg:page)
b) Set the attachment position, filter option and permissions