1.0.3 • Published 3 years ago

ncmapapi v1.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

API Docs

Table of Contents

loadConfig

index.js:26-151

This function loads map configuration.

Parameters

  • mapdiv string html control for map to render
  • config Object configuration json
  • envparameters
  • enparameters array enviroment parameters (netgis session etc)

init

src/Map/index.js:32-64

Initiliaze map object.

Parameters

  • mapdiv string html control for map to render
  • maptype string map client (arcgis,mapbox,openlayers)
  • opts Object options
    • opts.lng string language code
    • opts.lngresources Object i18n resource JSON object.
    • opts.d3 boolean renders 3d map for Arcgis JS

Returns Promise<Object> map promise;

serialize

src/Map/index.js:70-73

serialize current map as a config JSON.

Parameters

Returns Object JSON configuration;

BaseMap

src/Map/mapbase.js:4-192

Map object

on

src/Map/mapbase.js:24-27

Registers an event handler on the instance. Call this method to hook an event with a listener.

Parameters

Returns string returns handle;

off

src/Map/mapbase.js:33-33

Unregisters an event handler on the instance.

Parameters

addWorkspace

src/Map/mapbase.js:41-41

Adds a workspace to the map (Netgis,Geoserver,Arcgis)

Parameters

  • Workspace
  • opts Object options
    • opts.setview boolean set map view to workspace properties (center,zoom)
  • workspace Object workspace object

Returns Promise<object> returns workspace promise;

addBaseLayer

src/Map/mapbase.js:47-47

Adds a baselayer to the map.

Parameters

getScale

src/Map/mapbase.js:52-52

Get current scale of the map.

Returns integer returns scale

getZoom

src/Map/mapbase.js:57-57

Get current zoom of the map.

Returns integer returns zoom

getResolution

src/Map/mapbase.js:65-65

Get current resolution of the map. Units can be set with SRS Code

Parameters

Returns integer returns resolution

getCurrentExtent

src/Map/mapbase.js:70-70

Get current extent of the map in GeoJSON with latitude,longitude .

Returns Object returns GeoJSON

edit

src/Map/mapbase.js:78-78

Edit a feature on the map.

Parameters

Returns Promise<object> returns promise of edited feature Edit can be cancaled with promise.cancel()

draw

src/Map/mapbase.js:87-87

Draw a feature on the map.

Parameters

Returns Promise<object> returns promise of drawed feature Draw can be cancaled with promise.cancel()

addFeatures

src/Map/mapbase.js:98-98

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
    • opts.style Object style definition of the features. Default style is used if not provided.
    • opts.showpopup boolean shows popup on feature click
    • opts.zoomto boolean zooms to features bounding box.
    • opts.persist boolean do not clear items if new features are added.

Returns Promise<object> returns promise of added features.

addMarkers

src/Map/mapbase.js:110-110

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
    • opts.markerurl Object marker image url.
    • opts.showpopup boolean shows popup on feature click
    • opts.zoomto boolean zooms to markers bounding box.
    • opts.persist boolean do not clear items if new markers are added.
    • opts.cluster boolean group markers based on distance

Returns Promise<object> returns promise of added markers.

clearHighlight

src/Map/mapbase.js:114-114

Clear highlighted items

highlightFeature

src/Map/mapbase.js:123-123

Highlight added features.

Parameters

  • opts Object options
    • opts.feature Object feature to highlight.
    • opts.field string key of the feature kvp to hightlight
    • opts.value string value of the feature kvp to hightlight

Returns Promise<object> returns promise of highlighted features.

setView

src/Map/mapbase.js:133-133

Set view of the map.

Parameters

removeWidget

src/Map/mapbase.js:139-139

Remove widgets from the map.

Parameters

  • opts Object options
    • opts.widgets Array array of widgets to remove

addWidget

src/Map/mapbase.js:156-156

Add widgets to the map.

Parameters

removeLayer

src/Map/mapbase.js:162-162

Remove layers from the map.

Parameters

  • opts Object options
    • opts.layer Array layer object to remove

addLayer

src/Map/mapbase.js:176-176

Add layers to the map.

Parameters

  • opts Object options
    • opts.type string layer type WMS,WMTS,WFS
    • opts.url string layer url
    • opts.title string layer title
    • opts.wkid string layer epsg code
    • opts.listMode boolean layer is displayed on layer manager
    • opts.layers array sub layers of the layer
    • opts.activeLayer string active sub layer of the WMTS layer
    • opts.serviceMode string service mode of WMTS KVP,Rest
    • opts.customParameters string additional parameters

