Class: Polygon

bemap.Polygon(coordinates, options)

Base class for Polygon.

Constructor

new Polygon(coordinates, options)

Parameters:
Name Type Description
coordinates bemap.Coordinate Array of bemap.Coordinate.
options Object See below the available values.
Properties
Name Type Description
style bemap.LineStyle Style of poyline used by the renderer.
name String Name of polygon.
properties Object custom object.
Source:

Members

(protected) callback :function

Type:
  • function
Source:

(protected) coords :Array.<bemap.Coordinate>

Type:
Source:

(protected) events :Array

Type:
  • Array
Source:

(protected) id :String

Type:
  • String
Source:

(protected) layer :Object

Type:
  • Object
Source:

(protected) map :Object

Type:
  • Object
Source:

(protected) name :String

Type:
  • String
Source:

(protected) native :Object

Type:
  • Object
Source:

(protected) properties :Object

Type:
  • Object
Source:

(protected) style :bemap.LineStyle

Type:
Source:

Methods

addCoordinate(coordinate) → {bemap.Polygon}

Add a coordinate.
Parameters:
Name Type Description
coordinate bemap.Coordinate bemap.Coordinate.
Source:
Returns:
this
Type
bemap.Polygon

addLonLat(lon, lat) → {bemap.Polygon}

Add a coordinate.
Parameters:
Name Type Description
lon double Longitude in degres deciaml (WGS84).
lat double Latitude in degres deciaml (WGS84).
Source:
Returns:
this
Type
bemap.Polygon

(protected) draggable(callback, options) → {bemap.Listener}

Define the draggable capability for bemap.Polygon.
Parameters:
Name Type Description
callback function Function will be called when the specified eventType is occur.
options object Options.
Properties
Name Type Description
layerFilter bemap.Layer set the bemap layer used as filter.
Source:
Returns:
bemap.listener.
Type
bemap.Listener

getCoordinate(index) → {bemap.Coordinate}

Return the coordinate. See bemap.Coordinate.
Parameters:
Name Type Description
index int Index of coordinate in polygon.
Source:
Returns:
Return the coordinate. See bemap.Coordinate.
Type
bemap.Coordinate

getCoordinates() → {Array.<bemap.Coordinate>}

Return an array of coordinate. See bemap.Coordinate.
Source:
Returns:
Return an array of the coordinate. See bemap.Coordinate.
Type
Array.<bemap.Coordinate>

getId() → {String}

Return the id of the polygon.
Source:
Returns:
Return the id of the polygon.
Type
String

getLatLonArray(index) → {array}

Return an array with latitude and longitude in degres decimal (WGS94).
Parameters:
Name Type Description
index int Index of coordinate in polygon.
Source:
Returns:
Return an array with latitude and longitude in degres decimal (WGS94).
Type
array

getLatLonArrays() → {array}

Return an array with latitude and longitude in degres decimal (WGS94). Example: [ [lat, lon], [lat, lon], ... ]
Source:
Returns:
Return an array with latitude and longitude in degres decimal (WGS94).
Type
array

getLonLatArray(index) → {array}

Return an array with longitude and latitude in degres decimal (WGS94).
Parameters:
Name Type Description
index int Index of coordinate in polygon.
Source:
Returns:
Return an array with longitude and latitude in degres decimal (WGS94).
Type
array

getLonLatArrays() → {array}

Return an array with longitude and latitude in degres decimal (WGS94). Example: [ [lon, lat], [lon, lat], ... ]
Source:
Returns:
Return an array with longitude and latitude in degres decimal (WGS94).
Type
array

getName() → {String}

Return the name of the polygon.
Source:
Returns:
Return the name of the polygon.
Type
String

getStyle() → {bemap.LineStyle}

Return the style of the polygon.
Source:
Returns:
Return the style of the polygon.
Type
bemap.LineStyle

on(eventType, callback, options) → {bemap.Polygon}

Set the listner when an specified eventType occur on bemap.Polygon.
Parameters:
Name Type Description
eventType bemap.Map.EventType Event type.
callback function Function will be called when the specified eventType is occur.
options object options.
Source:
Returns:
this.
Type
bemap.Polygon

remove() → {bemap.Polygon}

Remove the Polygon from the layer.
Source:
Returns:
this
Type
bemap.Polygon

setId(id) → {bemap.Polygon}

Define the id of polygon
Parameters:
Name Type Description
id String the new id to set.
Source:
Returns:
this
Type
bemap.Polygon

setName(name) → {bemap.Polygon}

Define the name of polygon
Parameters:
Name Type Description
name String the new name to set.
Source:
Returns:
this
Type
bemap.Polygon