Package | com.google.maps.overlays |
Class | public class MarkerOptions |
Property | Defined by | ||
---|---|---|---|
clickable : Object
A Boolean value that specifies whether the marker is clickable.
| MarkerOptions | ||
draggable : Object
A Boolean value that specifies whether the marker can be dragged around
the map.
| MarkerOptions | ||
fillStyle : FillStyle
Marker fill style.
| MarkerOptions | ||
gravity : Object
A Number value that specifies marker gravity factor.
| MarkerOptions | ||
hasShadow : Object
A Boolean value that specifies whether the marker has a shadow.
| MarkerOptions | ||
icon : DisplayObject
Display object used as marker's custom icon.
| MarkerOptions | ||
iconAlignment : Object
A Number value that specifies which point on the marker is used for
aligning it relative to the LatLng that it represents.
| MarkerOptions | ||
iconOffset : Point
Marker custom icon offset.
| MarkerOptions | ||
label : String
Marker label text.
| MarkerOptions | ||
labelFormat : TextFormat
Marker label text format.
| MarkerOptions | ||
radius : Object
A Number value that specifies the marker radius.
| MarkerOptions | ||
strokeStyle : StrokeStyle
Marker stroke style.
| MarkerOptions | ||
tooltip : String
Marker tooltip text.
| MarkerOptions |
Method | Defined by | ||
---|---|---|---|
MarkerOptions(param:Object = null)
Constructs a new MarkerOptions object, optionally initializing it from an
object.
| MarkerOptions | ||
[static]
Retrieves the MarkerOptions instance that represents the default set of
options that applies to all markers.
| MarkerOptions | ||
setDefaultOptions(defaults:MarkerOptions):void
[static]
Sets the default set of options that applies when new markers are created.
| MarkerOptions | ||
toString():String
Returns a String representation of this object.
| MarkerOptions |
Constant | Defined by | ||
---|---|---|---|
ALIGN_BOTTOM : Number = 0x20 [static] Align object to the bottom
| MarkerOptions | ||
ALIGN_HORIZONTAL_CENTER : Number = 1 [static] Align object to the center (horizontally)
| MarkerOptions | ||
ALIGN_LEFT : Number = 0 [static] Align object to the left
| MarkerOptions | ||
ALIGN_RIGHT : Number = 2 [static] Align object to the right
| MarkerOptions | ||
ALIGN_TOP : Number = 0x00 [static] Align object to the top
| MarkerOptions | ||
ALIGN_VERTICAL_CENTER : Number = 0x10 [static] Align object to the center (vertically)
| MarkerOptions |
clickable | property |
clickable:Object
[read-write]A Boolean value that specifies whether the marker is clickable. Markers that are not clickable generate no MapMouseEvent.CLICK or MapMouseEvent.DOUBLE_CLICK events, but may, if draggable, still cause other events. Markers that are not clickable don't cause the hand cursor icon to appear when the cursor hovers over them. This property must explicitly be set to false to make a marker unclickable.
Implementation public function get clickable():Object
public function set clickable(value:Object):void
draggable | property |
draggable:Object
[read-write]A Boolean value that specifies whether the marker can be dragged around the map.
Implementation public function get draggable():Object
public function set draggable(value:Object):void
fillStyle | property |
fillStyle:FillStyle
[read-write]Marker fill style.
Implementation public function get fillStyle():FillStyle
public function set fillStyle(value:FillStyle):void
gravity | property |
gravity:Object
[read-write]A Number value that specifies marker gravity factor.
Implementation public function get gravity():Object
public function set gravity(value:Object):void
hasShadow | property |
hasShadow:Object
[read-write]A Boolean value that specifies whether the marker has a shadow. In case of markers with custom icons, cross-scripting access to the icon content has to be available in order to generate the shadow (if the domain from which the marker is loaded is different from the source domain of the map application).
Implementation public function get hasShadow():Object
public function set hasShadow(value:Object):void
icon | property |
icon:DisplayObject
[read-write]Display object used as marker's custom icon. Note that the display object instance specified as the icon can only be used for a single marker (as it will be added to the marker through a call to addChild() and cannot be reused). Adding the same image or movie clip to multiple different markers simultaneously will require creating a separate instance of that image (or movie clip) for each marker.
Implementation public function get icon():DisplayObject
public function set icon(value:DisplayObject):void
// Add the marker's icon as a resource. [Embed(source="mycustommarkericon.jpg")] private var MyCustomMarkerIcon:Class; // Set the icon and place it so that the target location is // aligned to point (10, 10) from the icon's top left corner. var options:MarkerOptions = new MarkerOptions(); options.icon = new MyCustomMarkerIcon(); options.iconAlignment = MarkerOptions.ALIGN_LEFT + MarkerOptions.ALIGN_TOP; options.iconOffset = new Point(10, 10); // Create the marker. var myMarker:Marker = new Marker(new LatLng(0, 0), options); myMap.addOverlay(myMarker);
iconAlignment | property |
iconAlignment:Object
[read-write]A Number value that specifies which point on the marker is used for aligning it relative to the LatLng that it represents. Use combinations of MarkerOptions.ALIGN flags to specify the alignment.
Implementation public function get iconAlignment():Object
public function set iconAlignment(value:Object):void
See also
iconOffset | property |
iconOffset:Point
[read-write]Marker custom icon offset. When a custom icon is used, this parameter specifies the offset of the marker's target location in relation to the custom icon's alignment point.
Implementation public function get iconOffset():Point
public function set iconOffset(value:Point):void
See also
label | property |
label:String
[read-write]Marker label text. Setting the label text removes any custom icon and applies standard rendering to draw the marker.
Implementation public function get label():String
public function set label(value:String):void
labelFormat | property |
labelFormat:TextFormat
[read-write]Marker label text format.
Implementation public function get labelFormat():TextFormat
public function set labelFormat(value:TextFormat):void
radius | property |
radius:Object
[read-write]A Number value that specifies the marker radius.
Implementation public function get radius():Object
public function set radius(value:Object):void
strokeStyle | property |
strokeStyle:StrokeStyle
[read-write]Marker stroke style.
Implementation public function get strokeStyle():StrokeStyle
public function set strokeStyle(value:StrokeStyle):void
tooltip | property |
tooltip:String
[read-write]Marker tooltip text.
Implementation public function get tooltip():String
public function set tooltip(value:String):void
MarkerOptions | () | constructor |
public function MarkerOptions(param:Object = null)
Constructs a new MarkerOptions object, optionally initializing it from an object.
Parametersparam:Object (default = null ) — An initialization object containing a set of
values that supplement the default set.
|
See also
var options:MarkerOptions = new MarkerOptions({ strokeStyle: { color: 0x987654 }, fillStyle: { color: 0x223344, alpha: 0.8 }, label: "Z", labelFormat: { bold: true }, tooltip: "This is a marker", radius: 12, hasShadow: true, clickable: false, draggable: true, gravity: 0.5, distanceScaling: false });
getDefaultOptions | () | method |
public static function getDefaultOptions():MarkerOptions
Retrieves the MarkerOptions instance that represents the default set of options that applies to all markers.
// Initialization object corresponding to the initial defaults. { strokeStyle: { thickness: 2, alpha: 1.0, color:Color.BLACK, pixelHinting: false }, fillStyle: { color: 0xFF766A, alpha: 1.0 }, labelFormat: { font: "_sans", size: 12, color: Color.BLACK }, gravity: 0.8, radius: 9, hasShadow: true, draggable: false, distanceScaling: false }
MarkerOptions —
Existing default marker options.
|
setDefaultOptions | () | method |
public static function setDefaultOptions(defaults:MarkerOptions):void
Sets the default set of options that applies when new markers are created.
These defaults will apply to all markers
created after the call to the setDefaultOptions
method.
Individual markers can also specify their own sets of options. Individual
options take precedence over the default ones.
The defaults
parameter may specify a complete or partial set
of marker options. If a partial set of options is specified, it will
supplement the existing defaults, overriding only the values that were
set explicitly and leaving the rest unchanged.
defaults:MarkerOptions — The new set of defaults for marker options.
|
toString | () | method |
public function toString():String
Returns a String representation of this object.
ReturnsString — String representation of this object.
|
ALIGN_BOTTOM | constant |
public static const ALIGN_BOTTOM:Number = 0x20
Align object to the bottom
ALIGN_HORIZONTAL_CENTER | constant |
public static const ALIGN_HORIZONTAL_CENTER:Number = 1
Align object to the center (horizontally)
ALIGN_LEFT | constant |
public static const ALIGN_LEFT:Number = 0
Align object to the left
ALIGN_RIGHT | constant |
public static const ALIGN_RIGHT:Number = 2
Align object to the right
ALIGN_TOP | constant |
public static const ALIGN_TOP:Number = 0x00
Align object to the top
ALIGN_VERTICAL_CENTER | constant |
public static const ALIGN_VERTICAL_CENTER:Number = 0x10
Align object to the center (vertically)