104
GMap ActionScript 2 Flash Component http:www.afcomponents.com/components/g_map GMap 2.6 ActionScript 2 Flash Component Release 2.6 Updated 07/24/2007 Download UR:http://www.afcomponents.com/components/g_map Support Forum: http://www.afcomponents.com/forum/viewforum.php?f=10 - 1 of 104 -

GMap Documentation

Embed Size (px)

Citation preview

Page 1: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

GMap 2.6ActionScript 2 Flash Component

Release 2.6Updated 07/24/2007

Download UR:http://www.afcomponents.com/components/g_mapSupport Forum: http://www.afcomponents.com/forum/viewforum.php?f=10

- 1 of 104 -

Page 2: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

Table of Contents

GMap Core.................................................................................................................................4Properties.......................................................................................................................................................... 4Methods............................................................................................................................................................. 5Events.............................................................................................................................................................. 11

GLayer......................................................................................................................................18Methods........................................................................................................................................................... 18Properties........................................................................................................................................................ 20Events.............................................................................................................................................................. 21

GKMLLayer..............................................................................................................................23Methods........................................................................................................................................................... 23Properties........................................................................................................................................................ 25Events.............................................................................................................................................................. 25

GPoint.......................................................................................................................................28Methods........................................................................................................................................................... 28Properties........................................................................................................................................................ 29Events.............................................................................................................................................................. 35

GLine........................................................................................................................................38Methods........................................................................................................................................................... 38Properties........................................................................................................................................................ 41Events.............................................................................................................................................................. 47

Gpolygon..................................................................................................................................51Methods........................................................................................................................................................... 51Properties........................................................................................................................................................ 57Events.............................................................................................................................................................. 64

GOverlay..................................................................................................................................69Methods........................................................................................................................................................... 69Properties........................................................................................................................................................ 70Events.............................................................................................................................................................. 72

GInfoWindow...........................................................................................................................75Methods........................................................................................................................................................... 75Properties........................................................................................................................................................ 75

GTypeControl..........................................................................................................................84Methods........................................................................................................................................................... 84Properties........................................................................................................................................................ 84Events.............................................................................................................................................................. 88

GPositionControl....................................................................................................................90

- 2 of 104 -

Page 3: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

Methods........................................................................................................................................................... 90Properties........................................................................................................................................................ 90Events.............................................................................................................................................................. 94

GZoomControl.........................................................................................................................95Methods........................................................................................................................................................... 95Properties........................................................................................................................................................ 95Events............................................................................................................................................................ 100

GNavigatorControl................................................................................................................102Methods......................................................................................................................................................... 102Properties...................................................................................................................................................... 102Events............................................................................................................................................................ 103

- 3 of 104 -

Page 4: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

GMap Core

Properties

Property Type DescriptionINSPECTABLE Component PropertiescenterCross Boolean Defines whether the center cross is displayed (true)

or not (false).

ActionScript Example

gMap.centerCross = true;centerCrossColor Number A Hexadecimal color value.

ActionScript Example

gMap.centerCross = true;gMap.centerCrossColor = 0xFF0000;

animatePan Boolean Determines whether pan is animated.

ActionScript Example

gMap.animatePan = true;animateZoom Boolean Determines whether zoom is animated.

ActionScript Example

gMap.animateZoom = false;controlByKeyboard Boolean Enables zoom and control with the keyboard.

ActionScript Example

gMap.controlByKeyboard = true;controlByMouse Boolean Enables mouse controls. Property overrides

controlByMouseWheel settings.

ActionScript Example

gMap.controlByMouse = false;controlByMouseWheel Boolean Enables mouse wheel zooming. Please note that

controlByMouse has to be set to true.

ActionScript Example

gMap.controlByMouse = true;gMap.controlByMouseWheel = true;

doubleClickMode String Defines map behavior on Mouse Double Click event.

- 4 of 104 -

Page 5: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

Options

1. pan:String2. zoom:String3. none:String

ActionScript Example

gMap.doubleClickMode ="zoom";latitude Number Defines initial latitude.

ActionScript Example

gMap.latitude = 50;longitude Number Defines initial longitude.

ActionScript Example

gMap.longitude = -50;mapType String Property defines displayed map type

Options

1. map:String2. satellite:String3. hybrid:String

ActionScript Example

gMap.mapType = "hybrid";zoom Number Initial zoom level.

ActionScript Example

gMap.zoom = 3;

Methods

Method DescriptiongetCenter():Object; Returns center object.

Return values

1. lat:Number2. lng:Number

ActionScript Example

- 5 of 104 -

Page 6: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

var center = gMap.getCenter();trace(center.lat); //Latitudetrace(center.lng); //Longitude

setCenter({lat:Number, lng:Number}, zoom:Number);

Sets map center.

ActionScript Example

gMap.setCenter({lat:39,lng:-104},10);getBounds():GBounds; Returns bounds rectangle.

1. left:Number2. top:Number3. right:Number4. bottom:Number

ActionScript Example

var bounds = gMap.getBounds();

trace(bounds.top);trace(bounds.right);trace(bounds.bottom);trace(gMap.left);

setBounds(GBounds); Set the map to the center of a rectangle specified by a rectangle object.

ActionScript Example

gMap.setBounds(map.GBounds(left_lng, top_lat, right_lng, bottom_lat));

zoomIn([Number]); Increase zoom level to the next level or to a specified value.

ActionScript Example

gMap.zoomIn(5);zoomOut([Number]); Decrease zoom level to the previous level or to a

specified value.

ActionScript Example

gMap.zoom = 5;gMap.zoomOut(3);trace(gMap.zoom); // Zoom leve is 2

savePosition(); Stores current map position for later recall returnToSavedPosition().

ActionScript Example

gMap.savePosition();

- 6 of 104 -

Page 7: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

getSavedPosition():Object Returns saved position object

Return Value1. lat:Number2. lng:Number3. zoom:Number

ActionScript Example

gMap.savePosition();var position = gMap.getSavedPosition();trace(position.lat);trace(position.lng);trace(position.zoom)

returnToSavedPosition(); Returns to the saved position if savedPosition is defined, otherwise returns to the default position.

ActionScript Example

gMap.returnToSavedPosition();returnToDefaultPosition(); Triggered whenever center button is clicked in the

expanded control.

ActionScript Example

gMap.returnToDefaultPosition();panTo(GLocation(lat:Number,lng:Number)); Changes the center point of the map to the given

point. If the point is already visible in the current map view, change the center in a smooth animation.

ActionScript Example

gMap.panTo({lat:39,lng:-104});panBy({lat:Number, lng:Number}); Starts a pan animation by the given distance in

pixels.

ActionScript Example

gMap.panBy({lat:39,lng:-104});panByXY({x:Number, y:Number}); Starts a pan animation by the given distance in X Y

coordinates.

ActionScript Example

gMap.panByXY({x:20,y:30});moveNorth([distance:Number]); Moves north. If distance argument is set moves to a

specified distance in pixels.

ActionScript Example

- 7 of 104 -

Page 8: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

gMap.moveNorth(20); // Moves 20 pixels north

moveEast([distance:Number]); Moves east. If distance argument is set moves to a specified distance in pixels.

ActionScript Example

gMap.moveEast(20);// Moves 20 pixels east

moveSouth([distance:Number]); Moves south. If distance argument is set moves to a specified distance in pixels.

ActionScript Example

gMap.moveSouth(20);// Moves 20 pixels south

moveWest([distance:Number]); Moves west. If distance argument is set moves to a specified distance in pixels.

ActionScript Example

gMap.moveWest(20);// Moves 20 pixels west

getMapTypes():Object; Array of three map types (map, satellite, hybrid).

ActionScript Example

gMap.getMapTypes();setMapType(type:String); Sets map display to a specified map type.

ActionScript Example

gMap.setMapType("satellite");getSelectedMapType():String; Returns currently displayed map type.

ActionScript Example

gMap.getSelectedMapType();addControl(control:Object); Adds controls.

ActionScript Example

gMap.addControl(gMap.GTypeControl());gMap.addControl(gMap.GZoomControl());gMap.addControl(gMap.GPositionControl());gMap.addControl(gMap.GNavigatorControl());

addPoint(Point:Object):GPoint Adds a point.

- 8 of 104 -

Page 9: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

ActionScript Example

gMap.addPoint({lat:39.74002, lng:-104.992261, name:"Denver"});

getPoint([id:Number,name:String]):GPoint Returns specified GPoint object.

ActionScript Example

gMap.addPoint({lat:39.74002, lng:-104.992261, name:"Denver"});

var point = gMap.getPoint("Denver");trace(point.name); // Denver

addLine(Line:Object):GLine Adds a line.

ActionScript Example

//Create array of pointsvar linePoints:Array = new Array();

//Add Denver locationlinePoints.push({lat:39.740038,lng:-104.992272});

//Add Miami locationlinePoints.push({lat:25.728989,lng:-80.237446});

//Create line gMap.addLine({points:linePoints});

getLine([id:Number,name:String]):GLine Returns specified GLine object.

ActionScript Example

//Create array of pointsvar linePoints:Array = new Array();

//Add Denver locationlinePoints.push({lat:39.740038,lng:-104.992272});

//Add Miami locationlinePoints.push({lat:25.728989,lng:-80.237446});

//Create line gMap.addLine({points:linePoints, name:”My Line”});

var line = gMap.getLine("My Line");trace(line.name); // My Line

- 9 of 104 -

Page 10: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

addPolygon(Polygon:Object):GPolygon Adds a polygon.

ActionScript Example

//Create array of pointsvar shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

//Add polygongMap.addPolygon({points:shape});

getPolygon([id:Number,name:String]):GPolygon

Returns specified GPolygon object.

ActionScript Example

//Create array of pointsvar shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

//Add polygongMap.addPolygon({points:shape, name:"My Polygon"});

var polygon = gMap.getPolygon("My Polygon");trace(polygon.name); // My Polygon

addOverlay(Overlay:Object):GOverlay Adds a image overlay.

ActionScript Example

gMap.addOverlay({path:"image.gif", north:50, west:-100, south:-50, east:100});

getOverlay([id:Number,name:String]):GOverlay

Returns specified GOverlay object.

ActionScript Example

gMap.addOverlay({name:"My Overlay", path:"image.gif", north:50, west:-100, south:-50, east:100});

var overlay = gMap.getOverlay();trace(overlay.name); // My Overlay

addKMLLayer(KMLLayer:Object):KMLLayer Adds a new KML Layer.

- 10 of 104 -

Page 11: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

ActionScript Example

gMap.addKMLLayer({path:"file.kml"});addLayer({layer:Object}):GLayer Adds a new layer object to the map.

ActionScript Example

var layer = gMap.addLayer({name:"My Layer"});layer.addPoint({lat:0, lng:0});

getLayer(id:Number name:String):GLayer; Returns a layer object specified by id argument or an Array of layer objects that match name parameter.

ActionScript Example

gMap.addLayer({id:1,name:"My Layer"});var layer = gMap.getLayer("My Layer");trace(layer.name); // My Layer

getLayers():Array Returns total number of layers.

ActionScript Example

var layers = gMap.getLayers();trace(layers);

removeLayer({layer:Object}); Removes layer object form the map.

ActionScript Example

gMap.removeLayer(layer);removeLayers(); Removes all layers from the map except for the

default layer.

ActionScript Example

gMap.removeLayers();

Events

Event Return value DescriptionMAP_READY type

targetTriggered after marker object has been initiated.

ActionScript Example

function eventResponder(event:Object){trace(event.type);trace(event.target);

}gMap.addEventListener("MAP_READY",

- 11 of 104 -

Page 12: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

eventResponder);MAP_ERROR type

targetmessage:String

Triggered whenever error within the component occurs.

ActionScript Example

function eventResponder(event:Object){trace(event.type);trace(event.target);

trace(event.message);}gMap.addEventListener("MAP_ERROR", eventResponder);

MAP_COPYRIGHT_CHANGED typetargetcopyright:ArraycopyrightNotice:Arraybounds:GBoundszoom:Number

Triggered whenever copyright notice is updated.

ActionScript Example

function eventResponder(event:Object){trace(event.type);trace(event.target);trace(event.copyright);//trace(event.copyrightNotice);trace(event.bounds);trace(event.zoom);

}

gMap.addEventListener("MAP_COPYRIGHT_CHANGED", eventResponder);

Known IssuecopyrightNotice property returns bunch of values and can impact plugin performance.

MAP_POSITION_CHANGED typetargetnewLatnewLngoldLatoldLng

Triggered whenever map location is changed. After the position is changed for the first time oldLat and oldLng values are undefined.

ActionScript Example

function eventResponder(event:Object){trace(event.type);trace(event.target);trace(event.newLat);trace(event.newLng);trace(event.oldLat);trace(event.oldLng);

}

gMap.addEventListener("MAP_POSITION_CHANGED", eventResponder);

MAP_ZOOM_CHANGED typetargetoldZoomnewZoom

Triggered whenever map zoom value is changed.

ActionScript Example

function eventResponder(event:Object){

- 12 of 104 -

Page 13: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

trace(event.type);trace(event.target);trace(event.oldZoom);trace(event.newZoom);

}

gMap.addEventListener("MAP_ZOOM_CHANGED", eventResponder);

MAP_TYPE_CHANGED typetarget

Triggered whenever map type is changed.

ActionScript Example

function eventResponder(event:Object){trace(event.type);trace(event.target);

}

gMap.addEventListener("MAP_TYPE_CHANGED", eventResponder);

MAP_ON_DRAG typetarget

Triggered whenever map is dragged.

ActionScript Example

function eventResponder(event:Object){trace(event.type);trace(event.target);

}

gMap.addEventListener("MAP_ON_DRAG", eventResponder);

MAP_ON_DRAG_START typetarget

Triggered whenever map dragging starts.

ActionScript Example

function eventResponder(event:Object){trace(event.type);trace(event.target);

}

gMap.addEventListener("MAP_ON_DRAG_START", eventResponder);

MAP_ON_DRAG_STOP typetarget

Triggered whenever map dragging stops.

ActionScript Example

function eventResponder(event:Object){trace(event.type);trace(event.target);

}

gMap.addEventListener("MAP_ON_DRAG_STOP", eventResponder);

MAP_ON_ROLL_OVER typetarget

Triggered onRollOver mouse event.

- 13 of 104 -

Page 14: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

ActionScript Example

function eventResponder(event:Object){trace(event.type);trace(event.target);

}

gMap.addEventListener("MAP_ON_ROLL_OVER", eventResponder);

MAP_ON_ROLL_OUT typetargetlatlng

Triggered onRollOut mouse event.

ActionScript Example

function eventResponder(event:Object){trace(event.type);trace(event.target);

}

gMap.addEventListener("MAP_ON_ROLL_OUT", eventResponder);

MAP_ON_RELEASE typetargetlatlng

Triggered onRollOut mouse event. Returns coordinates of clicked point.

ActionScript Example

function eventResponder(event:Object){trace(event.type);trace(event.target);trace(event.lng);trace(event.lat);

}

gMap.addEventListener("MAP_ON_RELEASE", eventResponder);

MAP_ON_PRESS typetargetlatlng

Triggered onPress mouse event. Returns coordinates of the clicked point.

ActionScript Example

