The googlemap_icon model works in conjunction with the googlemap model. When defining Google maps, it is possible to include custom markers which may be represented by any image you choose. Since the same icons may be used within several different maps, the icon definitions are created separately then referenced when you define your maps. Please refer to the Google Map API documentation for information related to defining icon for maps.

Defining the Image to be Used for the Icon

Every icon must indicate an image to be used to represent the icon. The image can be specified in one of two ways:

  1. If the image is defined using the image model, you can specify the id of the image definition to be used.
  2. Alternatively, you can also choose to specify the name of the image directly.

Option 1 - Using an Image Definition

Your icon image can be defined using the image model either within the current site or within an inherited site. Enter the name of the image definition to be used. Since each definition can specify up to seven images (of different sizes) also indicate the size of the image to be used as the icon.

Option 2 - Using an Image Name

Using option 2 you can specify the name of the image that you want to use as an icon. Normally images are loaded from the site's public images folder however the image location can be used to specify alternate locations from where the image is stored. You can specify one of the following locations:

SITE

Use this option is the image resides in your site's images folder.

FRAMEWORK

Use this option if you are sharing an image that is defined with the system images folder.

INHERIT

If your site_settings definition refers to an inherited site, and if that site includes the image you want to load enter INHERIT as the image location.

Explicit URL

You can also specify the full path to the URL of the image (not including the image name).

Using X, Y Offsets

X and Y offsets are represented in pixels. The X offset is used to position items horizontally. Positive numbers move elements to the left, negative numbers move elements to the right. The Y offset is used to move items vertically. Positive offsets move the elements up and negative offsets move them down.

Anchor Position

By default, an icon will be placed on the map such that the bottom center of the icon is situated on the lat/long coordinates of the marker. Use the Anchor X and/or Y values to shift the anchor if you want a different point of the icon to be aligned with the lat/long position that the icon will be marking.

Origin

The origin is generally not set. This is normally used if the image you want is part of a larger image in a sprite.

LabelOrigin

The label origin is used to position single-character letters that can be used as labels that overlay the icon. Generally you will want to try to center the labels within the icon.

Specifying the Size of the Image

It is generally a good idea to specify an image size for your image so that the map loads a little faster. If your image is defined using the image model, the image size is determined automatically. Otherwise, you should enter the image size. You can optionally specify a ScaledImage size if your image is to be scaled. In most cases these sizes will be expressed in pixels.

Sample googlemap_icon definition
🡇
Sample googlemap_icons rendered on a map