Table of contents
Usage & installation of GMAP & Location modules
Usage & installation of GMAP & Location modules
Introduction
There are many ways in which you can add a Google map to your Drupal website. You can either use contributed Drupal modules which facilitate adding maps to the pages, or you can add them manually in your custom modules and templates.
In addition, you can choose whether to use the Google maps API directly or use some other Javascript API on a more abstract level, such as Openlayers.
Your decision should be based on the data you want to display on maps: their type, style and especially the quantity and changeability of the data.
Usage & Installation
Using these two modules alone, you can add Google maps to your website with very little effort. However, if you have large amount of data you want to display on map, or want a nice design, it will not be enough.
The main purpose of the Location module is to store geographical locations in the database and to connect Drupal nodes and users to those locations. Geographical locations may be represented by a street address, zip code, country and, most importantly, a latitude and longitude. The location module allows:
- setting of localizing data in the BO node/user form,
- additional features to allow map linking (creation of external map links based on entered data) and geocoding (getting latitude and longitude based on the address or zip code);
- these features are available for locations in certain countries only.
This is a set of modules, but it will be enough to enable only the Location and Node Locations or User Locations modules.
The Gmap module has several main purposes:
- it extends the functions of the location module by allowing users to easily set a location's latitude and longitude by clicking on a map in a BO node/user form,
- provides an API for creating Google maps in templates using the theming function (theme_gmap()),
- similarly, it allows the creation of map macros which can be inserted into a node's body in BO (if the GMap Macro Builder module is enabled, a BO page for generating macro code is available),
- provides a map of all nodes or users (available when the GMap Location module is enabled)