function eventResponder(event:Object){trace(event.type);trace(event.target);trace(event.lng);trace(event.lat);

}

gMap.addEventListener("MAP_ON_PRESS", eventResponder);

MAP_ON_RELEASE_OUTSIDE typetarget

Triggered onReleaseOutside mouse event.

ActionScript Example

function eventResponder(event:Object){trace(event.type);trace(event.target);

- 14 of 104 -

Page 15: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

}

gMap.addEventListener("MAP_ON_RELEASE_OUTSIDE", eventResponder);

MAP_CLICK typetargetlatlng

Triggered onMouseDown mouse event. Returns coordinates of the clicked point.

ActionScript Example

function eventResponder(event:Object){trace(event.type);trace(event.target);trace(event.lng);trace(event.lat);

}

gMap.addEventListener("MAP_CLICK", eventResponder);

MAP_DBL_CLICK typetargetlatlng

Triggered whenever mouse is double clicked. Returns coordinates of the clicked point.

ActionScript Example

function eventResponder(event:Object){trace(event.type);trace(event.target);trace(event.lng);trace(event.lat);

}

gMap.addEventListener("MAP_DBL_CLICK", eventResponder);

MAP_LOAD_START typetarget

Triggered when map loading starts.

ActionScript Example

function eventResponder(event:Object){trace(event.type);trace(event.target);

}

gMap.addEventListener("MAP_LOAD_START", eventResponder);

MAP_LOAD_PROGRESS typetargettotalTilescurrentTile

Triggered during loading of the map tiles.

ActionScript Example

function eventResponder(event:Object){trace(event.type);trace(event.target);trace(event.totalTiles);trace(event.currentTile);

}

gMap.addEventListener("MAP_LOAD_PROGRESS

- 15 of 104 -

Page 16: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

", eventResponder);MAP_LOAD_COMPLETE type

targetTriggered whenever tile loading is complete.

ActionScript Example

function eventResponder(event:Object){trace(event.type);trace(event.target);

}

gMap.addEventListener("MAP_LOAD_COMPLETE", eventResponder);

MAP_PAN typetargetlatlng

Triggered whenever panBy() or panTo() methods are called.

ActionScript Example

function eventResponder(event:Object){trace(event.type);trace(event.target);trace(event.lat);trace(event.lng);

}

gMap.addEventListener("MAP_PAN", eventResponder);

Note: If animatePan is set to false this event is not triggered.

MAP_PAN_START typetargetlatlng

Triggered when pan starts

ActionScript Example

function eventResponder(event:Object){trace(event.type);trace(event.target);trace(event.lat);trace(event.lng);

}

gMap.addEventListener("MAP_PAN_START", eventResponder);

MAP_PAN_STOP typetargettallng

Triggered when pan ends.

ActionScript Example

function eventResponder(event:Object){trace(event.type);trace(event.target);trace(event.lat);trace(event.lng);

}

gMap.addEventListener("MAP_PAN_START", eventResponder);

- 16 of 104 -

Page 17: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

- 17 of 104 -

Page 18: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

GLayer

Methods

Method DescriptionLayer methods. Methods applied to to the layer object directly - GLayer.methodName();getGeometryObjectCount():Number Returns total number of geometry objects (points, lines,

polygons) for this layer.

ActionScript Example

// Add layervar myLayer =

// Add pointgMap.addLayer({name:"Locations"});myLayer.addPoint({lat:0,lng:0});

// Get countvar count = myLayer.getGeometryObjectCount();

trace(count); // 1getGeometryObjects():Array Returns array of all geometry objects displayed on this

layer.

ActionScript Example

// Add layervar myLayer = gMap.addLayer({name:"Locations"});

// Add point myLayer.addPoint({lat:0,lng:0});

// Get array of geometry objectsvar objects = myLayer.getGeometryObjects();

trace(objects); //[object Object]removeGeometryObject({GPoint:Object}); Removes specified geometry object.

ActionScript Example

// Add layervar myLayer = gMap.addLayer({name:"Locations"});

// Add pointvar point = myLayer.addPoint({lat:0,lng:0});

// Remove pointmyLayer.removeGeometryObject(point);

updatePosition(); Force update point, line, polygon, overlay positions for

- 18 of 104 -

Page 19: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

that layer.

ActionScript Example

// Add layervar myLayer = gMap.addLayer({name:"Locations"});

// Add pointvar point = myLayer.addPoint({lat:0,lng:0});

// Update layer positionmyLayer.updatePosition()

setZindex(Number); Sets layer stacking order. If set to 0 layer will be moved to the very bottom of the stack.

ActionScript Example

// Add bottom layervar bottomLayer = gMap.addLayer({name:"bottomLayer"});

// Add point to the bottom layerbottomLayer.addPoint({lat:0,lng:0});

// Add top layervar topLayer = gMap.addLayer({name:"topLayer"});

// Add point to the top layertopLayer.addPoint({lat:0,lng:1, fillRGB:0xFF0000});

// Move bottom layer to the topbottomLayer.setZindex(topLayer.getZindex()+1);

getZindex():Number Returns layer depth value.

ActionScript Example

// Add a layervar myLayer = gMap.addLayer({name:"myLayer"});

// Get layer depthtrace(myLayer.getZindex());

clear(); Removes all objects from a layer.

ActionScript Example

// Add layervar myLayer = gMap.addLayer({name:"myLayer"});

// Add pointmyLayer.addPoint({lat:0,lng:0});

- 19 of 104 -

Page 20: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

// Clear layermyLayer.clear();

remove(); Removes layer object.

ActionScript Example

// Add layervar myLayer = gMap.addLayer({name:"myLayer"});

// Add pointmyLayer.addPoint({lat:0,lng:0});

// Remove layer completelymyLayer.remove();

hide(); Hides current layer. Sets visible property to false.

ActionScript Examples

// Hide visible layermyLayer.hide();

show(); Shows current layer. Sets visible property to true.

ActionScript Example

// Shows visible layermyLayer.show();

Properties

Property Type Descriptionname String Defines layer name.

ActionScript Example

// Add layervar myLayer = gMap.addLayer({name:"myLayer"});

id Number Read only. Layer identifier.

ActionScript Example

// Add layervar myLayer = gMap.addLayer({name:"myLayer"});

// Get layer idtrace(myLayer.id);

visible Boolean Read only. Defines whether layer is visible. Use show(); hide(); methods for modifying visible parameter.

zIndex Number Read only. Defines layer stacking order (Flash depth).

- 20 of 104 -

Page 21: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

Use layer.setZindex(Number); method for modifying zIndex parameter.

ActionScript Example

// Add layervar myLayer = gMap.addLayer({name:"myLayer"});

// Get layer depth indextrace(myLayer.zIndex);

Events

Event Return value DescriptionLAYER_ERROR type

targetmessage

Triggered whenever error occurs. If there is a problem loading custom marker this event will be triggered.

ActionScript Example

// Add layervar myLayer = gMap.addLayer({name:"myLayer"});

function eventResponder(event:Object){trace(event.type);trace(event.target);trace(event.message);

}

// Add event listenermyLayer.addEventListener("LAYER_ERROR", eventResponder);

LAYER_CHANGED targettype

Triggered when layer properties have been changed. For example, if show(); or hide(); methods are called this event will be fired.

ActionScript Example

// Add layervar myLayer = gMap.addLayer({name:"myLayer"});

function eventResponder(event:Object){trace(event.type);trace(event.target);

}

// Add event listenermyLayer.addEventListener("LAYER_CHANGED", eventResponder);

LAYER_GEOMETRY_ADDED targettypeobject

Triggered once a geometry object (point, line, polygon) is added to a layer.

ActionScript Example

// Add layer

- 21 of 104 -

Page 22: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

var myLayer = gMap.addLayer({name:"myLayer"});

function eventResponder(event:Object){trace(event.type);trace(event.target);trace(event.object);

}

// Add event listenermyLayer.addEventListener("LAYER_GEOMETRY_ADDED", eventResponder);

// Add pointmyLayer.addPoint({lat:0,lng:0});

LAYER_GEOMETRY_REMOVED targettypeobject

Triggered once a geometry object (point, line, polygon) is removed from a layer.

ActionScript Example

// Add layervar myLayer = gMap.addLayer({name:"myLayer"});

function eventResponder(event:Object){trace(event.type);trace(event.target);trace(event.object);

}

// Add event listenermyLayer.addEventListener("LAYER_GEOMETRY_REMOVED", eventResponder);

// Add pointmyLayer.addPoint({lat:0,lng:0});

// Remove pointmyLayer.clear();

- 22 of 104 -

Page 23: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

GKMLLayerMethods

Method DescriptionLayer methods. Methods applied to to the layer object directly - GLayer.methodName();getGeometryObjectCount():Number Returns total number of geometry objects (points, lines,

polygons, overlays) for this layer. Method returns correct value only after the KML file is loaded.

ActionScript Example

//Add Layervar kmlLayer = gMap.addKMLLayer({path:"file.kml"});

kmlLayer.addEventListener("LAYER_GEOMETRY_ADDED", eventResponder);

function eventResponder(event:Object){trace(event.target.getGeometryObjectCount());}

getGeometryObjects():Array Returns array of all geometry objects displayed on this layer.

ActionScript Example

var kmlLayer = gMap.addKMLLayer({path:"file.kml"});

kmlLayer.addEventListener("LAYER_GEOMETRY_ADDED", eventResponder);

function eventResponder(event:Object){trace(event.target.getGeometryObjects());}

removeGeometryObject({GObject:Object}); Removes specified geometry object.

ActionScript Example

var kmlLayer = gMap.addKMLLayer({path:"file.kml"});

kmlLayer.addEventListener("LAYER_GEOMETRY_ADDED", eventResponder);

function eventResponder(event:Object){event.target.removeGeometryObject(event.target.getGeometryObjects()[0]);}

updatePosition(); Force update point, line, polygon, overlay positions for that layer.

- 23 of 104 -

Page 24: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

ActionScript Example

var kmlLayer = gMap.addKMLLayer({path:"file.kml"});kmlLayer.updatePosition();

setZindex(Number); Sets layer stacking order. If set to 0 layer will be moved to the very bottom of the stack.

ActionScript Example

var kmlLayer = gMap.addKMLLayer({path:"file.kml"});

kmlLayer.setZindex(5);getZindex():Number Returns layer depth value.

ActionScript Example

var kmlLayer = gMap.addKMLLayer({path:"file.kml"});

kmlLayer.getZindex();clear(); Removes all objects from a layer.

ActionScript Example

var kmlLayer = gMap.addKMLLayer({path:"file.kml"});

kmlLayer.clear();remove(); Removes layer object.

ActionScript Example

var kmlLayer = gMap.addKMLLayer({path:"file.kml"});

kmlLayer.remove();hide(); Hides current layer. Sets visible property to false.

ActionScript Examples

var kmlLayer = gMap.addKMLLayer({path:"file.kml"});

kmlLayer.hide();show(); Shows current layer. Sets visible property to true.

ActionScript Example

- 24 of 104 -

Page 25: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

var kmlLayer = gMap.addKMLLayer({path:"file.kml"});

kmlLayer.show();

Properties

Property Type Descriptionname String Defines layer name.

ActionScript Example

// Add layervar kmlLayer = gMap.addKMLLayer({path:"file.kml"});kmlLayer.name = "My KML Layer";

id Number Read only. Layer identifier.

ActionScript Example

// Add layervar kmlLayer = gMap.addKMLLayer({path:"file.kml"});

trace(kmlLayer.id);visible Boolean Read only. Defines whether layer is visible. Use show();

hide(); methods for modifying visible parameter.zIndex Number Read only. Defines layer stacking order (Flash depth).

Use layer.setZindex(Number); method for modifying zIndex parameter.

ActionScript Example

// Add layervar kmlLayer = gMap.addKMLLayer({path:"file.kml"});

trace(kmlLayer.zIndex);

Events

Event Return value DescriptionLAYER_ERROR type

targetmessage

Triggered whenever error occurs. If there is a problem loading custom marker this event will be triggered.

ActionScript Example

// Add layervar kmlLayer =

- 25 of 104 -

Page 26: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

gMap.addKMLLayer({path:"file.kml"});

function eventResponder(event:Object){trace(event.type);trace(event.target);trace(event.message);

}

// Add event listenerkmlLayer.addEventListener("LAYER_ERROR", eventResponder);

LAYER_CHANGED targettype

Triggered when layer properties have been changed. For example, if show(); or hide(); methods are called this event will be fired.

ActionScript Example

// Add layervar kmlLayer = gMap.addKMLLayer({path:"file.kml"});

function eventResponder(event:Object){trace(event.type);trace(event.target);

}

// Add event listenerkmlLayer.addEventListener("LAYER_CHANGED", eventResponder);

LAYER_GEOMETRY_ADDED targettypeobject

Triggered once a geometry object (point, line, polygon) is added to a layer.

ActionScript Example

// Add layervar kmlLayer = gMap.addKMLLayer({path:"file.kml"});

function eventResponder(event:Object){trace(event.type);trace(event.target);trace(event.object);

}

kmlLayer.addEventListener("LAYER_GEOMETRY_ADDED", eventResponder);

LAYER_GEOMETRY_REMOVED targettypeobject

Triggered once a geometry object (point, line, polygon) is removed from a layer.

ActionScript Example

var kmlLayer = gMap.addKMLLayer({path:"file.kml"});

function eventResponder(event:Object){trace(event.type);

- 26 of 104 -

Page 27: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

trace(event.target);trace(event.object);

}

kmlLayer.addEventListener("LAYER_GEOMETRY_REMOVED", eventResponder);

KML_LOAD_COMPLETE targettype

Triggered once KML is finished loading.

ActionScript Example

var kmlLayer = gMap.addKMLLayer({path:"file.kml"});

function eventResponder(event:Object){trace(event.type);trace(event.target);

}

kmlLayer.addEventListener("KML_LOAD_COMPLETE", eventResponder);

- 27 of 104 -

Page 28: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

GPoint

Methods

Method DescriptionGPoint methods. Methods should be applied to the GPoint object directly - GPoint.methodName(); setCustomIcon(path:String); Sets custom icon for specified marker. Supported

formats are: JPEG, GIF, PNG, SWF,MOVIE CLIP. If there is no [.ext] at the end of the file, component is going to look for internal movie.

ActionScript Example

// Add pointvar point = gMap.addPoint({lat:0,lng:0});

// Set custom iconpoint.setCustomIcon("image.jpg");

updatePosition(); Force update position _x and _y position.

ActionScript Example

// Add pointvar point = gMap.addPoint({lat:0,lng:0});

// Force update point positionpoint.updatePosition();

remove(); Deletes geometry object.

ActionScript Example

// Add pointvar point = gMap.addPoint({lat:0,lng:0});

// Remove point objectpoint.remove();

show(); Sets visibility parameter to true.

ActionScript Example

// Add pointvar point = gMap.addPoint({lat:0,lng:0});

// Show pointpoint.show();

hide(); Sets visibility parameter to false.

ActionScript Example

// Add pointvar point = gMap.addPoint({lat:0,lng:0});

- 28 of 104 -

Page 29: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

// Hide pointpoint.hide();

openInfoWindow(GInfoWindow); Opens information window anchored to this point.

ActionScript Example

// Add pointvar point = gMap.addPoint({lat:0,lng:0});

// Open info windowpoint.openInfoWindow();

closeInfoWindow(); Closes information window.

ActionScript Example

// Add pointvar point = gMap.addPoint({lat:0,lng:0});

// Close info windowpoint.closeInfoWindow();

Properties

Property Type Descriptionindex String String that shows up in the bubble.

ActionScript Example

gMap.addPoint({lat:0,lng:0,index:"A"});radius Number Property defines default icon radius. Tail height is

proportional to the radius value.

ActionScript Example

gMap.addPoint({lat:0,lng:0,radius:15});icon String Defines path to the icon file.

ActionScript Example

gMap.addPoint({lat:0,lng:0,icon:”image.jpg”});

iconOffset Object Defines pixel offset on x and y axis.

1. x:Number 2. y:Number

ActionScript ExamplegMap.addPoint({lat:0,lng:0,icon:"image.jpg",

- 29 of 104 -

Page 30: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

iconOffset:{x:-300,y:-199}});

iconAlignment String Defines icon's alignment relative to 0,0 of the point. For horizontal alignment select any of: "left", "center", "right" values. For vertical alignment select any of: "top", "middle", "bottom" values. Combine these two values with "-" delimiter. Default value is set to "top-left".

ActionScript Example

gMap.addPoint({lat:0,lng:0,iconAlignment:"bottom left"});

label Boolean Property defines whether marker label is displayed. Default value is set to true.

ActionScript Example

var point = gMap.addPoint({lat:0,lng:0,label:"Lablel"});

name String Geometry object title. Parameter will be displayed at the top of the information window.

ActionScript Example

var point = gMap.addPoint({lat:0,lng:0,name:"Name"});

lng Number Point longitude.

ActionScript Example

var point = gMap.addPoint({lat:0,lng:0});lat Nubmer Point latitude.

ActionScript Example

var point = gMap.addPoint({lat:0,lng:0});description String HTML enabled description.

ActionScript Example

var point = gMap.addPoint({lat:0,lng:0,description:"Description"});

attributes Array Contains additional information.

ActionScript Example

var point = gMap.addPoint({lat:0,lng:0,attributes:["array value"]});

- 30 of 104 -

Page 31: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

enabled Boolean Defines whether Geometry object is enabled. If set to false, objects button events are going to be disabled.

ActionScript Example

gMap.addPoint({lat:0, lng:0,enabled:false});drag Boolean Defines whether Geometry Object can be dragged.

ActionScript Example

gMap.addPoint({lat:0, lng:0, drag:true});visible Boolean Defines whether Geometry Object is visible.

ActionScript Example

gMap.addPoint({lat:0, lng:0, visible:true});zIndex Number Defines depth of the Geometry Object on a particular

layer. This value is auto incremented.

ActionScript Example

gMap.addPoint({lat:0, lng:0, zIndex:1});zIndexAuto Boolean Indicates whether Geometry Object is brought to the

top of the stack on mouse event. Geometry Object must be enabled for this property to kick in.

ActionScript Example

gMap.addPoint({lat:0, lng:0,zIndexAuto:true});

Geometry object appearance propertieslabelFont Font The name of a font for text as a string.

ActionScript Example

var point = gMap.addPoint({lat:0, lng:0});point.index = "A"point.labelFont = "_serif";

labelRGB Number The color of text using this text format. A number containing three 8-bit RGB components; for example, 0xFF0000 is red, and 0x00FF00 is green.

ActionScript Example

var point = gMap.addPoint({lat:0, lng:0});point.index = "A"point.labelRGB = 0xFF0000;

labelSize Number An integer that indicates the point label size.

ActionScript Example

- 31 of 104 -

Page 32: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

var point = gMap.addPoint({lat:0, lng:0});point.index = "A"point.labelSize = 13;

labelFormat Object Object that defines TextFormat for the label text field.

ActionScript Example

// Create text format object

var text_fmt = new TextFormat();with(text_fmt){

font = "Verdana";size = 10;bold = true;color = 0xFF0000;

}

var point = gMap.addPoint({lat:0, lng:0});point.index = "A"point.labelFormat = text_fmt;

stroke Boolean Property indicates whether stroke is displayed. Default value is set to true.

ActionScript Example

var point = gMap.addPoint({lat:0, lng:0});point.stroke = false;

strokeThickness Number An integer that indicates the thickness of the line in points; valid values are 0 to 255. If a number is not specified, or if the parameter is undefined, a line is not drawn. If a value of less than 0 is passed, Flash Player uses 0. The value 0 indicates hairline thickness; the maximum thickness is 255. If a value greater than 255 is passed, the Flash interpreter uses 255.

ActionScript Example

var point = gMap.addPoint({lat:0, lng:0});point.strokeThickness = 5;

strokeRGB Number A hexadecimal color value of the line; for example, red is 0xFF0000, blue is 0x0000FF, and so on. If a value isn't indicated, Flash uses 0x000000 (black).

ActionScript Example

var point = gMap.addPoint({lat:0, lng:0});point.strokeRGB = 0xFF0000;

strokeAlpha Number An integer that indicates the alpha value of the line's color; valid values are 0 to 100. If a value isn't indicated, Flash uses 100 (solid). If the value is less than 0, Flash uses 0; if the value is greater than 100,

- 32 of 104 -

Page 33: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

Flash uses 100.

ActionScript Example

var point = gMap.addPoint({lat:0, lng:0});point.strokeAlpha = 50;

fill Boolean Property defines whether maker outline is filled. Default value is set to true.

ActionScript Example

var point = gMap.addPoint({lat:0, lng:0});point.fill = true;

fillRGB Number A hexadecimal color value; for example, red is 0xFF0000, blue is 0x0000FF. If this value is not provided or is undefined, a fill is not created.

ActionScript Example

var point = gMap.addPoint({lat:0, lng:0});point.fillRGB = 0xFF0000;

fillGradient Object References object that defines gradient fill. Please see Flash 8 beginGradientFill();

ActionScript Example

// Create gradient objectvar pointGradient:Object = new Object;

pointGradient.fillType = "linear";pointGradient.colors = [0xFF33CC, 0xFFFFFF];pointGradient.alphas = [80, 100];pointGradient.ratios = [180, 255];pointGradient.matrix = new flash.geom.Matrix();pointGradient.matrix.createGradientBox(100, 50, (Math.PI * 3 / 2), 0, 0);

var point = gMap.addPoint({lat:0, lng:0});point.fillGradient = pointGradient;

fillAlpha Number An integer from 0 to 100 that specifies the alpha value of the fill. If this value is not provided, 100 (solid) is used. If the value is less than 0, Flash uses 0. If the value is greater than 100, Flash uses 100.

ActionScript Example

var point = gMap.addPoint({lat:0, lng:0});point.fillRGB = 0xFF0000;point.fillAlpha = 30;

filters Array Apply standard Flash 8 filters to the geometry object.

ActionScript Example

- 33 of 104 -

Page 34: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

// Import drop shadow filterimport flash.filters.DropShadowFilter;

// Create a new drop shadow filtervar ds = new DropShadowFilter(5,45,0x000000,.50,5,5,1,1,false,false,false);

var point = gMap.addPoint({lat:0, lng:0});point.filters = [ds]

Optional Stroke Properties.For more information about properties below please see Flash 8 Help for lineStyle method.

strokePixelHinting Boolean Added in Flash Player 8. A Boolean value that specifies whether to hint strokes to full pixels. This value affects both the position of anchors of a curve and the line stroke size itself. If a value is not indicated, Flash Player does not use pixel hinting.

strokeNoScale String Added in Flash Player 8. A string that specifies how to scale a stroke. Valid values are as follows:

1. normal - Always scale the thickness (the default).

2. none - Never scale the thickness.3. vertical - Do not scale thickness if object is

scaled vertically only.4. horizontal - Do not scale thickness if object

is scaled horizontally only. strokeCapsStyle String Added in Flash Player 8. A string that specifies the

type of caps at the end of lines. Valid values are: "round", "square", and "none". If a value is not indicated, Flash uses round caps.

strokeJointStyle String Added in Flash Player 8. A string that specifies the type of joint appearance used at angles. Valid values are: "round", "miter", and "bevel". If a value is not indicated, Flash uses round joints.

strokeMiterLimit Number Added in Flash Player 8. A number that indicates the limit at which a miter is cut off. Valid values range from 1 to 255 (and values outside of that range are rounded to 1 or 255). This value is only used if the jointStyle is set to "miter". If a value is not indicated, Flash uses 3. The miterLimit value represents the length that a miter can extend beyond the point at which the lines meet to form a joint. The value expresses a factor of the line thickness. For example, with a miterLimit factor of 2.5 and a thickness of 10 pixels, the miter is cut off at 25 pixels.

- 34 of 104 -

Page 35: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

Events

Event Return value DescriptionGEOMETRY_ERROR target

typemessage

Triggered whenever error occurs. If there is a problem loading custom point icon this event will be triggered.

ActionScript Example

var geometry = gMap.addPoint({lat:0, lng:0});

function eventResponder(event:Object){trace(event.type);trace(event.target);trace(event.message);

}geometry.addEventListener("GEOMETRY_ERROR", eventResponder);

GEOMETRY_CHANGED targettype

Triggered whenever any of the Geometry Object properties has changed or its position got updated.

ActionScript Example

var geometry = gMap.addPoint({lat:0, lng:0});

function eventResponder(event:Object){trace(event.type);trace(event.target);

}geometry.addEventListener("GEOMETRY_CHANGED", eventResponder);

GEOMETRY_ON_ROLL_OVER targettype

Triggered whenever the mouse enters the area of the Geometry Object.

ActionScript Example

var geometry = gMap.addPoint({lat:0, lng:0});

function eventResponder(event:Object){trace(event.type);trace(event.target);

}

geometry.addEventListener("GEOMETRY_ON_ROLL_OVER", eventResponder);

GEOMETRY_ON_ROLL_OUT targettype

Triggered whenever the mouse leaves the area of the Geometry Object.

ActionScript Example

var geometry = gMap.addPoint({lat:0,

- 35 of 104 -

Page 36: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

lng:0});

function eventResponder(event:Object){trace(event.type);trace(event.target);

}

geometry.addEventListener("GEOMETRY_ON_ROLL_OUT", eventResponder);

GEOMETRY_ON_RELEASE targettype

Triggered whenever Geometry Object is clicked (onRelease).

ActionScript Example

var geometry = gMap.addPoint({lat:0, lng:0});

function eventResponder(event:Object){trace(event.type);trace(event.target);

}

geometry.addEventListener("GEOMETRY_ON_RELEASE", eventResponder);

GEOMETRY_ON_RELEASE_OUTSIDE targettype

Triggered whenever mouse is released outside the area of the Geometry Object (onReleaseOutside).

ActionScript Example

var geometry = gMap.addPoint({lat:0, lng:0});

function eventResponder(event:Object){trace(event.type);trace(event.target);

}geometry.addEventListener("GEOMETRY_ON_RELEASE_OUTSIDE", eventResponder);

GEOMETRY_ON_DRAG_START targettype

Triggered whenever Geometry Object dragging starts.

Example

var geometry = gMap.addPoint({lat:0, lng:0});geometry.drag = true;function eventResponder(event:Object){

trace(event.type);trace(event.target);

}geometry.addEventListener("GEOMETRY_ON_DRAG_START", eventResponder);

GEOMETRY_ON_DRAG_STOP targettype

Triggered whenever Geometry Object dragging stops.

- 36 of 104 -

Page 37: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

ActionScript Example

var geometry = gMap.addPoint({lat:0, lng:0});geometry.drag = true;function eventResponder(event:Object){

trace(event.type);trace(event.target);

}geometry.addEventListener("GEOMETRY_ON_DRAG_STOP", eventResponder);

GEOMETRY_ON_DRAG targettype

Triggered whenever Geometry Object is dragged.

ActionScript Example

var geometry = gMap.addPoint({lat:0, lng:0});geometry.drag = true;function eventResponder(event:Object){

trace(event.type);trace(event.target);

}geometry.addEventListener("GEOMETRY_ON_DRAG", eventResponder);

- 37 of 104 -

Page 38: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

GLine

Methods

Method DescriptionGLine methods. Methods should be applied to the GLine object directly - GLine.methodName(); updatePosition(); Force update position _x and _y position.

ActionScript Example

//Create array of pointsvar linePoints:Array = new Array();

//Add Denver locationlinePoints.push({lat:39.740038,lng:-104.992272});

//Add Miami locationlinePoints.push({lat:25.728989,lng:-80.237446});

//Create line var line = gMap.addLine({points:linePoints});line.updatePosition();

remove(); Deletes geometry object.

ActionScript Example

//Create array of pointsvar linePoints:Array = new Array();

//Add Denver locationlinePoints.push({lat:39.740038,lng:-104.992272});

//Add Miami locationlinePoints.push({lat:25.728989,lng:-80.237446});

//Create line var line = gMap.addLine({points:linePoints});line.remove();

show(); Sets visibility parameter to true.

ActionScript Example

//Create array of pointsvar linePoints:Array = new Array();

//Add Denver locationlinePoints.push({lat:39.740038,lng:-

- 38 of 104 -

Page 39: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

104.992272});

