GMap Macros

GMap Macros are short snippets of text that combine various configuration options for presenting a GMap in Views, node content (through a filter), or other places. These macros are a Drupal-only concept and are provided by the GMap module.

An example of a complete GMap macro looks like this:

[gmap markers=blue::41.902277040963696,-87.6708984375 |zoom=5 |center=42.94033923363183,-88.857421875 |width=300px |height=200px |control=Small |type=Map]

Note that a GMap macro is always defined with a | (pipe) character between each attribute. Spaces before and after the pipe are optional.

Basic Attributes

Attribute: center
Values: lat,lon
Description: map center
Example: center=39.36827914916013,-81.5625

Attribute: width
Values: css dimension
Description: map width, in valid css dimensions (generally pixels or percent)
Example: width=100%

Attribute: height
Values: css dimension
Description: map height, in valid css dimensions (generally pixels)
Example: height=400px

Attribute: zoom
Values: 0-17
Description: the initial zoom level of the map
Example: zoom=7

Attribute: type
Values: "Map", "Satellite", "Hybrid", "Terrain"

GMap

The Google Maps (GMap) module for Drupal integrates Google Maps with a variety of different systems. It provides both an API and integration with Views, as well as a few bundled sub-projects.

The primary user-facing feature of the GMap module is integration with Views. From the project README.txt:


The GMap module includes built-in integration with the Views module. You can use
this to turn any list of nodes, users, or other content into a Google Map that
plots each item on a map.

To make a GMap-based view, create or edit a view under Administer > Structure >
Views. Under the "Format" section, change the format by clicking on the current
format type (usually "Unformatted list"). Then change the format type to either
"GMap" or "Extended GMap".

For each view you create that uses a GMap format, you may either use a custom
configuration or inherit the site-wide defaults. To make an advanced map
configuration, you may type or copy/paste a GMap macro into the "Macro" textarea
at the top of the GMap format configuration settings. See the section on
"Macros" for more information about how to customize the configuration of your
map using these powerful tools. If you don't want a custom configuration for
this view, just leave the default value for the Macro field.

The only other critically important setting when configuring a GMap format in

Subscribe with RSS Subscribe to RSS - gmap