new MapBuilder()
- Source:
- MapBuilder.js, line 1
Members
-
<static, constant> CLASS_NAME :string
-
Current class name
- Source:
- MapBuilder.js, line 126
-
<static> this.called :object
-
Find if initialize methods have been used
- Source:
- MapBuilder.js, line 24
Properties:
Name Type Description setTarget
boolean Method setTarget() setView
boolean Method setView() setLayers
boolean Method setLayers() defineStyles
boolean Method defineStyles() setControls
boolean Method setControls() loadConfig
boolean Method loadConfig() setSecurity
boolean Method setSecurity() -
<static> this.configFile :boolean
-
Find if the configuration will be loaded from a file
- Source:
- MapBuilder.js, line 99
-
<static> this.configUrlOrJson :null|string|object
-
URL of JSON configuration file or object with configuration
- Source:
- MapBuilder.js, line 106
-
<static> this.controlsConfig :object|null
-
Configuration of controls object.
- Source:
- MapBuilder.js, line 84
-
<static> this.DEFAULT_LAYERS_CONFIG :Object
-
Standard configuration for layers
- Source:
- MapBuilder.js, line 52
Properties:
Name Type Description baseLayers
array Array with default baselayers configuration -
<static> this.DEFAULT_VIEW_CONFIG :object
-
Standard configuration for view object.
- Source:
- MapBuilder.js, line 41
Properties:
Name Type Description projection
string Default map projection. extent
array Default map extent. -
<static> this.div :string
-
ID of HTML-Element that contains the map.
- Source:
- MapBuilder.js, line 70
-
<static> this.layersConfig :object|null
-
Configuration of layers object.
- Source:
- MapBuilder.js, line 92
-
<static> this.map :ol.Map|null
-
OpenLayers map object.
- Source:
- MapBuilder.js, line 63
-
<static> this.viewConfig :object|null
-
Configuration of view object.
- Source:
- MapBuilder.js, line 77
-
controls :array|null
-
BKG WebMap controls
- Source:
- MapBuilder.js, line 118
-
styles :object|null
-
Object with style names and OpenLayers style classes.
- Source:
- MapBuilder.js, line 124
-
stylesArray :array
-
Array with styles configuration that will be used for vector layers
- Source:
- MapBuilder.js, line 112
Methods
-
create(callback) → {BKGWebMap.MapBuilder}
-
Creates the map with current configuration and returns MapBuilder object.
Parameters:
Name Type Description callback
createCallback Callback for getting ready map object. You can use it to change the map. - Source:
- MapBuilder.js, line 513
Returns:
- Type
- BKGWebMap.MapBuilder
-
defineStyles(stylesConfig) → {BKGWebMap.MapBuilder}
-
Parse styles used for vector layers
Parameters:
Name Type Description stylesConfig
Array.<symbol_style> | Array.<custom_style> Array with style configuration (/styles) - Source:
- MapBuilder.js, line 457
Returns:
- Type
- BKGWebMap.MapBuilder
-
getMap() → {ol.Map}
-
Getter: It returns the map object, but it is not ready with all elements. Better use the callback of create(): createCallback
- Source:
- MapBuilder.js, line 851
Returns:
- Type
- ol.Map
-
loadConfig(config) → {BKGWebMap.MapBuilder}
-
Parses a configuration JSON for BKG WebMap. It can be either the URL of a JSON file or the JSON itself.
Parameters:
Name Type Description config
string | object JSON or filename or JSON with BKG WebMap configuration. (/) - Source:
- MapBuilder.js, line 490
Returns:
- Type
- BKGWebMap.MapBuilder
-
setControls(controlsConfig) → {BKGWebMap.MapBuilder}
-
Parses the controls configuration which is used for creating the interactive control elements of the map when calling create.
Parameters:
Name Type Description controlsConfig
object Object with configuration parameters for controls. (/options) Properties
Name Type Description panelPosition
string Panel position (Values: "left", "right") (/options/panelPosition) initialize
string | null Tool that should be shown, when starting the Application. If empty or null, then panel will be closed. (Values: "geoSearch", "searchCoordinates", "layerSwitcher", "legend", "showAttributes", "copyCoordinates", "measure", "edit", "share") (/options/initialize) tools
object Tools in panel. (/options/tools) Properties
Name Type Description geoSearch
object Search a place through name. (/options/tools/geoSearch). See properties in geoSearch_options searchCoordinates
object Tools in panel. (/options/tools/searchCoordinates). See properties in searchCoordinates_options layerSwitcher
object Layer menu. (/options/tools/layerSwitcher). See properties in layerSwitcher_options customLayers
object User can add new layers. (/options/tools/customLayers). See properties in customLayers_options legend
object Show legend. (/options/tools/legend). See properties in legend_options showAttributes
object Show attributes with click on map. (/options/tools/showAttributes). See properties in showAttributes_options copyCoordinates
object Tool to copy coordinates. (/options/tools/copyCoordinates). See properties in copyCoordinates_options measure
object Measure tool. (/options/tools/measure). See properties in measure_options edit
object Edit vector layers tool. (/options/tools/edit). See properties in edit_options share
object Share map. (/options/tools/share). See properties in share_options zoom
object Zoom control. (/options/tools/zoom). See properties in zoom_options scalebar
object Scalebar control. (/options/tools/scalebar). See properties in scalebar_options copyright
object Copyright control. (/options/tools/copyright). See properties in copyright_options showCoordinates
object Show coordinates of cursor position. (/options/tools/showCoordinates). See properties in showCoordinates_options staticLinks
Array.<object> Static links on map. (/options/tools/staticLinks)
See properties of each Object in Array in staticLinks_optionsstaticWindows
Array.<object> Static windows on map. (/options/tools/staticWindows)
See properties of each Object in Array in staticWindows_optionsfullScreen
object Full screen tool. (/options/tools/fullScreen). See properties in fullScreen_options overviewMap
object Overview map tool. (/options/tools/overviewMap). See properties in overviewMap_options timeSlider
object Timeslider tool for WMS-T. (/options/tools/timeSlider). See properties in timeSlider_options - Source:
- MapBuilder.js, line 210
Returns:
- Type
- BKGWebMap.MapBuilder
-
setLayers(layersConfig) → {BKGWebMap.MapBuilder}
-
Parses layer configuration used for creating map layers when calling create.
Parameters:
Name Type Description layersConfig
object | array Object with configuration parameters for layers or array with ol.layer class. If OpenLayers classes are directly used, all layers are in basemaps group. (/layers) Properties
Name Type Description baseLayers
Array.<WMS> | Array.<WMTS> | Array.<WFS> | Array.<MARKER> | Array.<CSV> | Array.<XLS> | Array.<GPS> | Array.<BKG> | Array.<NONE> Base layers. The order of layers will be used in menu. The array can have any of the following layer definitions: WMS, WMTS, WFS, MARKER, CSV, XLS, GPS, BKG, NONE (/layers/baseLayers) overlays
Array.<WMS> | Array.<WMTS> | Array.<WFS> | Array.<MARKER> | Array.<CSV> | Array.<XLS> | Array.<GPS> | Array.<BKG> | Array.<GROUP> Layers and group of layers that will be loaded as overlays. The order of layers will be used in menu. The array can have any of the following layer definitions: WMS, WMTS, WFS, MARKER, CSV, XLS, GPS, BKG, GROUP (/layers/overlays) - Source:
- MapBuilder.js, line 420
Returns:
- Type
- BKGWebMap.MapBuilder
-
setSecurity(securityConfig) → {BKGWebMap.MapBuilder}
-
Parse configuration for security. Define cookieCheck and information about secure BKG Services.
Parameters:
Name Type Description securityConfig
object Security options. (/security) Properties
Name Type Description cookieCheck
boolean Should the application use cookie test. (/security/cookieCheck) UUID
string BKG UUID. (/security/UUID) appID
string BKG Application ID. (/security/appID) appDomain
string Domain for BKG Application ID. (/security/appDomain) - Source:
- MapBuilder.js, line 476
Returns:
- Type
- BKGWebMap.MapBuilder
-
setTarget(div) → {BKGWebMap.MapBuilder}
-
Sets the HTML-Element that contains the map
Parameters:
Name Type Description div
string ID of HMTL-Element that contains the map - Source:
- MapBuilder.js, line 140
Returns:
- Type
- BKGWebMap.MapBuilder
-
setView(viewConfig) → {BKGWebMap.MapBuilder}
-
Parse configuration for view. Parses the view configuration which is used for creating the map view when calling create.
Parameters:
Name Type Description viewConfig
object | ol.View Object with configuration parameters for view or ol.View class Properties
Name Type Description projection
string Map projection (/map/projection) center
object Initial center of map (The coordinate system is defined through the projection) (/map/center) Properties
Name Type Description lat
number Map center latitude. (/map/center/lat) lon
number Map center longitude. (/map/center/lon) resolution
number | null Initial resolution. If null, zoom will be used. (/map/resolution) resolutions
Array.<number> | null Array with numbers. If set, scales, maxResolution, minResolution, minZoom, and maxZoom are ignored. (/map/resolutions) scales
Array.<number> | null Array with numbers. It will be used only if resolutions is null. If set, maxResolution, minResolution, minZoom, and maxZoom are ignored. (/map/scales) zoom
integer | null Initial zoom. It will be used only if resolution is null. (/map/zoom) mapExtent
Array.<number> | null Initial map extent. Array with numbers: [minX, minY, maxX, maxY] (/map/mapExtent) maxResolution
number | null Maximum resolution. It will be used only if resolutions and scales are null. If null, maxZoom will be used. (/map/maxResolution) minResolution
number | null Minimum resolution. It will be used only if resolutions and scales are null. If null, minZoom will be used. (/map/minResolution) maxZoom
integer | null Maximum zoom. It will be used only if maxResolution, resolutions and scales are null. (/map/maxZoom) minZoom
integer | null Minimum zoom. It will be used only if minResolution, resolutions and scales are null. (/map/minZoom) - Source:
- MapBuilder.js, line 168
Returns:
- Type
- BKGWebMap.MapBuilder