//Add Miami locationlinePoints.push({lat:25.728989,lng:-80.237446});

//Create line var line = gMap.addLine({points:linePoints});line.show();

hide(); Sets visibility parameter to false.

ActionScript Example

//Create array of pointsvar linePoints:Array = new Array();

//Add Denver locationlinePoints.push({lat:39.740038,lng:-104.992272});

//Add Miami locationlinePoints.push({lat:25.728989,lng:-80.237446});

//Create line var line = gMap.addLine({points:linePoints});line.hide();

openInfoWindow(GInfoWindow); Opens information window anchored to this point.

ActionScript Example

//Create array of pointsvar linePoints:Array = new Array();

//Add Denver locationlinePoints.push({lat:39.740038,lng:-104.992272});

//Add Miami locationlinePoints.push({lat:25.728989,lng:-80.237446});

//Create line var line = gMap.addLine({points:linePoints});line.openInfoWindow({title:"Line"})

closeInfoWindow(); Closes information window.

ActionScript Example

//Create array of pointsvar linePoints:Array = new Array();

//Add Denver location

- 39 of 104 -

Page 40: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

linePoints.push({lat:39.740038,lng:-104.992272});

//Add Miami locationlinePoints.push({lat:25.728989,lng:-80.237446});

//Create line var line = gMap.addLine({points:linePoints});line.closeInfoWindow();

getVertexCount(); Returns number of vertices of the GLine.

ActionScript Example

//Create array of pointsvar linePoints:Array = new Array();

//Add Denver locationlinePoints.push({lat:39.740038,lng:-104.992272});

//Add Miami locationlinePoints.push({lat:25.728989,lng:-80.237446});

//Create line var line = gMap.addLine({points:linePoints});var vertex = line.getVertexCount();

getVertices(); Returns an array of GPoint values which represents vertices of the Gline.

ActionScript Example

//Create array of pointsvar linePoints:Array = new Array();

//Add Denver locationlinePoints.push({lat:39.740038,lng:-104.992272});

//Add Miami locationlinePoints.push({lat:25.728989,lng:-80.237446});

//Create line var line = gMap.addLine({points:linePoints});var vertices:Array = line.getVertices();

