A vector layer for displaying avoid/favor polygons. Create a new instance with the ALKMaps.Layer.AvoidFavor constructor.
ALKMaps. | A vector layer for displaying avoid/favor polygons. |
Properties | |
styleMap | Customize avoid/favor visual styles. |
frameAvoidFavor | Zoom to newly added features if it sets to true. |
Constructor | |
ALKMaps. | Create a vector layer for drawing avoid/favor objects. |
Functions | |
setMap | The layer has been added to the map. |
getAvoidFavorSets | Add avoid/favor features on the layer. |
addAvoidFavorPolygonGroup | Add avoid/favor features on the layer. |
addAvoidFavorPolygon | Add avoid/favor features on the layer. |
removeAvoidFavorPolygon | Remove the avoid/favor polygon with the given id. |
Create a vector layer for drawing avoid/favor objects.
name | {String} Unique layer name. |
options | {Object} Properties to set on this layer. |
frameAvoidFavor | {Boolean} Zoom to newly added features if it sets to true. |
styleMap | {ALKMaps.StyleMap} Customize avoid/favor visual styles. |
{ALKMaps.Layer.AvoidFavor} A new vector layer for drawing avoid/favor objects.
addAvoidFavorPolygonGroup: function ( params )
Add avoid/favor features on the layer.
params: | {Object} |
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: function ( params )
Add avoid/favor features on the layer.
params: | {Object} |
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: function ( id )
Remove the avoid/favor polygon with the given id.
id | {String} Id of the polygon that will be removed from the layer. |
avoidFavorLayer.removeAvoidFavorPolygon("ALKMaps.Feature.Vector_400");
{Boolean} Whether or not polygon was successfully removed.
The layer has been added to the map.
setMap: function ( map )
Add avoid/favor features on the layer.
getAvoidFavorSets: function ( params )
Add avoid/favor features on the layer.
addAvoidFavorPolygonGroup: function ( params )
Add avoid/favor features on the layer.
addAvoidFavorPolygon: function ( params )
Remove the avoid/favor polygon with the given id.
removeAvoidFavorPolygon: function ( id )