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:

behavior=-autozoom

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

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <img> <code> <ul> <ol> <li> <dl> <dt> <dd> <pre> <h1> <h2> <h3> <h4> <h5> <h6>
  • Lines and paragraphs break automatically.
  • Adds typographic refinements.

More information about formatting options