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

rex_googlemap

Plugin, ACE table, Discussion thread
Dependence: rex_googlemap_api

Introduction
Display google map at a div element.

Usage
Sample capx
Show map
Follows these steps to show google map
  1. Wait rex_googlemap_api loaded completed ( "Condition:On loaded" of rex_googlemap_api )
  2. Call "Action:Set center" to set the center location in latlng.
  3. "Condition:On map loaded" will be triggered while loaded map.
Clicking event
"Condition:On clicked" will be triggered while clicking, get the click position in the map by ( "Expression:LastLatitude" , "Expression:LastLongitude" )

Other properties
Other properties like
  • Zoom level ( Action:Set zoom level ) : Zoom level of the map.
  • Map type ( Action:Set map type ) : "Roadmap", "Satellite", "Terrain", "Hybrid"
could be set in properties table or set by corresponded actions.

Resize
Sample capx
Call "Action:Refresh" after map size changed with a little delay.

Snapshot
Sample capx
It could take a snapshot then load it on a sprite, or a canvas object. Markers and info window will be catch, too.
  1. Call "Action:Snapshot" to start taking a snapshot. Add some delay if taking a snapshot under "Condition:On map loaded"
  2. Get result of snapshot under "Condition:On snapsot" by "Expression:Snapshot".
  3. Load snapshot image by "Action:Load image from URL" of sprite object.
Reference: html2canvas

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