UI Mapbox Elements
Classes
- GeoshapeAdapter
This should be derived from and supplied to the GeoshapeController to perform actions related to creating, updating, and display geoshapes on the map
Constants
- SATELLITE
This file is used to control the types and url of the mapboxs imagery.
Functions
- url(style) ⇒
Returns the mapbox url for the given style
- next(style) ⇒
Returns the next style, assuming the types exist in a list
- init(options)
Sets the options for the style.
- create()
Returns a Symbolizer that will return { symbol, layer } where symbol is the name or
- if the data item is targeted, selected or rolled over - addImage(name, imageOptions)
Adds an image to the Symbols
- addAlias()
Adds an alias. Any references to name will be redirected to the param mapsTo
- getImagesArray()
Reorganizes this.images into [ [name0, image0], ..., [nameN, imageN]] for mapbox
- getLayers()
Returns a array of layers to render. Because Mapbox cannot control the line properties of a filled shape very well, this will create two separate layers per geoshape, one for the fill and selection, on for the outline.
- getLayers(sourceMap)
Returns an object { normal : [
], rollover : [ ] } - getPosition(data)
Returns the position array [longitude, latitude] for the given data. By default this will use the Path access objects to get the position
- getLayerNames()
Returns the layer names that will be generated. Useful for supplying to selectableLayerIds or rolloverableLayersIds to set what types can be clicked or rolled over.
- getLayers(dataList, options) ⇒
This will return a set of layers used to represent the dataList
GeoshapeAdapter
This should be derived from and supplied to the GeoshapeController to perform actions related to creating, updating, and display geoshapes on the map
Kind: global class
- GeoshapeAdapter
- .addShape(shape) ⇒
Promise(Shape)
- .updateShape(shape) ⇒
Promise
- .addShape(shape) ⇒
Promise(Shape)
geoshapeAdapter.addShape(shape) ⇒ Called when a new shape should be added to the data source
Kind: instance method of GeoshapeAdapter
Param | Type | Description |
---|---|---|
shape | object | the shape to add to the data source. Returned from createShape |
Promise
geoshapeAdapter.updateShape(shape) ⇒ Update a shape should be added to the data source
Kind: instance method of GeoshapeAdapter
Param | Type | Description |
---|---|---|
shape | object | the shape to add to the data source. Returned from createShape |
SATELLITE
This file is used to control the types and url of the mapboxs imagery.
url(style) ⇒
Returns the mapbox url for the given style
Kind: global function
Returns: the mapbox url for the style, or for vector if
the style is unknown
Param | Type | Description |
---|---|---|
style | string | either SATELLITE or VECTOR |
next(style) ⇒
Returns the next style, assuming the types exist in a list
Kind: global function
Returns: the next style, or for VECTOR if the style is unknown
Param | Type | Description |
---|---|---|
style | string | either SATELLITE or VECTOR |
init(options)
Sets the options for the style.
Kind: global function
Param | Type | Description |
---|---|---|
options | object | |
options.styles | object | |
options.styles.<STYLE | string | KEY> the mapbox url for the style |
create()
Returns a Symbolizer that will return { symbol, layer } where
symbol is the name or
addImage(name, imageOptions)
Adds an image to the Symbols
Kind: global function
Param | Type | Description |
---|---|---|
name | string | the name of the symbol |
imageOptions | object | |
imageOptions.src | string | the source of the image |
imageOptions.width | int | the width to scale the image to |
imageOptions.height | int | the height to scale the image to |
addAlias()
Adds an alias. Any references to name will be redirected to the param mapsTo
getImagesArray()
Reorganizes this.images into [ [name0, image0], ..., [nameN, imageN]] for mapbox
getLayers()
Returns a array of layers to render. Because Mapbox cannot control the line properties of a filled shape very well, this will create two separate layers per geoshape, one for the fill and selection, on for the outline.
getLayers(sourceMap)
Returns an object { normal : [
Kind: global function
Param | Type | Description |
---|---|---|
sourceMap | object | this supplies information that can be used to render the lines. The keys of this objects match the keys in the pointsMap. The default linePaint will look for lineColor in the object at this key to determine the color of the lines specified by the objects in Array at pointsMap[key] |
getPosition(data)
Returns the position array [longitude, latitude] for the given data. By default this will use the Path access objects to get the position
Kind: global function
Param | Type | Description |
---|---|---|
data | object | the data object |
getLayerNames()
Returns the layer names that will be generated. Useful for supplying to selectableLayerIds or rolloverableLayersIds to set what types can be clicked or rolled over.
getLayers(dataList, options) ⇒
This will return a set of layers used to represent the dataList
Kind: global function
Returns: and object container normal, rollover, selected, targeted fields that
hold Layer objects
Param | Type | Description |
---|---|---|
dataList | array | the objects to render |
options | object | |
options.symbolizer | object | function( data, { selected, targeted, rollover } )) |
options.selected | object | the selected data |
options.targeted | object | the targeted data for the dataList |
options.rollover | object | the rollover data for the dataList |
options.isSelectable | object | true if the objects should be selectable |
options.isRolloverable | object | true if the objects should be rolloverable |