getVertex(vertexId:Number); Returns the vertex with the given index in the GLine.

ActionScript Example

- 40 of 104 -

Page 41: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

//Create array of pointsvar linePoints:Array = new Array();

//Add Denver locationlinePoints.push({lat:39.740038,lng:-104.992272});

//Add Miami locationlinePoints.push({lat:25.728989,lng:-80.237446});

//Create line var line = gMap.addLine({points:linePoints});var vertex = line.getVertex(1);

Properties

Property Type Descriptionpoints Array Property defines line points.

ActionScript Example

//Create array of pointsvar linePoints:Array = new Array();

//Add Denver locationlinePoints.push({lat:39.740038,lng:-104.992272});

//Add Miami locationlinePoints.push({lat:25.728989,lng:-80.237446});

//Create line var line = gMap.addLine({points:linePoints});

name String Geometry object title. Parameter will be displayed at the top of the information window.

ActionScript Example

//Create array of pointsvar linePoints:Array = new Array();

//Add Denver locationlinePoints.push({lat:39.740038,lng:-104.992272});

//Add Miami locationlinePoints.push({lat:25.728989,lng:-80.237446});

//Create line var line = gMap.addLine({points:linePoints});

- 41 of 104 -

Page 42: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

line.name = "My Line"; description String HTML enabled description.

ActionScript Example

//Create array of pointsvar linePoints:Array = new Array();

//Add Denver locationlinePoints.push({lat:39.740038,lng:-104.992272});

//Add Miami locationlinePoints.push({lat:25.728989,lng:-80.237446});

//Create line var line = gMap.addLine({points:linePoints});line.description = "My Description";

attributes Array Contains additional information.

ActionScript Example

//Create array of pointsvar linePoints:Array = new Array();

//Add Denver locationlinePoints.push({lat:39.740038,lng:-104.992272});

//Add Miami locationlinePoints.push({lat:25.728989,lng:-80.237446});

//Create line var line = gMap.addLine({points:linePoints});line.attributes = ["array value"];

enabled Boolean Defines whether Geometry object is enabled. If set to false, objects button events are going to be disabled.

ActionScript Example

//Create array of pointsvar linePoints:Array = new Array();

//Add Denver locationlinePoints.push({lat:39.740038,lng:-104.992272});

//Add Miami locationlinePoints.push({lat:25.728989,lng:-80.237446});

- 42 of 104 -

Page 43: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

//Create line var line = gMap.addLine({points:linePoints});line.enabled = true;

drag Boolean Defines whether Geometry Object can be dragged.

ActionScript Example

//Create array of pointsvar linePoints:Array = new Array();

//Add Denver locationlinePoints.push({lat:39.740038,lng:-104.992272});

//Add Miami locationlinePoints.push({lat:25.728989,lng:-80.237446});

//Create line var line = gMap.addLine({points:linePoints});line.drag = true;

visible Boolean Defines whether Geometry Object is visible.

ActionScript Example

//Create array of pointsvar linePoints:Array = new Array();

//Add Denver locationlinePoints.push({lat:39.740038,lng:-104.992272});

//Add Miami locationlinePoints.push({lat:25.728989,lng:-80.237446});

//Create line var line = gMap.addLine({points:linePoints});line.visible = false;

zIndex Number Defines depth of the Geometry Object on a particular layer. This value is auto incremented.

ActionScript Example

//Create array of pointsvar linePoints:Array = new Array();

//Add Denver locationlinePoints.push({lat:39.740038,lng:-104.992272});

- 43 of 104 -

Page 44: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

//Add Miami locationlinePoints.push({lat:25.728989,lng:-80.237446});

//Create line var line = gMap.addLine({points:linePoints});line.zIndex = 1;

zIndexAuto Boolean Indicates whether Geometry Object is brought to the top of the stack on mouse event. Geometry Object must be enabled for this property to kick in.

ActionScript Example

//Create array of pointsvar linePoints:Array = new Array();

//Add Denver locationlinePoints.push({lat:39.740038,lng:-104.992272});

//Add Miami locationlinePoints.push({lat:25.728989,lng:-80.237446});

//Create line var line = gMap.addLine({points:linePoints});line.zIndexAuto = true;

Geometry object appearance propertiesstroke Boolean Property indicates whether stroke is displayed.

Default value is set to true.

ActionScript Example

//Create array of pointsvar linePoints:Array = new Array();

//Add Denver locationlinePoints.push({lat:39.740038,lng:-104.992272});

//Add Miami locationlinePoints.push({lat:25.728989,lng:-80.237446});

//Create line var line = gMap.addLine({points:linePoints});line.stroke = true;

strokeThickness Number An integer that indicates the thickness of the line in points; valid values are 0 to 255. If a number is not specified, or if the parameter is undefined, a line is not drawn. If a value of less than 0 is passed, Flash Player uses 0. The value 0 indicates hairline

- 44 of 104 -

Page 45: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

thickness; the maximum thickness is 255. If a value greater than 255 is passed, the Flash interpreter uses 255.

ActionScript Example

//Create array of pointsvar linePoints:Array = new Array();

//Add Denver locationlinePoints.push({lat:39.740038,lng:-104.992272});

//Add Miami locationlinePoints.push({lat:25.728989,lng:-80.237446});

//Create line var line = gMap.addLine({points:linePoints});line.strokeThickness = 5;

strokeRGB Number A hexadecimal color value of the line; for example, red is 0xFF0000, blue is 0x0000FF, and so on. If a value isn't indicated, Flash uses 0x000000 (black).

ActionScript Example

//Create array of pointsvar linePoints:Array = new Array();

//Add Denver locationlinePoints.push({lat:39.740038,lng:-104.992272});

//Add Miami locationlinePoints.push({lat:25.728989,lng:-80.237446});

//Create line var line = gMap.addLine({points:linePoints});line.strokeRGB = 0xFF0000;

strokeAlpha Number An integer that indicates the alpha value of the line's color; valid values are 0 to 100. If a value isn't indicated, Flash uses 100 (solid). If the value is less than 0, Flash uses 0; if the value is greater than 100, Flash uses 100.

ActionScript Example

//Create array of pointsvar linePoints:Array = new Array();

//Add Denver locationlinePoints.push({lat:39.740038,lng:-104.992272});

- 45 of 104 -

Page 46: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

//Add Miami locationlinePoints.push({lat:25.728989,lng:-80.237446});

//Create line var line = gMap.addLine({points:linePoints});line.strokeAlpha = 30;

filters Array Apply standard Flash 8 filters to the geometry object.

ActionScript Example

// Import drop shadow filterimport flash.filters.DropShadowFilter;

// Create a new drop shadow filtervar ds = new DropShadowFilter(5,45,0x000000,.50,5,5,1,1,false,false,false);

//Create array of pointsvar linePoints:Array = new Array();

//Add Denver locationlinePoints.push({lat:39.740038,lng:-104.992272});

//Add Miami locationlinePoints.push({lat:25.728989,lng:-80.237446});

//Create line var line = gMap.addLine({points:linePoints});line.filters = [ds];

Optional Stroke Properties.For more information about properties below please see Flash 8 Help for lineStyle method.

strokePixelHinting Boolean Added in Flash Player 8. A Boolean value that specifies whether to hint strokes to full pixels. This value affects both the position of anchors of a curve and the line stroke size itself. If a value is not indicated, Flash Player does not use pixel hinting.

strokeNoScale String Added in Flash Player 8. A string that specifies how to scale a stroke. Valid values are as follows:

1. normal - Always scale the thickness (the default).

2. none - Never scale the thickness.3. vertical - Do not scale thickness if object is

scaled vertically only.4. horizontal - Do not scale thickness if object

is scaled horizontally only. strokeCapsStyle String Added in Flash Player 8. A string that specifies the

type of caps at the end of lines. Valid values are:

- 46 of 104 -

Page 47: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

"round", "square", and "none". If a value is not indicated, Flash uses round caps.

strokeJointStyle String Added in Flash Player 8. A string that specifies the type of joint appearance used at angles. Valid values are: "round", "miter", and "bevel". If a value is not indicated, Flash uses round joints.

strokeMiterLimit Number Added in Flash Player 8. A number that indicates the limit at which a miter is cut off. Valid values range from 1 to 255 (and values outside of that range are rounded to 1 or 255). This value is only used if the jointStyle is set to "miter". If a value is not indicated, Flash uses 3. The miterLimit value represents the length that a miter can extend beyond the point at which the lines meet to form a joint. The value expresses a factor of the line thickness. For example, with a miterLimit factor of 2.5 and a thickness of 10 pixels, the miter is cut off at 25 pixels.

Events

Event Return value DescriptionGEOMETRY_ERROR target

typemessage

Triggered whenever error occurs. If there is a problem loading custom point icon this event will be triggered.

ActionScript Example

var linePoints:Array = new Array();

linePoints.push({lat:39.740038,lng:-104.992272}); linePoints.push({lat:25.728989,lng:-80.237446});

var geometry = gMap.addLine({points:linePoints});

function eventResponder(event:Object){trace(event.type);trace(event.target);trace(event.message);

}geometry.addEventListener("GEOMETRY_ERROR", eventResponder);

GEOMETRY_CHANGED targettype

Triggered whenever any of the Geometry Object properties has changed or its position got updated.

ActionScript Example

- 47 of 104 -

Page 48: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

var linePoints:Array = new Array();

linePoints.push({lat:39.740038,lng:-104.992272}); linePoints.push({lat:25.728989,lng:-80.237446});

var geometry = gMap.addLine({points:linePoints});

function eventResponder(event:Object){trace(event.type);trace(event.target);

}geometry.addEventListener("GEOMETRY_CHANGED", eventResponder);

GEOMETRY_ON_ROLL_OVER targettype

Triggered whenever the mouse enters the area of the Geometry Object.

ActionScript Example

var linePoints:Array = new Array();

linePoints.push({lat:39.740038,lng:-104.992272}); linePoints.push({lat:25.728989,lng:-80.237446});

var geometry = gMap.addLine({points:linePoints});

function eventResponder(event:Object){trace(event.type);trace(event.target);

}geometry.addEventListener("GEOMETRY_ON_ROLL_OVER", eventResponder);

GEOMETRY_ON_ROLL_OUT targettype

Triggered whenever the mouse leaves the area of the Geometry Object.

ActionScript Example

var linePoints:Array = new Array();

linePoints.push({lat:39.740038,lng:-104.992272}); linePoints.push({lat:25.728989,lng:-80.237446});

var geometry = gMap.addLine({points:linePoints});

function eventResponder(event:Object){trace(event.type);trace(event.target);

}

- 48 of 104 -

Page 49: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

geometry.addEventListener("GEOMETRY_ON_ROLL_OUT", eventResponder);

GEOMETRY_ON_RELEASE targettype

Triggered whenever Geometry Object is clicked (onRelease).

ActionScript Example

var linePoints:Array = new Array();

linePoints.push({lat:39.740038,lng:-104.992272}); linePoints.push({lat:25.728989,lng:-80.237446});

var geometry = gMap.addLine({points:linePoints});

function eventResponder(event:Object){trace(event.type);trace(event.target);

}geometry.addEventListener("GEOMETRY_ON_RELEASE", eventResponder);

GEOMETRY_ON_RELEASE_OUTSIDE targettype

Triggered whenever mouse is released outside the area of the Geometry Object (onReleaseOutside).

ActionScript Example

var linePoints:Array = new Array();

linePoints.push({lat:39.740038,lng:-104.992272}); linePoints.push({lat:25.728989,lng:-80.237446});

var geometry = gMap.addLine({points:linePoints});

function eventResponder(event:Object){trace(event.type);trace(event.target);

}geometry.addEventListener("GEOMETRY_ON_RELEASE_OUTSIDE", eventResponder);

GEOMETRY_ON_DRAG_START targettype

Triggered whenever Geometry Object dragging starts.

Example

var linePoints:Array = new Array();

linePoints.push({lat:39.740038,lng:-104.992272}); linePoints.push({lat:25.728989,lng:-80.237446});

- 49 of 104 -

Page 50: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

var geometry = gMap.addLine({points:linePoints});geometry.drag = true;function eventResponder(event:Object){

trace(event.type);trace(event.target);

}geometry.addEventListener("GEOMETRY_ON_DRAG_START", eventResponder);

GEOMETRY_ON_DRAG_STOP targettype

Triggered whenever Geometry Object dragging stops.

ActionScript Example

var linePoints:Array = new Array();

linePoints.push({lat:39.740038,lng:-104.992272}); linePoints.push({lat:25.728989,lng:-80.237446});

var geometry = gMap.addLine({points:linePoints});geometry.drag = true;function eventResponder(event:Object){

trace(event.type);trace(event.target);

}geometry.addEventListener("GEOMETRY_ON_DRAG_STOP", eventResponder);

GEOMETRY_ON_DRAG targettype

Triggered whenever Geometry Object is dragged.

ActionScript Example

var linePoints:Array = new Array();

linePoints.push({lat:39.740038,lng:-104.992272}); linePoints.push({lat:25.728989,lng:-80.237446});

var geometry = gMap.addLine({points:linePoints});geometry.drag = true;function eventResponder(event:Object){

trace(event.type);trace(event.target);

}geometry.addEventListener("GEOMETRY_ON_DRAG", eventResponder);

- 50 of 104 -

Page 51: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

Gpolygon

Methods

Method DescriptionGPolygon methods. Methods should be applied to the GPolygon object directly - GPolygon.methodName(); updatePosition(); Force update position _x and _y position.

ActionScript Example

//Create array of pointsvar shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

//Add polygonvar polygon = gMap.addPolygon({points:shape});polygon.updatePosition();

remove(); Deletes geometry object.

ActionScript Example

//Create array of pointsvar shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

//Add polygonvar polygon = gMap.addPolygon({points:shape});polygon.remove();

show(); Sets visibility parameter to true.

ActionScript Example

//Create array of pointsvar shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

//Add polygonvar polygon = gMap.addPolygon({points:shape});

- 51 of 104 -

Page 52: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

polygon.show();hide(); Sets visibility parameter to false.

ActionScript Example

//Create array of pointsvar shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

//Add polygonvar polygon = gMap.addPolygon({points:shape});polygon.hide();

openInfoWindow(GInfoWindow); Opens information window anchored to this point.

ActionScript Example

//Create array of pointsvar shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

//Add polygonvar polygon = gMap.addPolygon({points:shape});polygon.openInfoWindow();

closeInfoWindow(); Closes information window.

ActionScript Example

//Create array of pointsvar shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

//Add polygonvar polygon = gMap.addPolygon({points:shape});polygon.closeInfoWindow();

getVertexCount(); Returns the number of vertices in inner and outer boundaries of the GPolygon.

ActionScript Example

//Create array of points

- 52 of 104 -

Page 53: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

//Outer shapevar shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

//Inner shapevar innerShape = new Array();innerShape.push({lat:30,lng:-70});innerShape.push({lat:-30,lng:-70});innerShape.push({lat:-30,lng:70});innerShape.push({lat:30,lng:70});

//Add polygonvar polygon = gMap.addPolygon({outer:shape, inner:[innerShape]});trace(polygon.getVertexCount());

getVertices(); Returns and array of GPoint values which represents inner and outer boundaries of the Gpolygon.

