ALKMaps.Layer.AvoidFavor

A vector layer for displaying avoid/favor polygons.  Create a new instance with the ALKMaps.Layer.AvoidFavor constructor.

Inherits from

Summary
ALKMaps.Layer.AvoidFavorA vector layer for displaying avoid/favor polygons.
Properties
styleMapCustomize avoid/favor visual styles.
frameAvoidFavorZoom to newly added features if it sets to true.
Constructor
ALKMaps.Layer.AvoidFavorCreate a vector layer for drawing avoid/favor objects.
Functions
setMapThe layer has been added to the map.
getAvoidFavorSetsAdd avoid/favor features on the layer.
addAvoidFavorPolygonGroupAdd avoid/favor features on the layer.
addAvoidFavorPolygonAdd avoid/favor features on the layer.
removeAvoidFavorPolygonRemove the avoid/favor polygon with the given id.

Properties

styleMap

Customize avoid/favor visual styles.

frameAvoidFavor

Zoom to newly added features if it sets to true.

Constructor

ALKMaps.Layer.AvoidFavor

Create a vector layer for drawing avoid/favor objects.

Parameters

name{String} Unique layer name.
options{Object} Properties to set on this layer.

Valid options

frameAvoidFavor{Boolean} Zoom to newly added features if it sets to true.
styleMap{ALKMaps.StyleMap} Customize avoid/favor visual styles.

Returns

{ALKMaps.Layer.AvoidFavor} A new vector layer for drawing avoid/favor objects.

Functions

setMap

setMap: function (map)

The layer has been added to the map.

getAvoidFavorSets

getAvoidFavorSets: function (params)

Add avoid/favor features on the layer.

Parameters

params:{Object}

Valid params includes

success{Function} success callback function
failure{Function} failure callback function

addAvoidFavorPolygonGroup

addAvoidFavorPolygonGroup: function (params)

Add avoid/favor features on the layer.

Parameters

params:{Object}

Valid params includes

afSetId{Number} Avoid/Favor set unique id.  Required property.
afType{Number} If value is 1, only displays avoid.  If vlaue is 2, only displays favor.  Not setting any value will display both.
frameAvoidFavor{Boolean} Zoom to newly added features if it sets to true.  If not specified, the class level setting would be applied.
success{Function} success callback function
failure{Function} failure callback function

addAvoidFavorPolygon

addAvoidFavorPolygon: function (params)

Add avoid/favor features on the layer.

Parameters

params:{Object}

Valid params includes

afSetId{Number} Avoid/Favor set unique id.  Required property.
afType{Number} If value is 1, only displays avoid.  If value is 2, only displays favor.  Not setting any value will display both.
bbox{Array<Number>} Tile bounds in degrees for now.  The order of elements in the array is min longitude, min latitude, max longitude and max latitude.
frameAvoidFavor{Boolean} Zoom to newly added features if it sets to true.  If not specified, the class level setting would be applied.
success{Function} success callback function
failure{Function} failure callback function

removeAvoidFavorPolygon

removeAvoidFavorPolygon: function (id)

Remove the avoid/favor polygon with the given id.

Parameters

id{String} Id of the polygon that will be removed from the layer.

Example

avoidFavorLayer.removeAvoidFavorPolygon("ALKMaps.Feature.Vector_400");

Returns

{Boolean} Whether or not polygon was successfully removed.

setMap: function (map)
The layer has been added to the map.
getAvoidFavorSets: function (params)
Add avoid/favor features on the layer.
addAvoidFavorPolygonGroup: function (params)
Add avoid/favor features on the layer.
addAvoidFavorPolygon: function (params)
Add avoid/favor features on the layer.
removeAvoidFavorPolygon: function (id)
Remove the avoid/favor polygon with the given id.
Create a vector layer for drawing avoid/favor objects.
Instances of ALKMaps.Layer.Vector are used to render vector data from a variety of sources.
Close