import LayerBaseVectorGeoJson from 'webmapsjs/src/layers/LayerBaseVectorGeoJson.js'
LayerBaseVectorGeoJson
Extends:
Direct Subclass:
The Vector GeoJson Layer
Constructor Summary
Public Constructor | ||
public |
constructor(url: string | undefined | null, options: object) |
Method Summary
Public Methods | ||
public |
addFeatures(featureCollection: object) add feature collection |
|
public |
callback function on map move |
Protected Methods | ||
protected |
trigger load features |
Inherited Summary
From class LayerBase | ||
public get |
get the legend content |
|
public get |
Check if the layer is loaded |
|
public get |
maxResolution: number | * get the maximum resolution |
|
public get |
get max zoom |
|
public get |
minResolution: number | * get the minimum resolution |
|
public get |
get min zoom |
|
public get |
Get the layer name |
|
public set |
set the layer name |
|
public get |
|
|
public get |
Get the layer opacity |
|
public set |
Set the layer opacity |
|
public get |
get the map get params |
|
public get |
source: * get the layer source |
|
public get |
get the url |
|
public get |
Get the layer visibility |
|
public set |
Set the layer visibility |
|
public get |
get the z index |
|
public set |
set the z index |
|
protected set |
legendContent(newVal: string): * set the legend content directly |
|
protected set |
set the map get params |
|
public |
|
|
public |
id: * |
|
public |
loadCallback: * |
|
protected |
_olLayer: * |
|
public |
addLegendContent(additionalContent: string) add additional content to the legend |
|
public |
applyCollapse(): * |
|
public |
Get the legend html, be sure to only add to the DOM once |
|
public |
refresh() trick to refresh the layer |
|
protected |
base load function, sets _loaded = true if it is not already |
From class LayerBaseVector | ||
public get |
get if the layer is autoloaded |
|
public get |
array of ol features |
|
public get |
get the map CRS if it is defined by the map move object |
|
public get |
mapMove: MapMoveCls | * get the map move object |
|
public get |
map move params |
|
public get |
|
|
public get |
onDemandDelay: number | * get on demand delay in miliseconds |
|
public get |
source: ol.source.Vector get the layer vector source |
|
public get |
style: ol.Style | styleFunc get the style definition |
|
public set |
style(style: ol.Style | styleFunc): * set the style |
|
public get |
Get the layer visibility |
|
public set |
Set the layer visibility |
|
public |
addFeatures(featureCollection: object) dummy to be overridden |
|
public |
clear() clear features in the layer |
|
public |
mapMoveBefore(zoom: number, evtType: string): boolean Before call to map move callback, can prevent call by returning false |
|
public |
callback function on map move |
|
public |
mapMoveMakeGetParams(extent: object, zoomLevel: number) callback to generate the parameters passed in the get request |
Public Constructors
public constructor(url: string | undefined | null, options: object) source
Override:
LayerBaseVector#constructorParams:
Name | Type | Attribute | Description |
url | string | undefined | null | resource url, set to '' to make blank layer |
|
options | object | config |
|
options.id | string |
|
layer id |
options.name | string |
|
Layer] - layer name |
options.opacity | number |
|
opacity |
options.visible | boolean |
|
default visible |
options.minZoom | number |
|
min zoom level, 0 - 28 |
options.maxZoom | number |
|
max zoom level, 0 - 28 |
options.params | object |
|
the get parameters to include to retrieve the layer |
options.zIndex | number |
|
the z index for the layer |
options.loadCallback | function |
|
function to call on load, context this is the layer object |
options.legendCollapse | boolean |
|
if the legend item should be initially collapsed |
options.legendCheckbox | boolean |
|
if the legend item should have a checkbox for visibility |
options.legendContent | boolean |
|
additional content to add to the legend |
options.autoLoad | boolean |
|
if the layer should auto load if not visible |
options.style | object |
|
the layer style, use openlayers default style if not defined |
options.onDemand | boolean |
|
if the layer should be loaded by extent on map move |
options.onDemandDelay | number |
|
delay before the map move callback should be called |
options.transform | object |
|
SR transform, set as false for no transform |
options.transform.dataProjection | string |
|
the data CRS |
options.transform.featureProjection | string |
|
the feature/map CRS |
options.mapMoveMakeGetParams | mapMoveMakeGetParams |
|
extent, zoomLevel){}] function to create additional map move params |
options.mapMoveObj | MapMoveCls |
|
alternate map move object for use with multi map pages |
Public Methods
public addFeatures(featureCollection: object) source
add feature collection
Override:
LayerBaseVector#addFeaturesParams:
Name | Type | Attribute | Description |
featureCollection | object | as geojson object |
public mapMoveCallback(d: object) source
callback function on map move
Override:
LayerBaseVector#mapMoveCallbackParams:
Name | Type | Attribute | Description |
d | object | the json response |