ActionScript Example

//Create array of points//Outer shapevar shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

//Inner shapevar innerShape = new Array();innerShape.push({lat:30,lng:-70});innerShape.push({lat:-30,lng:-70});innerShape.push({lat:-30,lng:70});innerShape.push({lat:30,lng:70});

//Add polygonvar polygon = gMap.addPolygon({outer:shape, inner:[innerShape]});trace(polygon.getVertices());

getVertex(vertexId:Number); Returns a GPoint object which represents a specific vertex in inner or outer boundaries of the Gpolygon.

ActionScript Example

//Create array of points

- 53 of 104 -

Page 54: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

//Outer shapevar shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

//Inner shapevar innerShape = new Array();innerShape.push({lat:30,lng:-70});innerShape.push({lat:-30,lng:-70});innerShape.push({lat:-30,lng:70});innerShape.push({lat:30,lng:70});

//Add polygonvar polygon = gMap.addPolygon({outer:shape, inner:[innerShape]});trace(polygon.getVertex(1));

getOuterVertexCount(); Returns the number of vertices in outer boundaries of the GPolygon.

ActionScript Example

//Create array of points//Outer shapevar shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

//Inner shapevar innerShape = new Array();innerShape.push({lat:30,lng:-70});innerShape.push({lat:-30,lng:-70});innerShape.push({lat:-30,lng:70});innerShape.push({lat:30,lng:70});

//Add polygonvar polygon = gMap.addPolygon({outer:shape, inner:[innerShape]});trace(polygon.getOuterVertexCount());

getOuterVertices(); Returns and array of GPoint values which represents outer boundaries of the Gpolygon.

ActionScript Example

//Create array of points

- 54 of 104 -

Page 55: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

//Outer shapevar shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

//Inner shapevar innerShape = new Array();innerShape.push({lat:30,lng:-70});innerShape.push({lat:-30,lng:-70});innerShape.push({lat:-30,lng:70});innerShape.push({lat:30,lng:70});

//Add polygonvar polygon = gMap.addPolygon({outer:shape, inner:[innerShape]});trace(polygon.getOuterVertices());

getOuterVertex(vertexId:Number); Returns a GPoint object which represents a specific vertex in outer boundaries of the Gpolygon.

ActionScript Example

//Create array of points//Outer shapevar shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

//Inner shapevar innerShape = new Array();innerShape.push({lat:30,lng:-70});innerShape.push({lat:-30,lng:-70});innerShape.push({lat:-30,lng:70});innerShape.push({lat:30,lng:70});

//Add polygonvar polygon = gMap.addPolygon({outer:shape, inner:[innerShape]});trace(polygon.getOuterVertex(1));

getInnerVertexCount(); Returns the number of vertices in outer boundaries of the GPolygon.

ActionScript Example

//Create array of points

- 55 of 104 -

Page 56: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

//Outer shapevar shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

//Inner shapevar innerShape = new Array();innerShape.push({lat:30,lng:-70});innerShape.push({lat:-30,lng:-70});innerShape.push({lat:-30,lng:70});innerShape.push({lat:30,lng:70});

//Add polygonvar polygon = gMap.addPolygon({outer:shape, inner:[innerShape]});trace(polygon.getInnerVertexCount());

getInnerVertices(); Returns and array of GPoint values which represents outer boundaries of the Gpolygon.

ActionScript Example

//Create array of points//Outer shapevar shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

//Inner shapevar innerShape = new Array();innerShape.push({lat:30,lng:-70});innerShape.push({lat:-30,lng:-70});innerShape.push({lat:-30,lng:70});innerShape.push({lat:30,lng:70});

//Add polygonvar polygon = gMap.addPolygon({outer:shape, inner:[innerShape]});trace(polygon.getInnerVertices());

getInnerVertex(vertexId:Number); Returns a GPoint object which represents a specific vertex in outer boundaries of the Gpolygon.

ActionScript Example

//Create array of points

- 56 of 104 -

Page 57: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

//Outer shapevar shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

//Inner shapevar innerShape = new Array();innerShape.push({lat:30,lng:-70});innerShape.push({lat:-30,lng:-70});innerShape.push({lat:-30,lng:70});innerShape.push({lat:30,lng:70});

//Add polygonvar polygon = gMap.addPolygon({outer:shape, inner:[innerShape]});trace(polygon.getInnerVertex(1));

Properties

Property Type Descriptionpoints Array Property defines polygon points.

ActionScript Example

//Create array of pointsvar shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

//Add polygonvar polygon = gMap.addPolygon({points:shape});

outer Array Property defines polygon outer shape.

ActionScript Example

//Create array of pointsvar shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

//Add polygonvar polygon =

- 57 of 104 -

Page 58: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

gMap.addPolygon({outer:shape});inner Collection Defines polygon inner shape. Use inner shape to

create polygons with cut-outs.

ActionScript Example

//Create array of points//Outer shapevar shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

//Inner shapevar innerShape = new Array();innerShape.push({lat:30,lng:-70});innerShape.push({lat:-30,lng:-70});innerShape.push({lat:-30,lng:70});innerShape.push({lat:30,lng:70});

//Add polygonvar polygon = gMap.addPolygon({outer:shape, inner:[innerShape]});

name String Geometry object title. Parameter will be displayed at the top of the information window.

ActionScript Example

//Create array of pointsvar shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

//Add polygonvar polygon = gMap.addPolygon({outer:shape});polygon.name = "My Polygon";

description String HTML enabled description.

ActionScript Example

//Create array of pointsvar shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

//Add polygon

- 58 of 104 -

Page 59: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

var polygon = gMap.addPolygon({outer:shape});polygon.description = "Description";

attributes Array Contains additional information.

ActionScript Example

//Create array of pointsvar shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

//Add polygonvar polygon = gMap.addPolygon({outer:shape});polygon.attributes = ["array value"];

enabled Boolean Defines whether Geometry object is enabled. If set to false, objects button events are going to be disabled.

ActionScript Example

//Create array of pointsvar shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

//Add polygonvar polygon = gMap.addPolygon({outer:shape});polygon.enabled = true;

drag Boolean Defines whether Geometry Object can be dragged.

ActionScript Example

//Create array of pointsvar shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

//Add polygonvar polygon = gMap.addPolygon({outer:shape});polygon.drag = true;

visible Boolean Defines whether Geometry Object is visible.

ActionScript Example

- 59 of 104 -

Page 60: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

//Create array of pointsvar shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

//Add polygonvar polygon = gMap.addPolygon({outer:shape});polygon.visible = true;

zIndex Number Defines depth of the Geometry Object on a particular layer. This value is auto incremented.

ActionScript Example

//Create array of pointsvar shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

//Add polygonvar polygon = gMap.addPolygon({outer:shape});polygon.zIndex = 1;

zIndexAuto Boolean Indicates whether Geometry Object is brought to the top of the stack on mouse event. Geometry Object must be enabled for this property to kick in.

ActionScript Example

//Create array of pointsvar shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

//Add polygonvar polygon = gMap.addPolygon({outer:shape});polygon.zIndexAuto = true;

Geometry object appearance propertiesfill Boolean Property defines whether polygon outline is filled.

Default value is set to true.

ActionScript Example

//Create array of points

- 60 of 104 -

Page 61: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

var shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

//Add polygonvar polygon = gMap.addPolygon({outer:shape});polygon.fill = false;

fillRGB Number A hexadecimal color value; for example, red is 0xFF0000, blue is 0x0000FF. If this value is not provided or is undefined, a fill is not created.

ActionScript Example

//Create array of pointsvar shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

//Add polygonvar polygon = gMap.addPolygon({outer:shape});polygon.fillRGB = 0xFF0000;

fillGradient Object References object that defines gradient fill. Please see Flash 8 beginGradientFill();

ActionScript Example

// Create gradient objectvar polygonGradient:Object = new Object;

polygonGradient.fillType = "linear";polygonGradient.colors = [0xFF33CC, 0xFFFFFF];polygonGradient.alphas = [30, 100];polygonGradient.ratios = [0, 255];polygonGradient.matrix = new flash.geom.Matrix();polygonGradient.matrix.createGradientBox(100, 50, (Math.PI * 3 / 2), 0, 0);

//Create array of pointsvar shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

//Add polygonvar polygon =

- 61 of 104 -

Page 62: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

gMap.addPolygon({outer:shape});polygon.fillGradient = polygonGradient;

fillAlpha Number An integer from 0 to 100 that specifies the alpha value of the fill. If this value is not provided, 100 (solid) is used. If the value is less than 0, Flash uses 0. If the value is greater than 100, Flash uses 100.

ActionScript Example

//Create array of pointsvar shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

//Add polygonvar polygon = gMap.addPolygon({outer:shape});polygon.fillRGB = 0xFF0000;polygon.fillAlpha = 80;

stroke Boolean Property indicates whether stroke is displayed. Default value is set to true.

ActionScript Example

//Create array of pointsvar shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

//Add polygonvar polygon = gMap.addPolygon({outer:shape});polygon.stroke = false;

strokeThickness Number An integer that indicates the thickness of the line in points; valid values are 0 to 255. If a number is not specified, or if the parameter is undefined, a line is not drawn. If a value of less than 0 is passed, Flash Player uses 0. The value 0 indicates hairline thickness; the maximum thickness is 255. If a value greater than 255 is passed, the Flash interpreter uses 255.

ActionScript Example

//Create array of pointsvar shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});

- 62 of 104 -

Page 63: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

//Add polygonvar polygon = gMap.addPolygon({outer:shape});polygon.strokeThickness = 5;

strokeRGB Number A hexadecimal color value of the line; for example, red is 0xFF0000, blue is 0x0000FF, and so on. If a value isn't indicated, Flash uses 0x000000 (black).

ActionScript Example

//Create array of pointsvar shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

//Add polygonvar polygon = gMap.addPolygon({outer:shape});polygon.strokeRGB = 0xFF0000;

strokeAlpha Number An integer that indicates the alpha value of the line's color; valid values are 0 to 100. If a value isn't indicated, Flash uses 100 (solid). If the value is less than 0, Flash uses 0; if the value is greater than 100, Flash uses 100.

ActionScript Example

//Create array of pointsvar shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

//Add polygonvar polygon = gMap.addPolygon({outer:shape});polygon.strokeAlpha = 30;

filters Array Apply standard Flash 8 filters to the geometry object.

ActionScript Example

// Import drop shadow filterimport flash.filters.DropShadowFilter;

// Create a new drop shadow filtervar ds = new DropShadowFilter(5,45,0x000000,.50,5,5,1,1,f

- 63 of 104 -

Page 64: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

alse,false,false);

//Create array of pointsvar shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

//Add polygonvar polygon = gMap.addPolygon({outer:shape});polygon.filters = [ds];

Optional Stroke Properties.For more information about properties below please see Flash 8 Help for lineStyle method.

strokePixelHinting Boolean Added in Flash Player 8. A Boolean value that specifies whether to hint strokes to full pixels. This value affects both the position of anchors of a curve and the line stroke size itself. If a value is not indicated, Flash Player does not use pixel hinting.

strokeNoScale String Added in Flash Player 8. A string that specifies how to scale a stroke. Valid values are as follows:

5. normal - Always scale the thickness (the default).

6. none - Never scale the thickness.7. vertical - Do not scale thickness if object is

scaled vertically only.8. horizontal - Do not scale thickness if object

is scaled horizontally only. strokeCapsStyle String Added in Flash Player 8. A string that specifies the

type of caps at the end of lines. Valid values are: "round", "square", and "none". If a value is not indicated, Flash uses round caps.

strokeJointStyle String Added in Flash Player 8. A string that specifies the type of joint appearance used at angles. Valid values are: "round", "miter", and "bevel". If a value is not indicated, Flash uses round joints.

strokeMiterLimit Number Added in Flash Player 8. A number that indicates the limit at which a miter is cut off. Valid values range from 1 to 255 (and values outside of that range are rounded to 1 or 255). This value is only used if the jointStyle is set to "miter". If a value is not indicated, Flash uses 3. The miterLimit value represents the length that a miter can extend beyond the point at which the lines meet to form a joint. The value expresses a factor of the line thickness. For example, with a miterLimit factor of 2.5 and a thickness of 10 pixels, the miter is cut off at 25 pixels.

Events

- 64 of 104 -

Page 65: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

Event Return value DescriptionGEOMETRY_ERROR target

typemessage

Triggered whenever error occurs. If there is a problem loading custom point icon this event will be triggered.

ActionScript Example

var shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

var geometry = gMap.addPolygon({outer:shape});

function eventResponder(event:Object){trace(event.type);trace(event.target);trace(event.message);

}geometry.addEventListener("GEOMETRY_ERROR", eventResponder);

GEOMETRY_CHANGED targettype

Triggered whenever any of the Geometry Object properties has changed or its position got updated.

ActionScript Example

var shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

var geometry = gMap.addPolygon({outer:shape});

function eventResponder(event:Object){trace(event.type);trace(event.target);

}geometry.addEventListener("GEOMETRY_CHANGED", eventResponder);

GEOMETRY_ON_ROLL_OVER targettype

Triggered whenever the mouse enters the area of the Geometry Object.

ActionScript Example

var shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

- 65 of 104 -

Page 66: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

var geometry = gMap.addPolygon({outer:shape});

function eventResponder(event:Object){trace(event.type);trace(event.target);

}geometry.addEventListener("GEOMETRY_ON_ROLL_OVER", eventResponder);

GEOMETRY_ON_ROLL_OUT targettype

Triggered whenever the mouse leaves the area of the Geometry Object.

ActionScript Example

var shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

var geometry = gMap.addPolygon({outer:shape});

function eventResponder(event:Object){trace(event.type);trace(event.target);

}geometry.addEventListener("GEOMETRY_ON_ROLL_OUT", eventResponder);

GEOMETRY_ON_RELEASE targettype

Triggered whenever Geometry Object is clicked (onRelease).

ActionScript Example

var shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

var geometry = gMap.addPolygon({outer:shape});

function eventResponder(event:Object){trace(event.type);trace(event.target);

}geometry.addEventListener("GEOMETRY_ON_RELEASE", eventResponder);

GEOMETRY_ON_RELEASE_OUTSIDE targettype

Triggered whenever mouse is released outside the area of the Geometry Object (onReleaseOutside).

ActionScript Example

- 66 of 104 -

Page 67: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

var shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

var geometry = gMap.addPolygon({outer:shape});

function eventResponder(event:Object){trace(event.type);trace(event.target);

}geometry.addEventListener("GEOMETRY_ON_RELEASE_OUTSIDE", eventResponder);

GEOMETRY_ON_DRAG_START targettype

Triggered whenever Geometry Object dragging starts.

Example

var shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

var geometry = gMap.addPolygon({outer:shape});geometry.drag = true;function eventResponder(event:Object){

trace(event.type);trace(event.target);

}geometry.addEventListener("GEOMETRY_ON_DRAG_START", eventResponder);

GEOMETRY_ON_DRAG_STOP targettype

Triggered whenever Geometry Object dragging stops.

ActionScript Example

var shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