clear

src/Map/mapbase.js:182-182

Clear features and markers from the map.

Parameters

refresh

src/Map/mapbase.js:190-190

Refresh map

Parameters

  • opts Object options
    • opts.workspace Object workspace to refresh
      • opts.workspace.name string workspace name to refresh

BaseServer

src/Server/serverbase.js:4-26

Server object

Parameters

getWorkspace

src/Server/serverbase.js:20-23

Get workspace from the server

Parameters

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

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

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

set

src/Renderers/Cluster/index.js:36-41

Set renderer layer properties

Parameters

get

src/Renderers/Cluster/index.js:47-50

Get renderer layer properties

Parameters

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
    • opts.maxClusterRadius integer maximum radius of cluster feature in px
    • opts.minClusterRadius integer minimum radius of cluster feature in px
    • opts.wkt string projection wkt
    • opts.code string projection code
    • opts.Cluster Object cluster features
    • opts.colors array color set for cluster features

Heatmap

src/Renderers/Heatmap/index.js:8-74

Heatmap Renderer Class

Parameters

set

src/Renderers/Heatmap/index.js:36-41

Set renderer layer properties

Parameters

get

src/Renderers/Heatmap/index.js:47-50

Get renderer layer properties

Parameters

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
    • opts.blurRadius integer radius of blur of the features in px
    • opts.blur boolean toggle blur of the heatmap features
    • opts.wkt string projection wkt
    • opts.code string projection code
    • opts.Cluster Object heatmap features
    • opts.colors array color set for heatmap features

POI

src/Renderers/POI/index.js:7-109

POI Renderer Class

Parameters

set

src/Renderers/POI/index.js:33-36

Set renderer layer properties

Parameters

get

src/Renderers/POI/index.js:42-45

Get renderer layer properties

Parameters

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
    • opts.popupEnabled boolean flag to show pop up on click
    • opts.poifield string poi category key
    • opts.wkt string projection wkt
    • opts.code string projection code
    • opts.features Object features to add
    • opts.cluster boolean cluster features together
    • opts.colors array color set for cluster features

utils

src/Utils/netgisgml.js:12-22

getBufferPolygon

src/Utils/netgisgml.js:33-51

Parameters

  • coord array coordinates
  • res integer resolution factor
  • epsgcode string EPSG code
  • wswkt
  • buffer integer additional buffer
  • wkt string wkt

Returns Object returns geoJSON polygon

getBounds

src/Utils/netgisgml.js:58-90

Parameters

  • bounds array coordinate array of bounds
  • wkid string epsg code

Returns Object returns geoJSON polygon

getNetgisGML

src/Utils/netgisgml.js:98-163

Parameters

  • geometry Object coordinate array of bounds
  • EpsgCode string projection epsg code
  • wswkt string projection description in wkt
  • reverse

Returns string returns Netgis gml

getGeojsontoGML

src/Utils/netgisgml.js:292-329

Parameters

  • response string GML response
  • srsName string projection epsg code
  • projectionopts Object projection options
    • projectionopts.wkt string projection description in wkt
    • projectionopts.code string projection code

Returns string returns Netgis GeoJSON string

to4326

src/Utils/netgisgml.js:338-353

Parameters

  • latlng array coordinates
  • projectionopts Object projection options
    • projectionopts.wkt string projection description in wkt
    • projectionopts.code string projection code

Returns array returns coordinates in latitude,longitude

from4326

src/Utils/netgisgml.js:362-378

Parameters

  • latlng array coordinates
  • projectionopts Object projection options
    • projectionopts.wkt string projection description in wkt
    • projectionopts.code string projection code

Returns array returns coordinates in projection

Routing

src/Services/RoutingService/index.js:7-137

Netgis Routing Client

Parameters

findPath

src/Services/RoutingService/index.js:51-62

Parameters

  • start array start coordinates in latitude,longitude
  • end array end coordinates in latitude,longitude
  • opts 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

findNearest

src/Services/NearestService/index.js:54-71

Parameters

  • start array start coordinates in latitude,longitude
  • opts Object options

Returns Object returns nearest features;

addtoMap

src/Services/NearestService/index.js:76-135

Parameters

  • features Object add routing features to map
  • endfeature
  • opts