M/layer/GeoJSON~GeoJSON


import GeoJSON from 'M/layer/GeoJSON';

Main constructor of the class. Creates a GeoJSON layer with parameters specified by the user

new GeoJSON(userParameters, options, vendorOptions)

facade/js/layer/GeoJSON.js, line 29
Name Type Description
userParameters string | Mx.parameters.GeoJSON

parameters

options Mx.parameters.LayerOptions

provided by the user

vendorOptions Object

vendor options for the base library

Extends

  • M.layer.Vector

Members

module:M/layer/GeoJSON~GeoJSON.DEFAULT_OPTIONS_STYLE{object}

Default style for GeoJSON layers

module:M/layer/GeoJSON~GeoJSON.DEFAULT_PARAMS{object}

Default params for style GeoJSON layers * @const

Methods

equals(obj){boolean}

facade/js/layer/GeoJSON.js, line 120

Checks if an object is equal to this layer. Two GeoJSON layers are equal if both of them are GeoJSON instances and have the same 'name' and 'extract' attributes

Name Type Description
obj Object

Object to to comapre

Returns:
True if equal, false otherwise

setSource(source)

facade/js/layer/GeoJSON.js, line 152

Sets the source of the layer, in GeoJSON format

Name Type Description
source Object

GeoJSON representation of the layer

setStyle(style, applyToFeature)

facade/js/layer/GeoJSON.js, line 166

Sets the style of the layer

Name Type Default Description
style M.Style

Style to set

applyToFeature bool false

True if set at feature level, false to set atlayer level

setURL(newURL)

facade/js/layer/GeoJSON.js, line 141

Sets the url of the layer

Name Type Description
newURL String

URL