var geometry = gMap.addPolygon({outer:shape});geometry.drag = true;function eventResponder(event:Object){

trace(event.type);

- 67 of 104 -

Page 68: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

trace(event.target);}geometry.addEventListener("GEOMETRY_ON_DRAG_STOP", eventResponder);

GEOMETRY_ON_DRAG targettype

Triggered whenever Geometry Object is dragged.

ActionScript Example

var shape:Array = new Array();

shape.push({lat:50,lng:-100});shape.push({lat:-50,lng:-100});shape.push({lat:-50,lng:100});shape.push({lat:50,lng:100});

var geometry = gMap.addPolygon({outer:shape});geometry.drag = true;function eventResponder(event:Object){

trace(event.type);trace(event.target);

}geometry.addEventListener("GEOMETRY_ON_DRAG", eventResponder);

- 68 of 104 -

Page 69: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

GOverlay

Methods

Method DescriptionGOverlay methods. Methods should be applied to the GOverlay object directly - GOverlay.methodName(); updatePosition(); Force update position _x and _y position.

ActionScript Example

var overlay = gMap.addOverlay({path:"image.jpg", north:50, west:-100, south:-50, east:100,});overlay.updatePosition();

remove(); Deletes geometry object.

ActionScript Example

var overlay = gMap.addOverlay({path:"image.jpg", north:50, west:-100, south:-50, east:100,});overlay.remove();

show(); Sets visibility parameter to true.

ActionScript Example

var overlay = gMap.addOverlay({path:"image.jpg", north:50, west:-100, south:-50, east:100,});overlay.show();

hide(); Sets visibility parameter to false.

ActionScript Example

var overlay = gMap.addOverlay({path:"image.jpg", north:50, west:-100, south:-50, east:100,});overlay.hide();

openInfoWindow(GInfoWindow); Opens information window anchored to this point.

ActionScript Example

var overlay = gMap.addOverlay({path:"image.jpg", north:50, west:-100, south:-50, east:100});overlay.openInfoWindow();

closeInfoWindow(); Closes information window.

ActionScript Example

- 69 of 104 -

Page 70: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

var overlay = gMap.addOverlay({path:"image.jpg", north:50, west:-100, south:-50, east:100});overlay.closeInfoWindow();

Properties

Property Type Descriptionnorth Number Defines north border of the image overlay.

ActionScript Example

gMap.addOverlay({path:"image.jpg", north:50, west:-100, south:-50, east:100});

west Number Defines west border of the image overlay.

ActionScript Example

gMap.addOverlay({path:"image.jpg", north:50, west:-100, south:-50, east:100});

south Number Defines south border of the image overlay.

ActionScript Example

gMap.addOverlay({path:"image.jpg", north:50, west:-100, south:-50, east:100});

east Number Defines east border of the image overlay.

ActionScript Example

gMap.addOverlay({path:"image.jpg", north:50, west:-100, south:-50, east:100});

rotation Number Defines the rotation of the image overlay.

ActionScript Example

Defines north border of the image overlay.

ActionScript Example

gMap.addOverlay({path:"image.jpg", north:50, west:-100, south:-50, east:100, rotation:45});

path String Defines a path to the overlay image.

ActionScript Example

gMap.addOverlay({path:"image.jpg", north:50, west:-100, south:-50, east:100});

name String Geometry object title. Parameter will be displayed at

- 70 of 104 -

Page 71: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

the top of the information window.

ActionScript Example

var overlay = gMap.addOverlay({path:"image.jpg", north:50, west:-100, south:-50, east:100});overlay.name = "My Overlay";

description String HTML enabled description.

ActionScript Example

var overlay = gMap.addOverlay({path:"image.jpg", north:50, west:-100, south:-50, east:100});overlay.description = "Description";

attributes Array Contains additional information.

ActionScript Example

var overlay = gMap.addOverlay({path:"image.jpg", north:50, west:-100, south:-50, east:100});overlay.attributes = ["array values"];

enabled Boolean Defines whether Geometry object is enabled. If set to false, objects button events are going to be disabled.

ActionScript Example

var overlay = gMap.addOverlay({path:"image.jpg", north:50, west:-100, south:-50, east:100});overlay.enabled = true;

drag Boolean Defines whether Geometry Object can be dragged.

ActionScript Example

var overlay = gMap.addOverlay({path:"image.jpg", north:50, west:-100, south:-50, east:100});overlay.drag = true;

visible Boolean Defines whether Geometry Object is visible.

ActionScript Example

var overlay = gMap.addOverlay({path:"image.jpg", north:50, west:-100, south:-50, east:100});overlay.visible = false;

zIndex Number Defines depth of the Geometry Object on a particular layer. This value is auto incremented.

- 71 of 104 -

Page 72: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

ActionScript Example

var overlay = gMap.addOverlay({path:"image.jpg", north:50, west:-100, south:-50, east:100});overlay.zIndex = 1;

zIndexAuto Boolean Indicates whether Geometry Object is brought to the top of the stack on mouse event. Geometry Object must be enabled for this property to kick in.

ActionScript Example

var overlay = gMap.addOverlay({path:"image.jpg", north:50, west:-100, south:-50, east:100});overlay.zIndexAuto = true;

Events

Event Return value DescriptionGEOMETRY_ERROR target

typemessage

Triggered whenever error occurs. If there is a problem loading custom point icon this event will be triggered.

ActionScript Examplevar geometry = gMap.addOverlay({path:"image.jpg", north:50, west:-100, south:-50, east:100});

function eventResponder(event:Object){trace(event.type);trace(event.target);trace(event.message);

}geometry.addEventListener("GEOMETRY_ERROR", eventResponder);

GEOMETRY_CHANGED targettype

Triggered whenever any of the Geometry Object properties has changed or its position got updated.

ActionScript Example

var geometry = gMap.addOverlay({path:"image.jpg", north:50, west:-100, south:-50, east:100});

function eventResponder(event:Object){trace(event.type);trace(event.target);

}geometry.addEventListener("GEOMETRY_CHANGED", eventResponder);

GEOMETRY_ON_ROLL_OVER targettype

Triggered whenever the mouse enters the area of the Geometry Object.

- 72 of 104 -

Page 73: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

ActionScript Example

var geometry = gMap.addOverlay({path:"image.jpg", north:50, west:-100, south:-50, east:100});

function eventResponder(event:Object){trace(event.type);trace(event.target);

}geometry.addEventListener("GEOMETRY_ON_ROLL_OVER", eventResponder);

GEOMETRY_ON_ROLL_OUT targettype

Triggered whenever the mouse leaves the area of the Geometry Object.

ActionScript Example

var geometry = gMap.addOverlay({path:"image.jpg", north:50, west:-100, south:-50, east:100});

function eventResponder(event:Object){trace(event.type);trace(event.target);

}geometry.addEventListener("GEOMETRY_ON_ROLL_OUT", eventResponder);

GEOMETRY_ON_RELEASE targettype

Triggered whenever Geometry Object is clicked (onRelease).

ActionScript Example

var geometry = gMap.addOverlay({path:"image.jpg", north:50, west:-100, south:-50, east:100});

function eventResponder(event:Object){trace(event.type);trace(event.target);

}geometry.addEventListener("GEOMETRY_ON_RELEASE", eventResponder);

GEOMETRY_ON_RELEASE_OUTSIDE targettype

Triggered whenever mouse is released outside the area of the Geometry Object (onReleaseOutside).

ActionScript Example

var geometry = gMap.addOverlay({path:"image.jpg", north:50, west:-100, south:-50, east:100});

function eventResponder(event:Object){trace(event.type);trace(event.target);

- 73 of 104 -

Page 74: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

}geometry.addEventListener("GEOMETRY_ON_RELEASE_OUTSIDE", eventResponder);

GEOMETRY_ON_DRAG_START targettype

Triggered whenever Geometry Object dragging starts.

Example

var geometry = gMap.addOverlay({path:"image.jpg", north:50, west:-100, south:-50, east:100});geometry.drag = true;function eventResponder(event:Object){

trace(event.type);trace(event.target);

}geometry.addEventListener("GEOMETRY_ON_DRAG_START", eventResponder);

GEOMETRY_ON_DRAG_STOP targettype

Triggered whenever Geometry Object dragging stops.

ActionScript Example

var geometry = gMap.addOverlay({path:"image.jpg", north:50, west:-100, south:-50, east:100});geometry.drag = true;function eventResponder(event:Object){

trace(event.type);trace(event.target);

}geometry.addEventListener("GEOMETRY_ON_DRAG_STOP", eventResponder);

GEOMETRY_ON_DRAG targettype

Triggered whenever Geometry Object is dragged.

ActionScript Example

var geometry = gMap.addOverlay({path:"image.jpg", north:50, west:-100, south:-50, east:100});geometry.drag = true;function eventResponder(event:Object){

trace(event.type);trace(event.target);

}geometry.addEventListener("GEOMETRY_ON_DRAG", eventResponder);

- 74 of 104 -

Page 75: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

GInfoWindow

Methods

Method DescriptionGInfoWindow methods. Methods should be applied to the GInfoWindow object directly - GInfoWindow.methodName(); updatePosition(); Force update position _x and _y position.

ActionScript Example

// Add info windowvar window = gMap.openInfoWindow({lat:0, lng:0, title:"My Window"});

window.updatePosition();remove(); Deletes info window object.

ActionScript Example

// Add info windowvar window = gMap.openInfoWindow({lat:0, lng:0, title:"My Window"});

window.remove();show(); Sets visibility parameter to true.

ActionScript Example

// Add info windowvar window = gMap.openInfoWindow({lat:0, lng:0, title:"My Window"});

window.show();hide(); Sets visibility parameter to false.

ActionScript Example

// Add info windowvar window = gMap.openInfoWindow({lat:0, lng:0, title:"My Window"});

window.hide();

Properties

Property Type Descriptionname String Property defines the Info Window name. This

property is not displayed in the window, reference

- 75 of 104 -

Page 76: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

only.

ActionScript Example

var window = gMap.openInfoWindow();window.name = "myWindow"

lng Number Info Window longitude. Please note that this value is set automatically if openInfoWindow method is called from a geometry object (GPoint, GLine, GPolygon, GOverlay)

ActionScript Example

gMap.openInfoWindow({lat:0, lng:0});lat Nubmer Point latitude. Please note that this value is set

automatically if openInfoWindow method is called from a geometry object (GPoint, GLine, GPolygon, GOverlay)

ActionScript Example

gMap.openInfoWindow({lat:0, lng:0});description String Property defines the Info Window description. This

property is not displayed in the window, reference only.

ActionScript Example

var window = gMap.openInfoWindow();window.description = "Description";

attributes Array Contains additional information.

ActionScript Example

var window = gMap.openInfoWindow();window.attributes = ["array value"];

visible Boolean Defines whether the Info Window is visible.

ActionScript Example

var window = gMap.openInfoWindow();window.visible = true;

zIndex Number Defines depth of the Info Window on a particular layer. This value is auto incremented.

ActionScript Example

var window = gMap.openInfoWindow();trace(window.zIndex);

zIndexAuto Boolean Indicates whether Geometry Object is brought to the

- 76 of 104 -

Page 77: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

top of the stack on mouse event. Geometry Object must be enabled for this property to kick in.

ActionScript Example

var window = gMap.openInfoWindow();window.zIndexAuto = true;

autoClose Boolean Indicates whether to close the info window when user presses anywhere on the map outside the info window

ActionScript Example

var window = gMap.openInfoWindow();window.autoClose = true;

Info Window appearance propertiesw Number Defines window width.

ActionScript Example

var window = gMap.openInfoWindow();window.w = 100;

h Number Property defines window height.

ActionScript Example

var window = gMap.openInfoWindow();window.h = 50;

radius Number Property defines window corner radius.

ActionScript Example

var window = gMap.openInfoWindow();window.radius = 0;

close Boolean Property defines whether the close button is displayed (true) or not (false).

ActionScript Example

var window = gMap.openInfoWindow();window.close = false;

title String Property defines the info window title.

ActionScript Example

var window = gMap.openInfoWindow();window.title = "Hello World";

titleFont String Property defines the title font. Please note that titleHTML overrides titleFont.

ActionScript Example

- 77 of 104 -

Page 78: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

var window = gMap.openInfoWindow();window.title = "Hello World";window.titleFont = "_serif";

titleRGB Number Property defines the title color. Please note that titleHTML overrides titleRGB.

ActionScript Example

var window = gMap.openInfoWindow();window.title = "Hello World";window.titleRGB = 0xFF0000;

titleSize Number Property defines the title font size. Please note that titleHTML overrides titleSize.

ActionScript Example

var window = gMap.openInfoWindow();window.title = "Hello World";window.titleSize = 15;

titleFormat TextFormat Property defines title text format.

ActionScript Example

var window = gMap.openInfoWindow();

var title_fmt = new TextFormat();with(title_fmt){

color = 0xFF0000;bold = true;font = "_sans";embedFonts = true;

}

window.title = "Hello World";window.titleFormat = title_fmt;

titleHTML Boolean Property defines whether the HTML formatting is applied to the info window title (true) or not (false).

ActionScript Example

var window = gMap.openInfoWindow();

window.title = "<b>Hello</b> <i>World</i>";window.titleHTML = true;

content String Property defines info window content.

ActionScript Example

var window = gMap.openInfoWindow({contentAutoSize:true});

window.title = "Title";window.content = "Content";

- 78 of 104 -

Page 79: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

contentFont String Property defines content font type.

ActionScript Example

var window = gMap.openInfoWindow({contentAutoSize:true});

window.title = "Title";window.content = "Content";window.contentFont = "_serif";

contentRGB Number Property defines content font color.

ActionScript Example

var window = gMap.openInfoWindow({contentAutoSize:true});

window.title = "Title";window.content = "Content";window.contentRGB = 0xFF0000;

contentSize Number Property defines content font size.

ActionScript Example

var window = gMap.openInfoWindow({contentAutoSize:true});

window.title = "Title";window.content = "Content";window.contentSize = 30;

contentFormat Text Format Property defines content text format.

ActionScript Example

var window = gMap.openInfoWindow({contentAutoSize:true});

var content_fmt = new TextFormat();with(content_fmt){

color = 0xFF0000;bold = true;font = "_sans";embedFonts = true;

}

window.title = "Title";window.content = "Content";window.contentFormat = content_fmt;

cotnentHTML Boolean Property defines whether the HTML formatting is applied to the info window content (true) or not (false).

ActionScript Example

- 79 of 104 -

Page 80: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

var window = gMap.openInfoWindow({contentAutoSize:true});

window.title = "Title";window.content = "<i>Content</i>";window.contentHTML = true;

contentAutoSize Property defines whether the info window is resized automatically.

ActionScript Example

var window = gMap.openInfoWindow({contentAutoSize:true});window.title = "Title";window.content = "Content";

tail Boolean Property defines whether the info window tail is displayed (true) or not (false).

ActionScript Example

var window = gMap.openInfoWindow();window.tail = false;

tailHeight Number Property defines the info window tail height.

ActionScript Example

var window = gMap.openInfoWindow();window.tailHeight = 50;

tailWidth Number Property defines the info window tail width.

ActionScript Example

var window = gMap.openInfoWindow();window.tailWidth = 10;

tailOffest Number Property defines the distance that the tail is offset from the center.

ActionScript Example

var window = gMap.openInfoWindow();window.tailOffset = 0;

