Class: GeoJSONLayer

Core.ModelList.Layer GeoJSONLayer

GeoJSONLayer

new GeoJSONLayer()

modules/core/modelList/layer/geojson.js, line 52
Module to represent GeoJSONLayer
Properties:
Name Type Default Description
supported Array.<String> ["2D", "3D"] Supported modes "2D" and / or "3D"
isClustered Boolean [false Distance to group features to clusters
Fires:
Listens to Events:

Extends

Methods

addId(features){void}

modules/core/modelList/layer/geojson.js, line 603
Ensures all given features have an id
Name Type Description
features Array.<ol/feature> features

inherited checkForScale(options){void}

modules/core/modelList/layer/model.js, line 123
Prüft anhand der Scale ob der Layer sichtbar ist oder nicht
Name Type Description
options object -

inherited checkIfDataLayer(dataLayerId, layerId){Boolean}

modules/core/modelList/layer/model.js, line 110
Checks if dataLayerId matches the given layer id.
Name Type Description
dataLayerId String Id of dataLayer whose features are requested.
layerId String Id of current layer.
Returns:
flag if dataLayerId matches given layer id.

convertToPointFeatures(features){Array.<ol.Feature>}

modules/core/modelList/layer/geojson.js, line 671
Optimierte Umwandlung von Nicht-Punkt-Features in Punkt-Features (für Clustering). Unterstützt Punkt-, Linien- und Polygon-Geometrien. Vermeidet unnötige Objektkopien und beschleunigt Verarbeitung bei großen Mengen.
Name Type Description
features Array.<ol.Feature> Ursprüngliche GeoJSON-Features
Returns:
Features für Clustering

createClusterLayerSource(){void}

modules/core/modelList/layer/geojson.js, line 84
Triggert by createLayerSource to create a clusterLayerSource

createLayer(){void}

modules/core/modelList/layer/geojson.js, line 96
Triggert by Layer to create a ol/layer/Vector
Fires:
  • MapView#event:RadioRequestGetProjection

createLayerSource(){void}

modules/core/modelList/layer/geojson.js, line 73
Triggert by Layer to create a layerSource respectively a clusterLayerSource

createLegendURL(){void}

modules/core/modelList/layer/geojson.js, line 616
creates the legendUrl used by layerinformation
Fires:
  • StyleList#event:RadioRequestReturnModelById

inherited decTransparency(){void}

modules/core/modelList/layer/model.js, line 398
Decreases layer transparency by 10 percent

enableClusterZoomOnClick(map){void}

modules/core/modelList/layer/geojson.js, line 258
Dynamisches Zoomen bei Klick auf Cluster oder einzelnes Feature.
Name Type Description
map ol.Map OpenLayers Karte

expandFeaturesBySubTyp(subTyp){void}

modules/core/modelList/layer/geojson.js, line 531
Requests the latest sensorValues from OpenSenseMap.
Name Type Description
subTyp String SubTyp of layer.

inherited featuresLoaded(features){void}

modules/core/modelList/layer/model.js, line 138
Triggers event if vector features are loaded
Name Type Description
features Array.<ol.Feature> Loaded vector features
Fires:

inherited featureUpdated(feature){void}

modules/core/modelList/layer/model.js, line 243
Triggers event if vector feature is loaded
Name Type Description
feature ol.Feature Updated vector feature
Fires:

getCachedClusterCanvasStyle(count, radius, fillColor, textColor){ol.style.Style}

modules/core/modelList/layer/geojson.js, line 317
Liefert einen gecachten Canvas-Style basierend auf Anzahl und Farbe.
Name Type Description
count number Clustergröße
radius number Symbol-Radius
fillColor string Hintergrundfarbe
textColor string Textfarbe

getFeaturesIntersectsGeometry(geometries, features){Array.<ol.Feature>}

modules/core/modelList/layer/geojson.js, line 465
returns the features that intersect the given geometries
Name Type Description
geometries Array.<ol.geom.Geometry> GeometryCollection with one or more geometry
features Array.<ol.Feature> all features in the geometry extent
Returns:
features

getJsonProjection(data){string}

modules/core/modelList/layer/geojson.js, line 484
Takes the data string to extract the crs definition. According to the GeoJSON Specification (RFC 7946) the geometry is expected to be in EPSG:4326. For downward compatibility a crs tag can be used.
Name Type Description
data string response as GeoJson
See:
Returns:
definition

inherited getResolutions(){void}

modules/core/modelList/layer/model.js, line 376
Sets visible min and max resolution on layer.
Fires:

getValueFromOpenSenseMapSensor(feature, sensorId, name, unit, type){void}

modules/core/modelList/layer/geojson.js, line 563
Sends async request to get the newest measurement of each sensor per feature. Async so that the user can already navigate in the map without waiting for all sensorvalues for all features.
Name Type Description
feature Feature The current Feature.
sensorId String Id of sensor.
name String Name of sensor.
unit String Unit of sensor.
type String Type of sensor.

handleData(data){void}

modules/core/modelList/layer/geojson.js, line 195
Verarbeitet die geladenen GeoJSON-Daten, wandelt sie ggf. für Clustering um und setzt die Datenquelle des Layers.
Name Type Description
data string GeoJSON-Daten als Text

handleResponse(responseText, status, showLoader){void}

modules/core/modelList/layer/geojson.js, line 177
Handles the xhr response
Name Type Default Description
responseText string response as GeoJson
status integer | string status of xhr-request
showLoader boolean false optional Flag to show Loader
Fires:

hideAllFeatures(){void}

modules/core/modelList/layer/geojson.js, line 653
sets null style (=no style) for all features

inherited incTransparency(){void}

modules/core/modelList/layer/model.js, line 388
Increases layer transparency by 10 percent

inherited intervalHandler(){void}

modules/core/modelList/layer/model.js, line 366
Callback for layer interval

inherited isLayerSourceValid(){Boolean}

modules/core/modelList/layer/model.js, line 584
Checks if the layerSource has been setup and a layersource object exist

inherited isLayerValid(){Boolean}

modules/core/modelList/layer/model.js, line 576
Checks if the layer has been setup and a layer object exist

parseDataToFeatures(data, mapProjection, jsonProjection){object}

modules/core/modelList/layer/geojson.js, line 510
Tries to parse data string to ol.format.GeoJson
Name Type Description
data string string to parse
mapProjection ol/proj/Projection target projection to parse features into
jsonProjection string projection of the json
Throws:
Will throw an error if the argument cannot be parsed.

inherited prepareFeaturesFor3D(features){void}

modules/core/modelList/layer/model.js, line 147
Prepares the given features and sets or/and overwrites the coordinates based on the configuration of "altitude" and "altitudeOffset".
Name Type Description
features Array.<ol/Feature> The olFeatures.

inherited prepareLayerObject(){void}

modules/core/modelList/layer/model.js, line 251
Process function. Calls smaller function to prepare and create layer object

inherited registerInteractionMapViewListeners(){void}

modules/core/modelList/layer/model.js, line 343
Register interaction with map view.
Listens to Events:

inherited registerInteractionTreeListeners(channel){void}

modules/core/modelList/layer/model.js, line 274
Register interaction with layer tree.
Name Type Description
channel Radio.channel Radio channel of this module
Listens to Events:

inherited removeLayer(){void}

modules/core/modelList/layer/model.js, line 759
Removes the layer from the map and the collection

inherited resetLayerOrder(){void}

modules/core/modelList/layer/model.js, line 603
Resets layerOrder property; 0 is defined as initial value and the layer will be acknowledged as newly added for the sake of initial positioning

inherited setAltitudeOnGeometry(geometry, altitude, altitudeOffset){ol/geom}

modules/core/modelList/layer/model.js, line 168
Sets the altitude and AltitudeOffset as z coordinate.
Name Type Description
geometry ol/geom Geometry of feature.
altitude Number Altitude. Overwrites the given z coord if available.
altitudeOffset Number Altitude offset.
Returns:
The geometry with newly set coordinates.

inherited setAltitudeOnMultiPoint(coords, altitude, altitudeOffset){Array.<Number>}

modules/core/modelList/layer/model.js, line 196
Sets the altitude on multipoint coordinates.
Name Type Description
coords Array.<Number> Coordinates.
altitude Number Altitude. Overwrites the given z coord if available.
altitudeOffset Number Altitude offset.
Returns:
newly set cooordinates.

inherited setAltitudeOnPoint(coords, altitude, altitudeOffset){Array.<Number>}

modules/core/modelList/layer/model.js, line 213
Sets the altitude on point coordinates.
Name Type Description
coords Array.<Number> Coordinates.
altitude Number Altitude. Overwrites the given z coord if available.
altitudeOffset Number Altitude offset.
Returns:
newly set cooordinates.

setClusterLayerSource(value){void}

modules/core/modelList/layer/geojson.js, line 124
Setter for clusterLayerSource
Name Type Description
value ol.source.vector clusterLayerSource

inherited setGlyphicon(value){void}

modules/core/modelList/item.js, line 69
Setter for glyphicon
Name Type Description
value String Glyphicon

inherited setId(value){void}

modules/core/modelList/item.js, line 34
Setter for id
Name Type Description
value String Id

inherited setIsInThemen(value){void}

modules/core/modelList/item.js, line 78
Setter for isInThemen
Name Type Description
value Boolean Flag if item is in themen

inherited setIsJustAdded(value){void}

modules/core/modelList/layer/model.js, line 751
Setter for isJustAdded (currently only used in uiStyle = table)
Name Type Description
value Boolean Flag if layer has just been added to the tree

inherited setIsOutOfRange(value){void}

modules/core/modelList/layer/model.js, line 676
Setter for isOutOfRange
Name Type Description
value Boolean Flag if map Scale is out of defined layer minScale and maxScale

inherited setIsRemovable(value){void}

modules/core/modelList/layer/model.js, line 740
Setter for isRemovable
Name Type Description
value Boolean Flag if layer is removable from the tree

inherited setIsSelected(value){void}

modules/core/modelList/layer/model.js, line 649
Setter for isSelected
Name Type Description
value Boolean Flag if layer is selected

inherited setIsSettingVisible(value){void}

modules/core/modelList/layer/model.js, line 658
Setter for isSettingVisible
Name Type Description
value Boolean Flag if layer settings are visible

inherited setIsVisibleInMap(value){void}

modules/core/modelList/layer/model.js, line 639
Setter for isVisibleInMap and setter for layer.setVisible
Name Type Description
value Boolean Flag if layer is visible in map

inherited setIsVisibleInMenu(value){void}

modules/core/modelList/item.js, line 105
Setter for setIsVisibleInMenu
Name Type Description
value Boolean Flag if item is visible in menu

inherited setIsVisibleInTree(value){void}

modules/core/modelList/layer/model.js, line 721
Setter for isVisibleInTree
Name Type Description
value Boolean Flag if layer is visible in tree

inherited setLayer(value){void}

modules/core/modelList/layer/model.js, line 630
Setter for layer
Name Type Description
value ol/layer Layer

inherited setLayerInfoChecked(value){void}

modules/core/modelList/layer/model.js, line 612
Setter for layerInfoChecked
Name Type Description
value Boolean Flag if layerInfo was checked

inherited setLayerOrder(value){void}

modules/core/modelList/layer/model.js, line 594
Setter for layerOrder
Name Type Description
value String layerOrder

inherited setLayerSource(value){void}

modules/core/modelList/layer/model.js, line 621
Setter for layerSource
Name Type Description
value ol/source LayerSource

inherited setLegendURL(value){void}

modules/core/modelList/layer/model.js, line 712
Setter for legendURL
Name Type Description
value String legendURL

inherited setLevel(value){void}

modules/core/modelList/item.js, line 87
Setter for level
Name Type Description
value String Level

inherited setMaxResolution(value){void}

modules/core/modelList/layer/model.js, line 685
Setter for ol/layer.setMaxResolution
Name Type Description
value Number Maximum resolution of layer

inherited setMinResolution(value){void}

modules/core/modelList/layer/model.js, line 694
Setter for ol/layer.setMinResolution
Name Type Description
value Number Minimum resolution of layer

inherited setName(value){void}

modules/core/modelList/layer/model.js, line 703
Setter for name
Name Type Description
value String Name of layer

setOpenSenseMapSensorValues(feature, response, name, unit, type){void}

modules/core/modelList/layer/geojson.js, line 590
Sets the latest measurements of the opensensemap sensors at the feature.
Name Type Description
feature Feature The feature.
response JSON The parsed response as JSON.
name String Name of sensor.
unit String Unit of sensor.
type String Type of sensor.

inherited setParentId(value){void}

modules/core/modelList/item.js, line 43
Setter for parentId
Name Type Description
value String ParentId

inherited setSingleBaselayer(value){void}

modules/core/modelList/layer/model.js, line 731
Setter for the singleBaselayer
Name Type Description
value Boolean Flag if only a single baselayer should be selectable at once

inherited setTransparency(value){void}

modules/core/modelList/layer/model.js, line 667
Setter for transparency
Name Type Description
value Number Tranparency in percent

inherited setType(value){void}

modules/core/modelList/item.js, line 60
Setter for type
Name Type Description
value String Type

inherited setVisible(value){void}

modules/core/modelList/layer/model.js, line 773
Setter for the layer visibility
Name Type Description
value Boolean new visibility value

inherited setWindowsInterval(func, autorefreshInterval){void}

modules/core/modelList/layer/model.js, line 358
Setter of window interval. Binds this to func.
Name Type Description
func function Function, to be executed in this
autorefreshInterval integer Intervall in ms

showAllFeatures(){void}

modules/core/modelList/layer/geojson.js, line 733
sets undefined style for all features so the layer style will be used

showFeaturesByIds(featureIdList){void}

modules/core/modelList/layer/geojson.js, line 634
Filters the visibility of features by ids.
Name Type Description
featureIdList Array.<String> Feature ids to be shown.
Fires:

inherited showLayerInformation(){void}

modules/core/modelList/layer/model.js, line 545
Initiates the presentation of layer information.
Fires:

styling(isClustered){void}

modules/core/modelList/layer/geojson.js, line 371
Erzeugt den Style für Cluster und Einzel-Features mit Fallbacks.
Name Type Description
isClustered boolean Gibt an, ob Clustering aktiv ist.

inherited toggleAttributionsInterval(){void}

modules/core/modelList/layer/model.js, line 506
If attribution is defined as an object, then the attribution are requested in given intervals, as long as "isVisibleInMap" is true Is used for Verkehrslage auf den Autobahnen

inherited toggleIsSelected(){void}

modules/core/modelList/layer/model.js, line 410
Toggles the attribute isSelected. If the layer is a baselayer, the other selected baselayers are deselected.

inherited toggleIsSettingVisible(){void}

modules/core/modelList/layer/model.js, line 470
Toggles the attribute isSettingVisible

inherited toggleIsVisibleInMap(){void}

modules/core/modelList/layer/model.js, line 438
Toggles the attribute isVisibleInMap

inherited toggleLayerOnMap(){void}

modules/core/modelList/layer/model.js, line 484
Adds or removes layer from map, depending on attribute isSelected

inherited toggleWindowsInterval(){void}

modules/core/modelList/layer/model.js, line 453
Toggles the layer interval based on attribute isVisibleInMap The autoRefresh interval has to be >500 , because of performance issues

inherited updateLayerSource(){void}

modules/core/modelList/layer/model.js, line 782
refresh layerSource when updated e.g. needed because wmts source is created asynchronously

inherited updateLayerTransparency(){void}

modules/core/modelList/layer/model.js, line 531
Transforms transparency into opacity and sets opacity on layer

updateSource(showLoader){void}

modules/core/modelList/layer/geojson.js, line 133
Sends GET request with or without wfs parameter according to typ
Name Type Default Description
showLoader boolean false optional shows loader div

Events

inherited changeIsOutOfRange

devtools/jsdoc/events.js, line 398
Fired if attribute isOutOfRange has changed
Name Type Description
model Backbone.Model The model whose attribute hat changed.
value Boolean The attribute value that has changed.

inherited changeIsSelected

devtools/jsdoc/events.js, line 363
Fired if attribute isSelected has changed
Name Type Description
model Backbone.Model The model whose attribute hat changed.
value Boolean The attribute value that has changed.

inherited changeIsSettingVisible

devtools/jsdoc/events.js, line 384
Fired if attribute isSettingVisible has changed
Name Type Description
model Backbone.Model The model whose attribute hat changed.
value Boolean The attribute value that has changed.

inherited changeIsVisibleInMap

devtools/jsdoc/events.js, line 370
Fired if attribute isVisibleInMap has changed
Name Type Description
model Backbone.Model The model whose attribute hat changed.
value Boolean The attribute value that has changed.

inherited changeIsVisibleInTree

devtools/jsdoc/events.js, line 391
Fired if attribute isVisibleInTree has changed
Name Type Description
model Backbone.Model The model whose attribute hat changed.
value Boolean The attribute value that has changed.

inherited changeTransparency

devtools/jsdoc/events.js, line 377
Fired if attribute transparency has changed
Name Type Description
model Backbone.Model The model whose attribute hat changed.
value Boolean The attribute value that has changed.

inherited RadioRequestVectorLayerGetFeatures

devtools/jsdoc/events.js, line 439
Name Type Description
id String Id of vector layer.
Example
Radio.request("VectorLayer", "getFeatures", id)

inherited RadioTriggerLayerSetLayerInfoChecked

devtools/jsdoc/events.js, line 411
Name Type Description
value Boolean Flag that signs that the layer informations has been checked.
Example
Radio.trigger("Layer", "setLayerInfoChecked", value)

inherited RadioTriggerLayerUpdateLayerInfo

devtools/jsdoc/events.js, line 405
Name Type Description
name String The name of the layer.
Example
Radio.trigger("Layer", "updateLayerInfo", name)

inherited RadioTriggerVectorLayerFeaturesLoaded

devtools/jsdoc/events.js, line 417
Name Type Description
id String Id of vector layer.
features Array.<ol/Feature> Features that have been loaded.
Example
Radio.trigger("VectorLayer", "featuresLoaded", id, features)

inherited RadioTriggerVectorLayerFeatureUpdated

devtools/jsdoc/events.js, line 424
Name Type Description
id String Id of vector layer.
features Array.<ol/Feature> Features that have been loaded.
Example
Radio.trigger("VectorLayer", "featureUpdated", id, features)

inherited RadioTriggerVectorLayerResetFeatures

devtools/jsdoc/events.js, line 431
Triggers an event with the features that are shown. Used for updates in heatmap after filter.
Name Type Description
id String Id of vector layer.
features Array.<ol/Feature> Features that are visible.
Example
Radio.trigger("VectorLayer", "resetFeatures", id, features)