ncmapapi v1.0.3
API Docs
Table of Contents
- loadConfig
- init
- serialize
- BaseMap
- BaseServer
- BaseWorkspace
- StreetViewUtils
- Cluster
- Heatmap
- POI
- utils
- Routing
- Nearest
loadConfig
This function loads map configuration.
Parameters
mapdiv
string html control for map to renderconfig
Object configuration jsonenvparameters
enparameters
array enviroment parameters (netgis session etc)
init
Initiliaze map object.
Parameters
mapdiv
string html control for map to rendermaptype
string map client (arcgis,mapbox,openlayers)opts
Object options
Returns Promise<Object> map promise;
serialize
serialize current map as a config JSON.
Parameters
map
Object mapboject
Returns Object JSON configuration;
BaseMap
Map object
on
Registers an event handler on the instance. Call this method to hook an event with a listener.
Parameters
name
string event name "featureclick", "markerclick","maxextentchange","markermouseover", "mapcleared","contextmenu","extentchanged","layervisibilitychanged","workspaceadded", "workspaceremoved","rendereradded","rendererremoved","widgetsloaded","layeradded","layerremoved"callback
function callback function
Returns string returns handle;
off
Unregisters an event handler on the instance.
Parameters
addWorkspace
Adds a workspace to the map (Netgis,Geoserver,Arcgis)
Parameters
Workspace
opts
Object optionsopts.setview
boolean set map view to workspace properties (center,zoom)
workspace
Object workspace object
Returns Promise<object> returns workspace promise;
addBaseLayer
Adds a baselayer to the map.
Parameters
getScale
Get current scale of the map.
Returns integer returns scale
getZoom
Get current zoom of the map.
Returns integer returns zoom
getResolution
Get current resolution of the map. Units can be set with SRS Code
Parameters
Returns integer returns resolution
getCurrentExtent
Get current extent of the map in GeoJSON with latitude,longitude .
Returns Object returns GeoJSON
edit
Edit a feature on the map.
Parameters
Returns Promise<object> returns promise of edited feature Edit can be cancaled with promise.cancel()
draw
Draw a feature on the map.
Parameters
opts
Object optionsopts.geometry
string geometry type of drawing polyline,point, rectangle,polygon
Returns Promise<object> returns promise of drawed feature Draw can be cancaled with promise.cancel()
addFeatures
Add features to the map.
Parameters
data
Object feature list to add. GeoJSON in latitude,longitude. May be an array , feature collection or feature.opts
Object options
Returns Promise<object> returns promise of added features.
addMarkers
Add markers to the map.
Parameters
data
Object feature list to add. GeoJSON in latitude,longitude. May be an array , feature collection or feature.opts
Object options
Returns Promise<object> returns promise of added markers.
clearHighlight
Clear highlighted items
highlightFeature
Highlight added features.
Parameters
opts
Object options
Returns Promise<object> returns promise of highlighted features.
setView
Set view of the map.
Parameters
opts
Object optionsopts.animate
boolean view set with animationopts.feature
Object feature to fit mapopts.zoom
integer zoom levelopts.center
array center latitude,longitudeopts.bounds
array bounding box latitude,longitude,latitude,longitude
removeWidget
Remove widgets from the map.
Parameters
addWidget
Add widgets to the map.
Parameters
opts
Object optionsopts.widgets
Array array of widgets to remove LayerList, Measurement, Draw, Print, BasemapGallery, Home, Swipe, Locate, AddDataSources
removeLayer
Remove layers from the map.
Parameters
addLayer
Add layers to the map.
Parameters
opts
Object optionsopts.type
string layer type WMS,WMTS,WFSopts.url
string layer urlopts.title
string layer titleopts.wkid
string layer epsg codeopts.listMode
boolean layer is displayed on layer manageropts.layers
array sub layers of the layeropts.activeLayer
string active sub layer of the WMTS layeropts.serviceMode
string service mode of WMTS KVP,Restopts.customParameters
string additional parameters
clear
Clear features and markers from the map.
Parameters
opts
Object options
refresh
Refresh map
Parameters
opts
Object options
BaseServer
Server object
Parameters
props
Object properties
getWorkspace
src/Server/serverbase.js:20-23
Get workspace from the server
Parameters
wsname
string workspace name
Returns Promise<object> returns promise of workspace.
BaseWorkspace
src/Workspace/WorkspaceBase.js:5-46
Server object
geometryFilter
src/Workspace/WorkspaceBase.js:26-29
Filter a layer by geometry
Parameters
feature
Object feature used for filtering GeoJSON in latitude,longitude.layername
string layer to filter data.options
Object options
Returns Promise<Object> returns promise of filtered features.
getFad
src/Workspace/WorkspaceBase.js:36-37
Get FAD of category (Netgis)
Parameters
categoryname
string category name
Returns string FAD of category
getCategoryData
src/Workspace/WorkspaceBase.js:43-44
Get category data (Netgis)
Parameters
categoryname
string category name
Returns Promise<Object> returns promise of category data.
StreetViewUtils
src/Utils/StreetViewUtils/index.js:7-86
Street Imagery Utility Class
Parameters
props
Object properties
setStreetViewLocation
src/Utils/StreetViewUtils/index.js:33-37
Select street imagery location on map
Parameters
Returns Promise<Object> returns clicked coordinates
relocateMap
src/Utils/StreetViewUtils/index.js:62-65
Recenter map by position
Parameters
position
array position latitude,longitude
setPov
src/Utils/StreetViewUtils/index.js:70-74
Set pov data on street imagery feature.
Parameters
opts
opt
array options
clear
src/Utils/StreetViewUtils/index.js:79-82
Clear map of street imagery feature.
Cluster
src/Renderers/Cluster/index.js:7-76
Cluster Renderer Class
Parameters
props
Object properties
set
src/Renderers/Cluster/index.js:36-41
Set renderer layer properties
Parameters
opts
Object options
get
src/Renderers/Cluster/index.js:47-50
Get renderer layer properties
Parameters
opts
Object options
clear
src/Renderers/Cluster/index.js:55-58
Remove render layer from map.
render
src/Renderers/Cluster/index.js:70-73
Render Cluster layer on the map
Parameters
opts
Object options
Heatmap
src/Renderers/Heatmap/index.js:8-74
Heatmap Renderer Class
Parameters
props
Object properties
set
src/Renderers/Heatmap/index.js:36-41
Set renderer layer properties
Parameters
opts
Object options
get
src/Renderers/Heatmap/index.js:47-50
Get renderer layer properties
Parameters
opts
Object options
clear
src/Renderers/Heatmap/index.js:55-58
Remove render layer from map.
render
src/Renderers/Heatmap/index.js:69-72
Render Heatmap layer on the map
Parameters
opts
Object options
POI
src/Renderers/POI/index.js:7-109
POI Renderer Class
Parameters
props
Object properties
set
src/Renderers/POI/index.js:33-36
Set renderer layer properties
Parameters
opts
Object options
get
src/Renderers/POI/index.js:42-45
Get renderer layer properties
Parameters
opts
Object options
clear
src/Renderers/POI/index.js:50-53
Remove render layer from map.
on
src/Renderers/POI/index.js:62-65
Registers an event handler on the instance. Call this method to hook an event with a listener.
Parameters
Returns string returns handle;
setPopupURL
src/Renderers/POI/index.js:71-74
Set Pop up URL to show on click
Parameters
off
src/Renderers/POI/index.js:81-84
Unregisters an event handler on the instance.
Parameters
getIconSet
src/Renderers/POI/index.js:90-93
Get Icon set to render
Parameters
iconset
Object icon set object that holds <poifield, icon url>style
Object optional style for poi features
render
src/Renderers/POI/index.js:105-108
Render Cluster layer on the map
Parameters
opts
Object options
utils
getBufferPolygon
Parameters
coord
array coordinatesres
integer resolution factorepsgcode
string EPSG codewswkt
buffer
integer additional bufferwkt
string wkt
Returns Object returns geoJSON polygon
getBounds
Parameters
Returns Object returns geoJSON polygon
getNetgisGML
Parameters
geometry
Object coordinate array of boundsEpsgCode
string projection epsg codewswkt
string projection description in wktreverse
Returns string returns Netgis gml
getGeojsontoGML
src/Utils/netgisgml.js:292-329
Parameters
response
string GML responsesrsName
string projection epsg codeprojectionopts
Object projection options
Returns string returns Netgis GeoJSON string
to4326
src/Utils/netgisgml.js:338-353
Parameters
Returns array returns coordinates in latitude,longitude
from4326
src/Utils/netgisgml.js:362-378
Parameters
Returns array returns coordinates in projection
Routing
src/Services/RoutingService/index.js:7-137
Netgis Routing Client
Parameters
opts
Object properties
findPath
src/Services/RoutingService/index.js:51-62
Parameters
start
array start coordinates in latitude,longitudeend
array end coordinates in latitude,longitudeopts
Object options
Returns Object returns route features;
addtoMap
src/Services/RoutingService/index.js:67-135
Parameters
features
Object add routing features to map
Nearest
src/Services/NearestService/index.js:7-137
Netgis Nearest Client
Parameters
props
Object properties
findNearest
src/Services/NearestService/index.js:54-71
Parameters
Returns Object returns nearest features;
addtoMap
src/Services/NearestService/index.js:76-135
Parameters
features
Object add routing features to mapendfeature
opts