tailAlign String Property defines the alignment of the info window tail.

Options1. left:String2. right:String

ActionScript Example

var window = gMap.openInfoWindow();window.tailAlign = "left";

- 80 of 104 -

Page 81: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

stroke Boolean Property indicates whether stroke is displayed. Default value is set to true.

ActionScript Example

var window = gMap.openInfoWindow();window.stroke = false;

strokeThickness Number An integer that indicates the thickness of the line in points; valid values are 0 to 255. If a number is not specified, or if the parameter is undefined, a line is not drawn. If a value of less than 0 is passed, Flash Player uses 0. The value 0 indicates hairline thickness; the maximum thickness is 255. If a value greater than 255 is passed, the Flash interpreter uses 255.

ActionScript Example

var window = gMap.openInfoWindow();window.strokeThickness = 5;

strokeRGB Number A hexadecimal color value of the line; for example, red is 0xFF0000, blue is 0x0000FF, and so on. If a value isn't indicated, Flash uses 0x000000 (black).

ActionScript Example

var window = gMap.openInfoWindow();window.strokeRGB = 0xFF00FF;

strokeAlpha Number An integer that indicates the alpha value of the line's color; valid values are 0 to 100. If a value isn't indicated, Flash uses 100 (solid). If the value is less than 0, Flash uses 0; if the value is greater than 100, Flash uses 100.

ActionScript Example

var window = gMap.openInfoWindow();window.strokeAlpha = 10;

fill Boolean Property defines whether maker outline is filled. Default value is set to true.

ActionScript Example

var window = gMap.openInfoWindow();window.fill = false;

fillRGB Number A hexadecimal color value; for example, red is 0xFF0000, blue is 0x0000FF. If this value is not provided or is undefined, a fill is not created.

ActionScript Example

- 81 of 104 -

Page 82: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

var window = gMap.openInfoWindow();window.fillRGB = 0xFFFF00;

fillGradient Object References object that defines gradient fill. Please see Flash 8 beginGradientFill();

ActionScript Example

// Create gradient objectvar windowGradient:Object = new Object;

windowGradient.fillType = "linear";windowGradient.colors = [0xFF33CC, 0xFFFFFF];windowGradient.alphas = [80, 100];windowGradient.ratios = [180, 255];windowGradient.matrix = new flash.geom.Matrix();windowGradient.matrix.createGradientBox(100, 50, (Math.PI * 3 / 2), 0, 0);

var window = gMap.openInfoWindow();window.fillGradient = windowGradient;

fillAlpha Number An integer from 0 to 100 that specifies the alpha value of the fill. If this value is not provided, 100 (solid) is used. If the value is less than 0, Flash uses 0. If the value is greater than 100, Flash uses 100.

ActionScript Example

var point = gMap.addPoint({lat:0, lng:0});point.fillRGB = 0xFF0000;point.fillAlpha = 30;

filters Array Apply standard Flash 8 filters to the info window.

ActionScript Example

// Import drop shadow filterimport flash.filters.DropShadowFilter;

// Create a new drop shadow filtervar ds = new DropShadowFilter(5,45,0x000000,.50,5,5,1,1,false,false,false);

var window = gMap.openInfoWindow();window.filters = [ds];

Optional Stroke Properties.For more information about properties below please see Flash 8 Help for lineStyle method.

strokePixelHinting Boolean Added in Flash Player 8. A Boolean value that specifies whether to hint strokes to full pixels. This value affects both the position of anchors of a curve and the line stroke size itself. If a value is not indicated, Flash Player does not use pixel hinting.

- 82 of 104 -

Page 83: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

strokeNoScale String Added in Flash Player 8. A string that specifies how to scale a stroke. Valid values are as follows:

5. normal - Always scale the thickness (the default).

6. none - Never scale the thickness.7. vertical - Do not scale thickness if object is

scaled vertically only.8. horizontal - Do not scale thickness if object

is scaled horizontally only. strokeCapsStyle String Added in Flash Player 8. A string that specifies the

type of caps at the end of lines. Valid values are: "round", "square", and "none". If a value is not indicated, Flash uses round caps.

strokeJointStyle String Added in Flash Player 8. A string that specifies the type of joint appearance used at angles. Valid values are: "round", "miter", and "bevel". If a value is not indicated, Flash uses round joints.

strokeMiterLimit Number Added in Flash Player 8. A number that indicates the limit at which a miter is cut off. Valid values range from 1 to 255 (and values outside of that range are rounded to 1 or 255). This value is only used if the jointStyle is set to "miter". If a value is not indicated, Flash uses 3. The miterLimit value represents the length that a miter can extend beyond the point at which the lines meet to form a joint. The value expresses a factor of the line thickness. For example, with a miterLimit factor of 2.5 and a thickness of 10 pixels, the miter is cut off at 25 pixels.

- 83 of 104 -

Page 84: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

GTypeControl

Methods

Method DescriptionGTypeControl methods. Methods should be applied to the GtypeControl object directly - GTypeControl.methodName(); show(); Shows the control.

ActionScript Example

var typeControl = gMap.addControl(gMap.GTypeControl({visibility:"off"}));

typeControl.show();hide(); Hides the control.

ActionScript Example

var typeControl = gMap.addControl(gMap.GTypeControl({visibility:"on"}));

typeControl.hide();

Properties

Property Type Descriptionalign String Property defines the position of the control.

1. top-left2. top-right3. top-center4. middle-left5. middle-right6. middle-center7. bottom-left8. bottom-right9. bottom-center

ActionScript Example

var typeControl = gMap.addControl(gMap.GTypeControl());typeControl.align = "middle-right";

padding Object Property defines the padding around the control.

1. x:Number

- 84 of 104 -

Page 85: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

2. y:Number

ActionScript Example

var typeControl = gMap.addControl(gMap.GTypeControl());typeControl.padding = {x:20, y:20};

visibility String Property defines visibility for the control.

1. on2. off

ActionScript Example

var typeControl = gMap.addControl(gMap.GTypeControl({visibility:"off"}));

stackAlignment String Property defines the padding around the control.

1. vertical2. horizontal

ActionScript Example

var typeControl = gMap.addControl(gMap.GTypeControl());typeControl.stackAlignment = "vertical";

stackPadding Object Property defines the padding around each button in the control.

1. Vertical:Number2. horizontal:Number

ActionScript Example

var typeControl = gMap.addControl(gMap.GTypeControl());typeControl.stackPadding = {horizontal:20};

mapTypes Array A read-only array of map types.

ActionScript Example

var typeControl = gMap.addControl(gMap.GTypeControl());trace(typeControl.mapTypes);

buttonDefaultStyle Object Property defines the default style for each button in the control.

1. labelFormat:Object – property defines label text format1. color:String – hexadecimal color value of

label text

- 85 of 104 -

Page 86: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

2. font:String – indicates label font3. size:Number – indicates label text size4. bold:Boolean – indicates whether label

text is bold5. italic:Boolean – indicates whether label

text is italic6. underline:Boolean – indicates whether

label text is underlined7. letterSpacing:Number – indicates letter

spacing for label text2. w:Number – indicates button width3. h:Number – indicates button height4. fill:Boolean – indicates whether button is

filled5. fillRGB:String – hexadecimal color value of

button fill6. fillAlpha:Number – indicates fill alpha7. stroke:Boolean – indicates whether button

has a stroke8. strokeThickness:Number – indicates stroke

width9. strokeRGB:String – hexadecimal color value

of button stroke10. strokeAlpha:Number – indicates stroke

alpha11. filters:Array – ActionScript filter object

ActionScript Example

var typeControl = gMap.addControl(gMap.GTypeControl());typeControl.buttonDefaultStyle = {labelFormat:{color:"0xFFFFFF"}, w:60, h:20, fill:true, fillRGB:"0x000000", fillAlpha:50, stroke:true, strokeThickness:1, strokeRGB:"0x000000", strokeAlpha:75}

buttonSelectedStyle Object Property defines the default style for each button in the control.

12. labelFormat:Object – property defines label text format1. color:String – hexadecimal color value of

label text2. font:String – indicates label font3. size:Number – indicates label text size4. bold:Boolean – indicates whether label

text is bold5. italic:Boolean – indicates whether label

text is italic6. underline:Boolean – indicates whether

label text is underlined7. letterSpacing:Number – indicates letter

spacing for label text

- 86 of 104 -

Page 87: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

13. w:Number – indicates button width14. h:Number – indicates button height15. fill:Boolean – indicates whether button is

filled16. fillRGB:String – hexadecimal color value of

button fill17. fillAlpha:Number – indicates fill alpha18. stroke:Boolean – indicates whether button

has a stroke19. strokeThickness:Number – indicates stroke

width20. strokeRGB:String – hexadecimal color value

of button stroke21. strokeAlpha:Number – indicates stroke

alpha22. filters:Array – ActionScript filter object

ActionScript Example

var typeControl = gMap.addControl(gMap.GTypeControl());typeControl.buttonSelectedStyle = {labelFormat:{color:"0xFFFFFF"}, w:60, h:20, fill:true, fillRGB:"0x000000", fillAlpha:50, stroke:true, strokeThickness:1, strokeRGB:"0x000000", strokeAlpha:75}

buttonOverStyle Object Property defines the default style for each button in the control.

23. labelFormat:Object – property defines label text format1. color:String – hexadecimal color value of

label text2. font:String – indicates label font3. size:Number – indicates label text size4. bold:Boolean – indicates whether label

text is bold5. italic:Boolean – indicates whether label

text is italic6. underline:Boolean – indicates whether

label text is underlined7. letterSpacing:Number – indicates letter

spacing for label text24. w:Number – indicates button width25. h:Number – indicates button height26. fill:Boolean – indicates whether button is

filled27. fillRGB:String – hexadecimal color value of

button fill28. fillAlpha:Number – indicates fill alpha29. stroke:Boolean – indicates whether button

has a stroke30. strokeThickness:Number – indicates stroke

- 87 of 104 -

Page 88: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

width31. strokeRGB:String – hexadecimal color value

of button stroke32. strokeAlpha:Number – indicates stroke

alpha33. filters:Array – ActionScript filter object

ActionScript Example

var typeControl = gMap.addControl(gMap.GTypeControl());typeControl.buttonOverStyle = {labelFormat:{color:"0xFFFFFF"}, w:60, h:20, fill:true, fillRGB:"0x000000", fillAlpha:50, stroke:true, strokeThickness:1, strokeRGB:"0x000000", strokeAlpha:75}

selectedMapTypeId Number A read-only number indicating map type id.

ActionScript Example

var typeControl = gMap.addControl(gMap.GTypeControl());function evntResponder(evnt:Object) {

trace(typeControl.selectedMapTypeId);}typeControl.addEventListener("CONTROL_ON_RELEASE", evntResponder);

selectedMapType String A read-only string indicating map type.

ActionScript Example

var typeControl = gMap.addControl(gMap.GTypeControl());function evntResponder(evnt:Object) {

trace(typeControl.selectedMapType);}typeControl.addEventListener("CONTROL_ON_RELEASE", evntResponder);

Events

Event Return value DescriptionCONTROL_ON_PRESS target

typeTriggered whenever the mouse is pressed on a control.

ActionScript Example

var typeControl = gMap.addControl(gMap.GTypeControl());

function eventResponder(evnt:Object) {trace(evnt.type);trace(evnt.target);

- 88 of 104 -

Page 89: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

}typeControl.addEventListener("CONTROL_ON_PRESS", eventResponder);

CONTROL_ON_RELEASE targettype

Triggered whenever the mouse is released on a control.

ActionScript Example

var typeControl = gMap.addControl(gMap.GTypeControl());

function eventResponder(evnt:Object) {trace(evnt.type);trace(evnt.target);

}typeControl.addEventListener("CONTROL_ON_RELEASE", eventResponder);

CONTROL_ACTION targettypeactionmapType

Triggered whenever the mouse is released on a control.

ActionScript Example

var typeControl = gMap.addControl(gMap.GTypeControl());

function eventResponder(evnt:Object) {trace(evnt.type);trace(evnt.target);trace(evnt.action);trace(evnt.mapType);

}typeControl.addEventListener("CONTROL_ACTION", eventResponder);

- 89 of 104 -

Page 90: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

GPositionControl

Methods

Method DescriptionGPositionControl methods. Methods should be applied to the GPositionControl object directly - GPositionControl.methodName(); show(); Shows the control.

ActionScript Example

var posControl = gMap.addControl(gMap.GPositionControl({visibility:"off"}));

posControl.show();hide(); Hides the control.

ActionScript Example

var posControl = gMap.addControl(gMap.GPositionControl({visibility:"on"}));

posControl.hide();

Properties

Property Type Descriptionalign String Property defines the position of the control.

10. top-left11. top-right12. top-center13. middle-left14. middle-right15. middle-center16. bottom-left17. bottom-right18. bottom-center

ActionScript Example

var posControl = gMap.addControl(gMap.GPositionControl());posControl.align = "middle-right";

padding Object Property defines the padding around the control.

1. x:Number

- 90 of 104 -

Page 91: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

2. y:Number

ActionScript Example

var posControl = gMap.addControl(gMap.GPositionControl());posControl.padding = {x:20, y:20};

visibility String Property defines visibility for the control.

1. on2. off

ActionScript Example

var posControl = gMap.addControl(gMap.GPositionControl({visibility:"off"}));

stackPadding Object Property defines the padding around each button in the control.

1. Vertical:Number2. horizontal:Number

ActionScript Example

var posControl = gMap.addControl(gMap.GPositionControl());posControl.stackPadding = {vertical:20, horizontal:20};

buttonDefaultStyle Object Property defines the default style for each button in the control.

1. labelFormat:Object – property defines label text format1. color:String – hexadecimal color value of

label text2. font:String – indicates label font3. size:Number – indicates label text size4. bold:Boolean – indicates whether label

text is bold5. italic:Boolean – indicates whether label

text is italic6. underline:Boolean – indicates whether

label text is underlined7. letterSpacing:Number – indicates letter

spacing for label text2. w:Number – indicates button width3. h:Number – indicates button height4. fill:Boolean – indicates whether button is

filled5. fillRGB:String – hexadecimal color value of

button fill

- 91 of 104 -

Page 92: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

6. fillAlpha:Number – indicates fill alpha7. stroke:Boolean – indicates whether button

has a stroke8. strokeThickness:Number – indicates stroke

width9. strokeRGB:String – hexadecimal color value

of button stroke10. strokeAlpha:Number – indicates stroke

alpha11. filters:Array – ActionScript filter object

ActionScript Example

var posControl = gMap.addControl(gMap.GPositionControl());posControl.buttonDefaultStyle = {labelFormat:{color:"0xFFFFFF"}, w:20, h:20, fill:true, fillRGB:"0x000000", fillAlpha:50, stroke:true, strokeThickness:1, strokeRGB:"0x000000", strokeAlpha:75}

buttonSelectedStyle Object Property defines the default style for each button in the control.

12. labelFormat:Object – property defines label text format1. color:String – hexadecimal color value of

label text2. font:String – indicates label font3. size:Number – indicates label text size4. bold:Boolean – indicates whether label

text is bold5. italic:Boolean – indicates whether label

text is italic6. underline:Boolean – indicates whether

label text is underlined7. letterSpacing:Number – indicates letter

