This is a port of GMAP-ARRAY-DICTIONARY.txt to advanced_help. It's a work in progress.

This file defines the attributes available in GMap arrays. This is fairly similar to the GMAP-MACRO-DICTIONARY.txt, but distinct in that it addresses array keys and syntax specific to GMap arrays.

Defaults for map attributes can be set on the GMap settings page.

TOP LEVEL ATTRIBUTES

The top level of a GMap array will look something like this:
  $map = array(
    'id' =>                  // id attribute for the map
    'width' =>               // map width in pixels or %
    'height' =>              // map height in pixels
    'latitude' =>            // map center latitude
    'longitude' =>           // map center longitude
    'zoom' =>                // zoom level
    'maxzoom' =>             // Maximum zoom level for autozoom.
    'extent =>               // map bounds
    'maptype' =>             // baselayer type
    'controltype' =>         // size of map controls
    'align' =>               // CSS alignment for map div.
    'mtc' =>                 // Map type control.
    'baselayers' => array(), // Enabled map baselayers.
    'styles' => array(),     // Shape style definitions.
    'behavior' => array(),   // various map behavior flags
    'markers' => array(),    // array of points on the map
    'shapes' => array(),     // array of shapes to overlay on the map
  );

Here is a description of the top level keys of the map array.

OVERLAYS

There are three types of overlays you can place on a map by default: markers, shapes, and feeds. Each of these classes is represented by a sub-array in the GMap array. Addon modules can add more types of overlays.

MARKERS

  $marker = array(
    'latitude' => 0.000,
    'longitude' => 0.000,
    'options' => array(),
    'text' => 'popup text',
    'markername' =>
    'offset' => 0,
  );

Here is a description of the keys of a marker array.

Attribute: shapes Values: array() Description: an array of shapes to place on the map A "line" or "polygon" shape will be described by an array that looks like this: "polygon", 'points' => array( array(0.000, 0.000), array(0.000, 0.000), array(0.000, 0.000), ), 'style' => array("ff0000", 5, 80, "00ff00", 60), ); ?> Attribute: type Values: "line", "polygon", "circle", "rpolygon" Description: the type of shape to draw Example: "line" Notes: "line" is drawn as a GPolyline. "polygon" is drawn as a GPolygon. "circle" and "rpolygon" (regular polygon) are special cases of "polygon"; points are calculated on the fly. The array defining circles and regular polygons looks different from the arrays defining lines and polygons; see below. Attribute: points Values: array(array(lat1, lon1), array(lat2, lon2), ... , array(latN, lonN)) Description: an array of points defining the shape Example: array(array(44.205835001, -70.3674316406), array(44.3159879052, -68.6096191406)) Notes: Each point itself is an array with two elements (latitude, longitude). The different shapes have different requirements with respect to points. "line" must have at least two points. It is best to break up long lines into shorter segments, because long lines can be buggy--sometimes beginning and ending points are switched. "polygon" should have at least three points; the first and last points should have the same coordinates. Attribute: style Values: array(stroke color, stroke weight, stroke opacity, fill color, fill opacity) Description: a "style array" Example: array("ff0000", 5, 80, "00ff00", 60) Notes: The elements of this array MUST be in the specified order. Stroke and fill colors should be hex color codes (without the leading "#"); Google Maps does not accept named colors. The stroke weight is the width of the line or polygon border in pixels. Stroke and fill opacities should be a percentage between 0 and 100. Fill color and fill opacity are not used for type "line". If shapes of type "line" don't have styles defined, the 'line_default' style will be used; shapes of type "polygon", "circle", and "rpolygon" will use 'poly_defalt'. In previous versions of GMap, opacity was specified as a number between 0 and 1; it is now a number between 0 and 100. On backwards compatibility: there were originally more style options, but they were dependant on xmaps; xmaps is no longer compatible with Google Maps, so these options are now ignored. They are: 'pattern', 'text', 'fillcolor', 'fillopacity'; all except for 'pattern' are now available with different syntax. Circles and regular polygons are special cases of "polygon" and have significantly different shape arrays: 'circle', 'center' => array(0.000, 0.000), // center coordinate of the circle 'radius' => 100, // radius of the circle in kilmeters 'style' => array(), // uses 'poly_default' if not defined ); $shape2 = array( 'type' => 'rpolygon', 'center' => array(0.000, 0.000), // center coordinate of the circle 'numpoints' => 4, // number of vertices the polygon should have 'point2' => array(0.000, 0.000), // one vertice of the polygon 'style' => array(), // uses 'poly_default' if not defined ); ?>