Class: Map

netgis.Map(config)

new Map(config)

Map Module Implementation for OpenLayers 3+.
Parameters:
Name Type Description
config JSON Map.Config
Map.Projections
Map.Layers
Map.Measure
Map.Tools
Map.Styles

Members

(static) Config

Config Section "map"
Properties:
Name Type Description
projection String Default map projection ID, see Projections
center Array Default center coordinates, [ x, y ]. Has no effect if default map "extent" given.
center_lonlat Array Default center coordinates in Longitude/Latitude, [ lon, lat ]. Has no effect if default map "extent" given. Has priority over "center".
zoom Number Default zoom level. Has no effect if initial map "extent" given.
min_zoom Number Minimum zoom level.
max_zoom Number Maximum zoom level.
extent Array Default map extent to zoom, [ minx, miny, maxx, maxy ]. Has priority over "center" and "zoom/scale" parameters. Some map contexts such as WMC may also contain a "bbox" parameter that will override this.
bbox Array Default map bounding box to zoom, [ minx, miny, maxx, maxy ]. Has priority over "extent", but has the same effect. Some map contexts such as WMC may also contain a "bbox" parameter that will override this.
scales Array Available scale denominators, [ 500, 1000, ... ]
scale Number Default scale denominator to zoom at startup. Has priority over "zoom". Has no effect if default map "extent" given.
scalebar Boolean Display a dynamic scalebar on the map

(static) Layers :Array

Config Section "layers"
  • Basic Layer Item Parameters:
    • "id": {String} Unique layer ID, see Layer IDs to avoid conflicts
    • "folder": {String} Parent folder ID or null for top level, see LayerTree.Folders
    • "title": {String} Layer title in the layer tree
    • "attribution": {String} Copyright string for the Attribution Module
    • "active": {Boolean} Layer is visible at startup
    • "order": {Number} Order value for map layer stack sorting
    • "type": {String} Layer type, see LayerTypes for more type specific parameters
  • Layer Display Parameters:
    • "min_zoom": {Number} Minimum zoom level for this layer
    • "max_zoom": {Number} Maximum zoom level for this layer
    • "transparency": {Number} Transparency value from 0.0 (fully opaque) to 1.0 (fully transparent)
    • "fill": {String} Fill color for simple vector style in CSS format
    • "stroke": {String} Stroke color for simple vector style in CSS format
    • "width": {Number} Stroke width for simple vector style in pixels
    • "style": {JSON} Advanced vector style parameters, see Map.Styles
  • Info Query Parameters (see Info Module):
    • "query": {Boolean} Enable info queries on this layer
    • "query_url": {String} Info service URL, may contain {x}, {y}, {bbox}, {proj}, {width}, {height}, {px}, {py} placeholders
Type:
  • Array

(static) Measure

Config Section "measure"
Properties:
Name Type Description
line_color String Line color in CSS format
line_width Number Line width in pixels
line_dash Array Line dash pattern [ SpaceWidth, LineWidth ]
area_fill String Area fill color in CSS format
point_radius Number Point radius in pixels
point_fill String Point fill color in CSS format
point_stroke String Point stroke color in CSS format
text_color String Text label color in CSS format
text_back String Text label buffer color in CSS format

(static) Projections :Array

Config Section "projections"
  • Projection Definitions:
    [ "ID", "Proj4 Definition" ]
Type:
  • Array

(static) Styles

Config Section "styles"
Common Parameters:
  • "fill": {String} Fill color in CSS format
  • "stroke": {String} Stroke color in CSS format
  • "width": {Number} Stroke width in pixels
  • "radius": {Number} Point radius in pixels
  • "viewport_labels": {Boolean} Try to keep text labels inside map view (experimental)
Properties:
Name Type Description
draw JSON Default draw feature style
non_edit JSON Default non-editable feature style
select JSON Default select feature style
sketch JSON Default draw sketch feature style
error JSON Default draw error style
bounds JSON Default edit boundary style
modify JSON Default feature modify style
parcel JSON Default parcels style
import JSON Default imported features style

(static) Tools

Config Section "tools"
Properties:
Name Type Description
editable Boolean Enable edit tools
output_id String Element ID for edit outputs (hidden storage input)
interactive_render Boolean Enable interactive rendering while editing
select_multi_reset Boolean Reset multi selection after each select action
buffer JSON Default buffer settings
  • "default_radius": {Number}
  • "default_segments": {Number}
snapping JSON Default snapping settings
  • "show": {Boolean}
  • "active": {Boolean}
  • "tolerance": {Number}
bounds String Boundary polygons for drawing tools in GeoJSON format (or leave undefined for no bounds checking)
bounds_message String Message to display if editing out of bounds
show_bounds Boolean Show boundary polygons on map