spacing for label text13. w:Number – indicates button width14. h:Number – indicates button height15. fill:Boolean – indicates whether button is

filled16. fillRGB:String – hexadecimal color value of

button fill17. fillAlpha:Number – indicates fill alpha18. stroke:Boolean – indicates whether button

has a stroke19. strokeThickness:Number – indicates stroke

width20. strokeRGB:String – hexadecimal color value

of button stroke21. strokeAlpha:Number – indicates stroke

alpha22. filters:Array – ActionScript filter object

- 92 of 104 -

Page 93: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

ActionScript Example

var posControl = gMap.addControl(gMap.GPositionControl());posControl.buttonSelectedStyle = {labelFormat:{color:"0xFFFFFF"}, w:20, h:20, fill:true, fillRGB:"0x000000", fillAlpha:50, stroke:true, strokeThickness:1, strokeRGB:"0x000000", strokeAlpha:75}

buttonOverStyle Object Property defines the default style for each button in the control.

23. labelFormat:Object – property defines label text format1. color:String – hexadecimal color value of

label text2. font:String – indicates label font3. size:Number – indicates label text size4. bold:Boolean – indicates whether label

text is bold5. italic:Boolean – indicates whether label

text is italic6. underline:Boolean – indicates whether

label text is underlined7. letterSpacing:Number – indicates letter

spacing for label text24. w:Number – indicates button width25. h:Number – indicates button height26. fill:Boolean – indicates whether button is

filled27. fillRGB:String – hexadecimal color value of

button fill28. fillAlpha:Number – indicates fill alpha29. stroke:Boolean – indicates whether button

has a stroke30. strokeThickness:Number – indicates stroke

width31. strokeRGB:String – hexadecimal color value

of button stroke32. strokeAlpha:Number – indicates stroke

alpha33. filters:Array – ActionScript filter object

ActionScript Example

var posControl = gMap.addControl(gMap.GPositionControl());posControl.buttonOverStyle = {labelFormat:{color:"0xFFFFFF"}, w:20, h:20, fill:true, fillRGB:"0x000000", fillAlpha:50, stroke:true, strokeThickness:1, strokeRGB:"0x000000", strokeAlpha:75}

- 93 of 104 -

Page 94: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

Events

Event Return value DescriptionCONTROL_ON_PRESS target

typeTriggered whenever the mouse is pressed on a control.

ActionScript Example

var posControl = gMap.addControl(gMap.GPositionControl());

function eventResponder(evnt:Object) {trace(evnt.type);trace(evnt.target);

}posControl.addEventListener("CONTROL_ON_PRESS", eventResponder);

CONTROL_ON_RELEASE targettype

Triggered whenever the mouse is released on a control.

ActionScript Example

var posControl = gMap.addControl(gMap.GPositionControl());

function eventResponder(evnt:Object) {trace(evnt.type);trace(evnt.target);

}posControl.addEventListener("CONTROL_ON_RELEASE", eventResponder);

CONTROL_ACTION targettypeaction

Triggered whenever the mouse is released on a control.

ActionScript Example

var posControl = gMap.addControl(gMap.GPositionControl());

function eventResponder(evnt:Object) {trace(evnt.type);trace(evnt.target);trace(evnt.action);

}posControl.addEventListener("CONTROL_ACTION", eventResponder);

- 94 of 104 -

Page 95: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

GZoomControl

Methods

Method DescriptionGZoomControl methods. Methods should be applied to the GZoomControl object directly - GZoomControl.methodName(); show(); Shows the control.

ActionScript Example

var zoomControl = gMap.addControl(gMap.GZoomControl({visibility:"off"}));

zoomControl.show();hide(); Hides the control.

ActionScript Example

var zoomControl = gMap.addControl(gMap.GZoomControl({visibility:"on"}));

zoomControl.hide();

Properties

Property Type Descriptionalign String Property defines the position of the control.

19. top-left20. top-right21. top-center22. middle-left23. middle-right24. middle-center25. bottom-left26. bottom-right27. bottom-center

ActionScript Example

var zoomControl = gMap.addControl(gMap.GZoomControl());zoomControl.align = "middle-right";

display String Property defines display type for zoom bar.

1. compact

- 95 of 104 -

Page 96: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

2. expanded

ActionScript Example

var zoomControl = gMap.addControl(gMap.GZoomControl({display:”compact”}));

padding Object Property defines the padding around the control.

1. x:Number2. y:Number

ActionScript Example

var zoomControl = gMap.addControl(gMap.GZoomControl());zoomControl.padding = {x:20, y:20};

visibility String Property defines visibility for the control.

1. on2. off

ActionScript Example

var zoomControl = gMap.addControl(gMap.GZoomControl({visibility:"off"}));

stackPadding Object Property defines the padding around each button in the control.

1. vertical:Number2. horizontal:Number

ActionScript Example

var zoomControl = gMap.addControl(gMap.GZoomControl());zoomControl.stackPadding = {vertical:20, horizontal:20};

buttonDefaultStyle Object Property defines the default style for each button in the control.

1. w:Number – indicates button width2. h:Number – indicates button height3. fill:Boolean – indicates whether button is

filled4. fillRGB:String – hexadecimal color value of

button fill5. fillAlpha:Number – indicates fill alpha6. stroke:Boolean – indicates whether button

has a stroke7. strokeThickness:Number – indicates stroke

- 96 of 104 -

Page 97: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

width8. strokeRGB:String – hexadecimal color value

of button stroke9. strokeAlpha:Number – indicates stroke

alpha10. filters:Array – ActionScript filter object

ActionScript Example

var zoomControl = gMap.addControl(gMap.GZoomControl());zoomControl.buttonDefaultStyle = {w:17, h:17, fill:true, fillRGB:"0x000000", fillAlpha:50, stroke:true, strokeThickness:1, strokeRGB:"0x000000", strokeAlpha:75}

buttonSelectedStyle Object Property defines the default style for each button in the control.

1. w:Number – indicates button width2. h:Number – indicates button height3. fill:Boolean – indicates whether button is

filled4. fillRGB:String – hexadecimal color value of

button fill5. fillAlpha:Number – indicates fill alpha6. stroke:Boolean – indicates whether button

has a stroke7. strokeThickness:Number – indicates stroke

width8. strokeRGB:String – hexadecimal color value

of button stroke9. strokeAlpha:Number – indicates stroke

alpha10. filters:Array – ActionScript filter object

ActionScript Example

var zoomControl = gMap.addControl(gMap.GZoomControl());zoomControl.buttonSelectedStyle = {w:17, h:17, fill:true, fillRGB:"0x000000", fillAlpha:50, stroke:true, strokeThickness:1, strokeRGB:"0x000000", strokeAlpha:75}

buttonOverStyle Object Property defines the default style for each button in the control.

1. w:Number – indicates button width2. h:Number – indicates button height3. fill:Boolean – indicates whether button is

filled4. fillRGB:String – hexadecimal color value of

- 97 of 104 -

Page 98: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

button fill5. fillAlpha:Number – indicates fill alpha6. stroke:Boolean – indicates whether button

has a stroke7. strokeThickness:Number – indicates stroke

width8. strokeRGB:String – hexadecimal color value

of button stroke9. strokeAlpha:Number – indicates stroke

alpha10. filters:Array – ActionScript filter object

ActionScript Example

var zoomControl = gMap.addControl(gMap.GZoomControl());zoomControl.buttonOverStyle = {w:17, h:17, fill:true, fillRGB:"0x000000", fillAlpha:50, stroke:true, strokeThickness:1, strokeRGB:"0x000000", strokeAlpha:75}

widgetDefaultStyle Object Property defines the default style for the scroll track widget.

1. w:Number – indicates button width2. h:Number – indicates button height3. fill:Boolean – indicates whether button is

filled4. fillRGB:String – hexadecimal color value of

button fill5. fillAlpha:Number – indicates fill alpha6. stroke:Boolean – indicates whether button

has a stroke7. strokeThickness:Number – indicates stroke

width8. strokeRGB:String – hexadecimal color value

of button stroke9. strokeAlpha:Number – indicates stroke

alpha10. filters:Array – ActionScript filter object

ActionScript Example

var zoomControl = gMap.addControl(gMap.GZoomControl({widgetDefaultStyle:{w:20, h:5, fill:true, fillRGB:"0x000000", fillAlpha:50, stroke:true, strokeThickness:1, strokeRGB:"0x000000", strokeAlpha:75}}));

widgetOverStyle Object Property defines the over style for the scroll track widget.

1. w:Number – indicates button width2. h:Number – indicates button height

- 98 of 104 -

Page 99: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

3. fill:Boolean – indicates whether button is filled

4. fillRGB:String – hexadecimal color value of button fill

5. fillAlpha:Number – indicates fill alpha6. stroke:Boolean – indicates whether button

has a stroke7. strokeThickness:Number – indicates stroke

width8. strokeRGB:String – hexadecimal color value

of button stroke9. strokeAlpha:Number – indicates stroke

alpha10. filters:Array – ActionScript filter object

ActionScript Example

var zoomControl = gMap.addControl(gMap.GZoomControl());zoomControl.widgetOverStyle = {w:20, h:5, fill:true, fillRGB:"0x000000", fillAlpha:50, stroke:true, strokeThickness:1, strokeRGB:"0x000000", strokeAlpha:75};

widgetSelectedStyle Object Property defines the selected style for the scroll track widget.

1. w:Number – indicates button width2. h:Number – indicates button height3. fill:Boolean – indicates whether button is

filled4. fillRGB:String – hexadecimal color value of

button fill5. fillAlpha:Number – indicates fill alpha6. stroke:Boolean – indicates whether button

has a stroke7. strokeThickness:Number – indicates stroke

width8. strokeRGB:String – hexadecimal color value

of button stroke9. strokeAlpha:Number – indicates stroke

alpha10. filters:Array – ActionScript filter object

ActionScript Example

var zoomControl = gMap.addControl(gMap.GZoomControl());zoomControl.widgetSelectedStyle = {w:20, h:5, fill:true, fillRGB:"0x000000", fillAlpha:50, stroke:true, strokeThickness:1, strokeRGB:"0x000000", strokeAlpha:75};

scrollTrackStyle Object Property defines the style for the scroll track.

- 99 of 104 -

Page 100: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

1. fill:Boolean – indicates whether button is filled

2. fillRGB:String – hexadecimal color value of button fill

3. fillAlpha:Number – indicates fill alpha4. stroke:Boolean – indicates whether button

has a stroke5. strokeThickness:Number – indicates stroke

width6. strokeRGB:String – hexadecimal color value

of button stroke7. strokeAlpha:Number – indicates stroke

alpha8. filters:Array – ActionScript filter object

ActionScript Example

var zoomControl = gMap.addControl(gMap.GZoomControl());zoomControl.scrollTrackStyle = {fill:true, fillRGB:"0x000000", fillAlpha:50, stroke:true, strokeThickness:1, strokeRGB:"0x000000", strokeAlpha:75};

Events

Event Return value DescriptionCONTROL_ON_PRESS target

typeTriggered whenever the mouse is pressed on a control.

ActionScript Example

var zoomControl = gMap.addControl(gMap.GZoomControl());

function eventResponder(evnt:Object) {trace(evnt.type);trace(evnt.target);

}zoomControl.addEventListener("CONTROL_ON_PRESS", eventResponder);

CONTROL_ON_RELEASE targettype

Triggered whenever the mouse is released on a control.

ActionScript Example

var zoomControl = gMap.addControl(gMap.GZoomControl());

function eventResponder(evnt:Object) {trace(evnt.type);trace(evnt.target);

- 100 of 104 -

Page 101: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

}zoomControl.addEventListener("CONTROL_ON_RELEASE", eventResponder);

CONTROL_ACTION targettypeaction

Triggered whenever the mouse is released on a control.

ActionScript Example

var zoomControl = gMap.addControl(gMap.GZoomControl());

function eventResponder(evnt:Object) {trace(evnt.type);trace(evnt.target);trace(evnt.action);

}zoomControl.addEventListener("CONTROL_ACTION", eventResponder);

- 101 of 104 -

Page 102: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

GNavigatorControl

Methods

Method DescriptionGNavigatorControl methods. Methods should be applied to the GNavigatorControl object directly - GNavigatorControl.methodName(); show(); Shows the control.

ActionScript Example

var navControl = gMap.addControl(gMap.GNavigatorControl({visibility:"off"}));

navControl.show();hide(); Hides the control.

ActionScript Example

var navControl = gMap.addControl(gMap.GNavigatorControl({visibility:"on"}));

navControl.hide();

Properties

Property Type Descriptionalign String Property defines the position of the control.

28. top-left29. top-right30. top-center31. middle-left32. middle-right33. middle-center34. bottom-left35. bottom-right36. bottom-center

ActionScript Example

var navControl = gMap.addControl(gMap.GNavigatorControl());navControl.align = "top-left";

padding Object Property defines the padding around the control.

1. x:Number

- 102 of 104 -

Page 103: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

2. y:Number

ActionScript Example

var navControl = gMap.addControl(gMap.GNavigatorControl());navControl.padding = {x:20, y:20};

visibility String Property defines visibility for the control.

1. on2. off

ActionScript Example

var navControl = gMap.addControl(gMap.GNavigatorControl({visibility:"off"}));

width Number Property defines navigator control width.

ActionScript Example

var navControl = gMap.addControl(gMap.GNavigatorControl());navControl.width = 200;

height Number Property defines navigator control height.

ActionScript Example

var navControl = gMap.addControl(gMap.GNavigatorControl());navControl.height = 200;

borderThickness Number Property defines the width of the border around the navigator window.

ActionScript Example

var navControl = gMap.addControl(gMap.GNavigatorControl());navControl.borderThickness = 10;

borderStyle Object Property defines the style of the border around the navigator window.

1. fill:Boolean – indicates whether border is filled

2. fillRGB:String – hexadecimal color value of border fill

3. fillAlpha:Number – indicates fill alpha4. stroke:Boolean – indicates whether border

has a stroke5. strokeThickness:Number – indicates stroke

width6. strokeRGB:String – hexadecimal color value

- 103 of 104 -

Page 104: GMap Documentation

GMap ActionScript 2 Flash Componenthttp:www.afcomponents.com/components/g_map

of border stroke7. strokeAlpha:Number – indicates stroke

alpha8. filters:Array – ActionScript filter object

ActionScript Example

var navControl = gMap.addControl(gMap.GNavigatorControl());navControl.borderStyle = {stroke:true, strokeRGB:"0x000000", strokeAlpha:40, fill:true, fillRGB:"0x000000", fillAlpha:40, bevel:"none", bevelRGB:"0xFFFFFF", bevelAlpha:50}Property defines the style of the border around the navigator window.

1. fillRGB:String – hexadecimal color value of border fill

2. fillAlpha:Number – indicates fill alpha3. strokeRGB:String – hexadecimal color value

of border stroke4. strokeAlpha:Number – indicates stroke

alpha5. filters:Array – ActionScript filter object

ActionScript Example

var navControl = gMap.addControl(gMap.GNavigatorControl());navControl.navigatorStyle = {strokeRGB:"0x000000", strokeAlpha:10, fillRGB:"0x000000", fillAlpha:10}

Events

Event Return value Description

- 104 of 104 -