Skip to main content

Removing Behaviors Using a GMap Macro

File under

I’m building some maps for a client using the GMap module and came across the following simple problem: using a GMap macro, how do you remove a default attribute?

The GMap module lets you set a number of default attributes for your maps: width, height, center position, initial zoom, and so on. If you want to change any of the default settings for a given map, you need to specify your overrides in a GMap macro, which looks something like this:

[gmap zoom=3| width=500px |height=350px]

It’s all simple enough until you get to the behaviors. For some reason, although the GMap module comes with a point-and-click macro builder, the builder doesn’t contain any controls for adding or removing behaviors, such as enabling autzoom, disabling mouse scrolling, and so on.

A little Googling on an unrelated issue turned up this post which explains how to add a behavior using a macro. For example, to add autozoom to the map, you would add the following:

[gmap zoom=3| width=500px |height=350px |behavior=+autozoom]

But what about removing a behavior? To remove autozoom, do you add “noautozoom”? After thinking about it for a minute, I realized that you don’t add the negative, you just subtract the positive:


Ha! Simple in hindsight, but tripped me up for a second.