Add google maps

From Walfriedswiki

Jump to: navigation, search

Contents

Introduction

You can include google maps yourself into your drupal text. At the moment you need to be logged in to be able to do this. Including google maps can be done by constructing a google map macro and inserting this into your drupal text.

This is an example of the result.

Constructing the google maps macro

Drupal has a function to help you in constructing the google macro. You can open this function by clicking on the "Build a GMap macro" (tip: open this in a separate tab/window and execute/play in parallel to reading the explanation.

The "Build a GMap macro" will show you a map. You can "zoom-in" and "move" to the place you want and add "points" (markers), "lines", "cicles" and "polygons".

  • Points: just click with your left mouse button on the map and the "point" is added. Clicking on the same position will remove the "point". I was not able to move a "point" by "dragging-and-dropping". So you need to "remove" it first and add it again on a different place. Adding text to the "point" can be done but needs a special trick.
  • Lines: select "lines" in the drop down menu. Left-click on the map and you will see a small square. Moving your mouse will show a dashed line until you left click again. In this way you can connect a set of points to a line. Left clicking again on the last square will end the line. Tip: first construct a rough line. Thereafter "zoom-in" and "fine-tune" the line by "dragging-and-dropping" the intermediate squares. See example below. Lines have a default red color. I did not succeed in changing this via the macro (The defaul, however, can be changed by the administrator).

Image:Google map creation1.JPG Image:Google map creation2.JPG

Inserting the macro

At the bottom of the "Build a GMap macro"-page a "Macro text" box is visible. You should copy its contents to your clipboard and paste it later when you define your drupal item (blog, or whatever).

Image:Google maps macro text.JPG

and paste this:

Image:Google maps paste example.JPG

Some useful tips

Adding text to "text" markers

Normally you can click on a "marker" and view some additional information. I was not able to find out how to do this in the "GMap macro". However, searching in google resulted in a easy trick. Add your text in the macro yourself after the longitude coordinate of your marker (preceded by a colon). See example below.

Image:Google maps paste example2.JPG

When pasted in a drupal item, resulting into:

Image:Google maps paste example3.JPG

Updating a macro

To be honest I don't know how to do this, except for updating it in the text. Reloading the macro in the "GMap macro" tool would be nice, but this is not supported.

Personal tools
walfried.nl
walfried.nl
www.walfried.nl