Rex's plugins for Construct2
  • Home
  • Map
  • Tutorial/Templates
  • News
  • About

rex_googlestaticmap

Plugin, ACE table, Discussion thread
Dependence: canvas plugin (optional)

Introduction
Display google static map on sprite or canvas.

Usage
Sample capx
Set locations
Locations could be set by markers, paths , or center.
Markers
Add markers on map in properties table or added by "Action:Add marker".
Here are properties of markers
  • Marker locations (Locations) : marker locations separated by "|" character, like "France|Germany".
  • Marker size (Size)
  • Marker color (Color)
  • Marker label (Label) : A single upper character {A-Z, 0-9} which displayed in marker size to "Middle".
  • Marker icon (Icon)
"Action:Add marker" could be used for each marker, to set their own color, label or icon.
"Action:Clean all markers" could clean configuration of all markers.
Paths
Add paths on map in properties table or added by "Action:Add path".
Here are properties of paths
  • Path locations ( Path start , Path end ) : Path locations separated by "|" character. Or set start and end location in "Path start", "Path end " parameter.
  • Path weight (Weight ) : The thickness of the path in pixels.
  • Path color ( Path color ): The color of path.
  • Area fill color ( Area fill color ) : The color to fill the polygonal area. i.e. add 3 locations in "Path locations", like France|Germany|Switzerland. Or set "Path start" to "France", "Path end" to "Germany|Switzerland".
"Action:Add path" could be used for each path, to set their own path color, weight, or area filled color.
"Action:Clean all paths" could clean configuration of all paths.
Center
Set "center" property in properties table or set by "Action:Set center". This will only affect while no marker or path added.

Other properties
Other properties like
  • Zoom level ( Action:Set zoom level ) : Zoom level of the map. Set (-1) to ignore this parameter.
  • Map type ( Action:Set map type ) : "Roadmap", "Satellite", "Terrain", "Hybrid"
  • Format ( Action:Set image format ) : "png8", "png32", "gif", "jpg", "jpg-baseline"
could be set in properties table or set by corresponded actions.

Load map into canvas
Set "Initial loading" to "Yes" to load map while canvas created. Or call "Action:Load map" after marker, path or center has configured.
Load map into sprite
Sample capx
Put this behavior under sprite object. And call "action: Load image from URL" of sprite with URL parameter to "Expression:MapURL" of this behavior.

Create a free web site with Weebly
  • Home
  • Map
  • Tutorial/Templates
  • News
  • About