logo logo

Docs

GStaticMap WP Plugin Documentation Page

Installation

To install GStaticMap plugin:

  • Download the latest version of GStaticMap plugin.
  • Extract the plugin and copy gstaticmap folder to your wordpress plugin directory (/wp/content-plugins).
  • Go to Plugins menu and activate the plugin.
  • Activate Plugin

    Activate Plugin

  • Go to GStaticMap link in  Settings menu to open plugin settings page.
  • On the settings page, you’ll find that Google static map default URL parameters already filled with predefined values.
  • Settings Page

    Settings Page

The default parameters set in GStaticMap settings page will be used if you don’t specify the parameters inside the gsmap tag when embedding a map.

The default parameters are:

  • API Key, is the most important parameter. Insert your API key here, if you don’t have one, please sign up for the  for a free API key.
  • Center, is the center location of the map. Default value on activation is Chicago, IL. If the marker or path parameter is not specified inside the gsmap tag, this parameter will be used.
  • Zoom, is the zoom factor of the map. Default value on activation is 13.  If the marker or path parameter is not specified  inside the gsmap tag, this parameter will be used.
  • Size, is the rectangular dimension  of the map. Default value on activation is 500×400 (widthxheight).
  • Image Format, is the format of the resulting map image. Default value on activation is jpg.
  • Type, is the type of map to construct. Default value on activation is roadmap.
  • Class, is the CSS class of the map image. This is not part of Google static map URL paramaters.
  • Style, is the CSS style definition of the map image. Like the Class parameter, this paramater is not part of Google static map URL parameters.

Usage

GStaticMap plugin uses tags to embed a map. To embed a map, you must include the gsmap tag and it’s parameters within your post or page.

Basic tag:

This is the default tag ,  use this tag to embed default map. The parameters you’ve set in settings page will be used.

Regular tag:

Use this tag to embed map with your own parameters. Note that the parameters must within the start and end tag and separated by carriage return. The parameters are:

  • center, is the center location of the map. The paramater takes a location either as comma-separated latitude-longitude format {latitide|longitude} e.g. “41.860868,-87.650299 “or as a string address eg “Chicago,IL“. Please refer to Google static map location format for more details.
  • zoom, is the zoom level of the map. This parameter takes a numerical value corresponding to the zoom level of the region desired. Zoom level ranges between 0 (the lowest zoom level, in which the entire world can be seen on one map) to 21 (down to individual buildings).
  • size, is the the rectangular dimensions of the map image. This parameter takes a string of the form widthxheight. Maximum value is 640×640.
  • format, is the format of the resulting map image.  There are several possible formats including gif, png8, png32, jpg and jpg-baseline.
  • maptype, is the type of map to construct. There are several possible maptype values, including roadmap, satellite, hybrid, and terrain.
  • markers, defines one or more markers to attach to the image at specified locations. The marker parameter takes set of value assignments of the following format:
  • markers=markerStyles|markerLocation1|markerLocation2| … etc.

    For example:

    markers=color:blue|label:S|11211|11206|11222

    Please refer to Google static map markers format for more details.

  • path, defines a single path of two or more connected points to overlay on the image at specified locations. This parameter takes a string of point definitions separated by the pipe character (|). The path parameter takes set of value assignments (path descriptors) of the following format:
  • path=pathStyles|pathLocation1|pathLocation2|… etc.

    For example:

    path=color:0×0000ff|weight:5|40.737102,-73.990318|40.749825,-73.987963|40.752946,-73.987384

    Please refer to Google static map markers format for more details.

  • class, is the CSS class of the map image. Use this parameter to style your map image.
  • styles, is the CSS style definition of the map image. Use this parameter to style your map image, e.g: “style=padding:5px;background:#ccc;“.
Note:
GStaticMap plugin conforms to Google Static Maps API V2, all parameters format are conform to the API specification. Please refer to Google Static Maps API V2 page for more details.

Examples

Default map using default tag

Map with center location Husein Sastranegara Airport , zoom factor 14, 400×400 image size , hybrid map type and CSS style “padding:5px;background:#ccc

Map with zoom factor 13, image size 400×400,  and three blue markers (Paris Van Java Bandung, Braga Bandung, and Husein Sastranegara Bandung). Note that the center parameter is optional if using markers,  maptype and format parameters are automatically taken from default parameters set in settings page (roadmap and jpg).

Map with zoom factor 13, image size 400×400, and path that connects  three locations (Paris Van Java BandungBraga Bandung, andHusein Sastranegara Bandung). Note that the center parameter is optional if using markers,  maptype and format parameters are automatically taken from default parameters set in settings page (roadmap and jpg).

bottom

Comments are closed.

bottom