GotMap-1.7.0.js
Namespace: GotMapMain GotMap file contains functionality for instansiating the map, managing layers and events
Added/Updated functionality
- - Removed option useViewPortCulling from GeoJsonManager.AddLayer
- - Added option GotMapEngine.Options.EnableViewPortCulling Enables culling of all features outside of mapbounds on GeoJSON layers
- - Added function LayerManager.ReRenderLayersByZindex Rerenders all layers in correct zindex order(the order they are added to gotmap)
- - Added option GotMapEngine.Options.EnableConsoleLogging Enables/Disables logging to console when using GotMapEngine.GotMap.WriteToConsole
- - Added function GotMapEngine.GotMap.WriteToConsole Writes logg messages to the console if the option EnableConsoleLogging is set to true
GotMapEngine
Object GotMapEngineLocation: \GotMap-1.7.0.js, line: 97
Container for all gotmap functionality, e.g. the namespace
Requires:- jquery-1.10.2.js or higher version http://jquery.com/
- leaflet.js version 0.7.3 http://leafletjs.com/download.html
- leaflet-button-control.js https://gist.github.com/ns-1m/2935530
- leaflet-goggle.js
- jsTree.js version 3.1.1 https://www.jstree.com/
TileLayerDefinitions
Object GotMapEngine.TileLayerDefinitionsLocation: \GotMap-1.7.0.js, line: 151
Container for the predefined baselayers
Properties
Name | Datatype | Description |
---|---|---|
OpenStreetMap | GotMapEngine.ObjectDefinitions.TileLayerDefinition | OpenStreetMap |
Cycle | GotMapEngine.ObjectDefinitions.TileLayerDefinition | Cycle |
Transport | GotMapEngine.ObjectDefinitions.TileLayerDefinition | Transport |
Landscape | GotMapEngine.ObjectDefinitions.TileLayerDefinition | Landscape |
Outdoors | GotMapEngine.ObjectDefinitions.TileLayerDefinition | Outdoors |
TransportDark | GotMapEngine.ObjectDefinitions.TileLayerDefinition | TransportDark |
SpinalMap | GotMapEngine.ObjectDefinitions.TileLayerDefinition | SpinalMap |
ControlPositions
Object GotMapEngine.ControlPositionsLocation: \GotMap-1.7.0.js, line: 207
Control positions (map corner to put a control to)
Properties
Name | Datatype | Description |
---|---|---|
TopLeft | string | Top left of the map. |
TopRight | string | Top right of the map. |
BottomLeft | string | Bottom left of the map. |
BottomRight | string | Bottom right of the map. |
Options
Object GotMapEngine.OptionsLocation: \GotMap-1.7.0.js, line: 228
Container for the map settings, all map instanses get their own deep copy of this when they are created
Properties
Name | Datatype | Description |
---|---|---|
DivId | string | READONLY Id of the div in which the map is displayed |
IconRootUrl | string | http url pointing to the location of default icons |
Mapengine | string | The background map layer |
DefaultLat | double | Latitude coordinate of the maps center point upon creation |
DefaultLng | double | longitude coordinate of the maps center point upon creation |
DefaultZoom | int | The zoom level the map will have upon creation |
MaxZoomLevel | int | The maximul allowed level to zoom to (only editable before creation) |
DisableClusteringAtZoom | int | Sets the zoom level att which to show the geometrys instad of the cluster groups, set it to 0 to disable clustering. |
MaxClusterRadius | int | The maximum radius that a cluster will cover from the central marker (in pixels). |
UseOpenStreetMapAsBaseLayer | bool | Sets whether to use openstreetmap as baselayer (default true) |
EnableViewPortCulling | bool | Sets whether to use viewportculling (on GeoJSON layers, default false) |
EnableConsoleLogging | bool | Sets whether to print loggmessages in the console (default false) |
MarkerOptions
Object GotMap.Options.MarkerOptionsLocation: \GotMap-1.7.0.js, line: 259
Container for the marker options
Properties
Name | Datatype | Description |
---|---|---|
IconUrl | string | The name of the marker icon to use when drawing (the icon must be placed in the defined IconRootUrl in the Options) |
IconSize | Array | An array containing width and height of the icon image ex:[25, 41] |
IconAnchor | Array | An array containing the x and y cordinates of where the point of the marker icon is located. ex:[12, 41] |
PopupAnchor | Array | An array containing the x and y cordinates of where the popup should be located |
ShadowIconUrl | string | The name of the marker shadow icon to use when drawing (the icon must be placed in the defined IconRootUrl in the Options) |
ShadowSize | Array | An array containing width and height of the shadow icon image ex:[25, 30] |
ShadowAnchor: | Array | An array containing the x and y cordinates of where the point of the marker shadow icon is located. ex:[7, 30] |
Draggable | bool | Sets whether the marker should be draggable or not |
Style
Object GotMap.Options.StyleLocation: \GotMap-1.7.0.js, line: 283
Container for the default Style, full use of SVG styling is avalible for more information. See: http://www.w3.org/TR/SVG/styling.html
NOTE: All SVG style options are not implemented into the geojson styling!
Properties
Name | Datatype | Description |
---|---|---|
color | string | The default color of the drawn lines, polygons, circles and rectangles |
opacity | double | The opacity of polygons, circles and rectangles outlining |
fillColor | string | The color of the inside of polygons, circles and rectangles |
fillOpacity | string | The opacity of the inside polygons, circles and rectangles |
radius | int | The radius of a circle marker |
weight | int | The stroke width in pixels. |
DrawOptions
Object GotMap.Options.DrawOptionsLocation: \GotMap-1.7.0.js, line: 342
Container for the draw settings
Properties
Name | Datatype | Description |
---|---|---|
Positions | string | Defines where the draw controls will be placed (Use GotMapEngine.ControlPositions) |
Line | bool | Enables / Disables the line drawing control |
Polygon | bool | Enables / Disables the polygon drawing control |
AllowIntersection | bool | Flags whether to allow line intersections or not when drawing a polygon |
Marker | bool | Enables / Disables the marker drawing control |
IconUrl | string | Icon to use when drawing markers |
Circle | bool | Enables / Disables the circle drawing control |
StaticRadiusCircle | bool | Enables / Disables Disables dynamic radius in the circle draw tool, uses the CircleRadius option to determin the radius of the drawn circle |
Edit | bool | Enables / Disables the edit control |
Remove | bool | Enables / Disables the remove control, NOTE: Edit must be enabled when enabling Remove |
Color | string | The default color of the drawn lines, polygons, circles and rectangles |
Opacity | double | The opacity of polygons, circles and rectangles outlining |
FillColor | string | The color of the inside of polygons, circles and rectangles |
FillOpacity | double | The opacity inside of the polygons, circles and rectangles |
Weight | int | The thickness of the border |
CircleRadius | int | The radius of the circle |
RestrictionAreaColor | string | The border color of the restriction area polygon |
RestrictionAreaFillColor | string | The color outside of the restriction area polygon |
RestrictionAreaFillOpacity | double | The opacity outside of the restriction area polygon |
ScaleToolOptions
Object GotMapEngine.Options.ScaleToolOptionsLocation: \GotMap-1.7.0.js, line: 371
Container for the scale tool options
Properties
Name | Datatype | Description |
---|---|---|
Enable | bool | Enables / Disables the tool |
Positions | string | Defines where the tool will be placed (Use GotMapEngine.ControlPositions) |
Maximum | int | width of the control in pixels. The width is set dynamically to show round values (e.g. 100, 200, 500) |
Metric | bool | Whether to show the metric scale line (m/km). |
Imperial | bool | Whether to show the imperial scale line (mi/ft). |
TileLayerDefinitions
Object GotMapEngine.Options.TileLayerDefinitionsLocation: \GotMap-1.7.0.js, line: 388
Container for the added tilelayers.
All layerdefinitions added to this before instantiation of the map will be automaticly added to the map.
ee TileLayerDefinition for more info.
WmsLayerDefinitions
Object GotMapEngine.Options.WmsLayerDefinitionsLocation: \GotMap-1.7.0.js, line: 394
Container for the added wmslayers.
All layerdefinitions added to this before instantiation of the map will be automaticly added to the map.
See WmsLayerDefinition for more info.
GotMap
function GotMapEngine.GotMapLocation: \GotMap-1.7.0.js, line: 405
Constructor for GotMap
Parameters
Name | Datatype | Description |
---|---|---|
divId | string | The div in which the map will be displayed |
AddLegend
function GotMapEngine.GotMap.AddLegendLocation: \GotMap-1.7.0.js, line: 448
Adds a legend container to the map.
Parameters
Name | Datatype | Description |
---|---|---|
content | string | The Html which will be shown inside the legend container. |
options | Object | An object containing varius alternativs for the function. |
Options
Name | Datatype | Description |
---|---|---|
position | GotMapEngine.ControlPositions | Defines which corner to place the legend. See ControlPositions |
className | string | The name of the css class for the container. |
AddFindMeControl
function GotMapEngine.GotMap.AddFindMeControlLocation: \GotMap-1.7.0.js, line: 472
Adds a find me button control to the map.
Parameters
Name | Datatype | Description |
---|---|---|
options | Object | An object containing varius alternativs for the function. |
Options
Name | Datatype | Description |
---|---|---|
zoomLevel | int | Index of the zoom level to zoom to |
animate | bool | OPTIONAL Default false, Animates the paning |
setMarker | bool | OPTIONAL Default false, sets a marker on your position |
position | GotMapEngine.ControlPositions | Defines which corner to place the addfindmecontrol. See ControlPositions |
AddMenuControl
function GotMapEngine.GotMap.AddMenuControlLocation: \GotMap-1.7.0.js, line: 496
Adds a hamburgermenu control to GotMap
Parameters
Name | Datatype | Description |
---|---|---|
options | Object | An object containing varius alternativs for the function. |
Options
Name | Datatype | Description |
---|---|---|
menu | GotMapEngine.GotMap.ObjectDefinitions.MenuDefinition | See Menu for more info. |
AddMenuContent
function GotMapEngine.GotMap.AddMenuContentLocation: \GotMap-1.7.0.js, line: 510
Adds content to the menu sidepanel
Parameters
Name | Datatype | Description |
---|---|---|
content | string | The content to att the the menu, can be html or text |
AddStreetSearchControl
function GotMapEngine.GotMap.AddStreetSearchControlLocation: \GotMap-1.7.0.js, line: 527
Adds a street search field control to the ma.p
Uses http://geocoder.tkgbg.se/ to find streets and addresses in Gothenburg.
- jquery-ui-1.11.3.js http://jqueryui.com/
Parameters
Name | Datatype | Description |
---|---|---|
options | Object | An object containing varius alternativs for the function. |
Options
Name | Datatype | Description |
---|---|---|
position | GotMapEngine.ControlPositions | Which corner to place the control (default topleft). |
highlightSearchResult | bool | Flag whether to show the serach result as lines and markers in the map, default true. |
useMarkers | bool | Flag whether to use markers when highligting search result, will render points as circles if false, default false. |
AddMeasureControl
function GotMapEngine.GotMap.AddMeasureControlLocation: \GotMap-1.7.0.js, line: 548
Adds a measure tool to the map
Requires:- leaflet.measurecontrol.js https://github.com/makinacorpus/Leaflet.MeasureControl
- leaflet.draw.js https://github.com/Leaflet/Leaflet.draw
Parameters
Name | Datatype | Description |
---|---|---|
options | Object | An object containing varius alternativs for the function. |
Options
Name | Datatype | Description |
---|---|---|
position | GotMapEngine.ControlPositions | Defines which corner to place the legend. See ControlPositions |
AddScaleControl
function GotMapEngine.GotMap.AddScaleControlLocation: \GotMap-1.7.0.js, line: 600
Adds a scale control to the map
Parameters
Name | Datatype | Description |
---|---|---|
options | Object | An object containing varius alternativs for the function. |
Options
Name | Datatype | Description |
---|---|---|
position | Options.ScaleToolOptions.Position | Which corner to place the control |
maxWidth | Options.ScaleToolOptions.MaxWidth | What size of the scale control |
metric | Options.ScaleToolOptions.Metric | Flag for showing metric |
imperial | Options.ScaleToolOptions.Imperial | Flag for showing imperial |
AddLayerToLayersControl
function GotMapEngine.GotMap.AddLayerToLayersControlLocation: \GotMap-1.7.0.js, line: 615
Adds a layer to the layercontrol
Parameters
Name | Datatype | Description |
---|---|---|
layerName | string | The name of the layer |
AddInformationToLayersControl
function GotMapEngine.GotMap.AddInformationToLayersControlLocation: \GotMap-1.7.0.js, line: 624
Adds information to the layer control
Parameters
Name | Datatype | Description |
---|---|---|
information | string | The information to display anny html works |
ClearInformationInLayersControl
function GotMapEngine.GotMap.ClearInformationInLayersControlLocation: \GotMap-1.7.0.js, line: 631
Clears all information in the layercontrol
RemoveLayerFromLayersControl
function GotMapEngine.GotMap.RemoveLayerFromLayersControlLocation: \GotMap-1.7.0.js, line: 639
Adds a layer to the layercontrol
Parameters
Name | Datatype | Description |
---|---|---|
layerName | string | The name of the layer |
RestackFindMeControl
function GotMapEngine.GotMap.RestackFindMeControlLocation: \GotMap-1.7.0.js, line: 647
Controls are stacked from the corner set in their position, this readds the control to the map so it sits last in the control stack
RestackMenuControl
function GotMapEngine.GotMap.RestackMenuControlLocation: \GotMap-1.7.0.js, line: 657
Controls are stacked from the corner set in their position, this readds the control to the map so it sits last in the control stack
RestackMeasureControl
function GotMapEngine.GotMap.RestackMeasureControlLocation: \GotMap-1.7.0.js, line: 667
Controls are stacked from the corner set in their position, this readds the control to the map so it sits last in the control stack
RestackScaleControl
function GotMapEngine.GotMap.RestackScaleControlLocation: \GotMap-1.7.0.js, line: 677
Controls are stacked from the corner set in their position, this readds the control to the map so it sits last in the control stack
RestackZoomControl
function GotMapEngine.GotMap.RestackZoomControlLocation: \GotMap-1.7.0.js, line: 687
Controls are stacked from the corner set in their position, this readds the control to the map so it sits last in the control stack
RestackLayersControl
function GotMapEngine.GotMap.RestackLayersControlLocation: \GotMap-1.7.0.js, line: 696
Controls are stacked from the corner set in their position, this readds the control to the map so it sits last in the control stack
AddPopupToFeature
function GotMapEngine.GotMap.AddPopupToFeatureLocation: \GotMap-1.7.0.js, line: 710
Adds a popup to a specific feature
Parameters
Name | Datatype | Description |
---|---|---|
feature | Object | The feature to wich the pop will be added |
popupContent | string | Html formated content to add to the popup |
options | Object | An object containing varius alternativs for the function. |
Options
Name | Datatype | Description |
---|---|---|
openPopup | bool | OPTIONAL Whether the popup should be opened |
GetZoom
function GotMapEngine.GotMap.GetZoomLocation: \GotMap-1.7.0.js, line: 722
Fetches the maps current zoom level index
Returns: int Index of the maps current zoom level
SetZoom
function GotMapEngine.GotMap.SetZoomLocation: \GotMap-1.7.0.js, line: 729
Zooms the map to a desired zoom level
Parameters
Name | Datatype | Description |
---|---|---|
zoomLevel | int | Index of the desired zoom level |
ZoomPanToLatLng
function GotMapEngine.GotMap.ZoomPanToLatLngLocation: \GotMap-1.7.0.js, line: 740
Pans the map to a specified point and zooms to the desired zoom level
Parameters
Name | Datatype | Description |
---|---|---|
lat | double | Latitude coordinate to pan to |
lng | double | Longitude coordinate to pan to |
options | object | An object containing varius alternativs for the function. |
Options
Name | Datatype | Description |
---|---|---|
zoomLevel | int | Index of the zoom level to zoom to |
animated | bool | Default false, Animates the paning |
WriteToConsole
function GotMapEngine.GotMap.WriteToConsoleLocation: \GotMap-1.7.0.js, line: 755
Prints the message in the console
Parameters
Name | Datatype | Description |
---|---|---|
message | string | The message to print |
LayerManager
Object GotMapEngine.GotMap.LayerManagerLocation: \GotMap-1.7.0.js, line: 764
Handles all layer related functionality
Layers
Object GotMapEngine.GotMap.LayerManager.LayersLocation: \GotMap-1.7.0.js, line: 778
Container for all added layers
AddLayer
function GotMapEngine.GotMap.LayerManager.AddLayerLocation: \GotMap-1.7.0.js, line: 787
Adds a layer to the map
Parameters
Name | Datatype | Description |
---|---|---|
layer | Object | The layer |
layerName | string | The name of the layer |
layerType | GotMap.LayerManager.LayerTypes | The type of layer |
options | Object | An object containing varius alternativs for the function. |
Options
Name | Datatype | Description |
---|---|---|
excludeFromClustering | bool | OPTIONAL Whether the layer should be wxcluded from the main clustering |
GetZIndex
function GotMapEngine.GotMap.LayerManager.GetZIndexLocation: \GotMap-1.7.0.js, line: 816
Gets the zIndex of a specific layer
Returns: int The zIndex of the layer
Parameters
Name | Datatype | Description |
---|---|---|
layerName | string | The name of the layer |
AddPointToLayer
function GotMapEngine.GotMap.LayerManager.AddPointToLayerLocation: \GotMap-1.7.0.js, line: 828
Adds a point to a specific layer
Returns: Object The point geometry (L.marker/L.circleMarker)
Parameters
Name | Datatype | Description |
---|---|---|
layer | Object | The layer to which the point will be added |
pointDefinition | Object | See PointDefinition for more info. |
ClearLayer
function GotMapEngine.GotMap.LayerManager.ClearLayerLocation: \GotMap-1.7.0.js, line: 875
Removes all geometrys from a specific layer
Parameters
Name | Datatype | Description |
---|---|---|
layerName | string | The name of the new layer |
ClearAllLayers
function GotMapEngine.GotMap.LayerManager.ClearAllLayersLocation: \GotMap-1.7.0.js, line: 893
Removes all geometrys from all layers
GetLayer
function GotMapEngine.GotMap.LayerManager.GetLayerLocation: \GotMap-1.7.0.js, line: 925
Gets a specific layer
Returns: Object The layer if it exists else undefined
Parameters
Name | Datatype | Description |
---|---|---|
layerName | string | The name of the layer |
GetAllFeaturesOnLayer
function GotMapEngine.GotMap.LayerManager.GetAllFeaturesOnLayerLocation: \GotMap-1.7.0.js, line: 941
Gets all (rendered) objecst on a specific layer
Returns: Array An array containing all the objects on the specified layer
Parameters
Name | Datatype | Description |
---|---|---|
layerName | string | The name of the layer |
options | Object | An object containing varius alternativs for the function. |
Options
Name | Datatype | Description |
---|---|---|
includeUnRendered | bool | OPTIONAL Whether to include unrendered(See ViewPortCulling) features in the result, Default false ....TODO mer text här och implementera denna option! |
RemoveFeatureFromLayer
function GotMapEngine.GotMap.LayerManager.RemoveFeatureFromLayerLocation: \GotMap-1.7.0.js, line: 974
Removes a specific feature from the specified layer
Parameters
Name | Datatype | Description |
---|---|---|
layerName | string | The name of the layer |
feature | string | The feature to remove |
GetLayerType
function GotMapEngine.GotMap.LayerManager.GetLayerTypeLocation: \GotMap-1.7.0.js, line: 988
Gets the type of the layer
Returns: string The type of layer defined in LayerManager.LayerTypes
Parameters
Name | Datatype | Description |
---|---|---|
layerName | string | The name of the layer |
HideLayer
function GotMapEngine.GotMap.LayerManager.HideLayerLocation: \GotMap-1.7.0.js, line: 998
Hides a specific layer
Parameters
Name | Datatype | Description |
---|---|---|
layerName | string | The name of the new layer |
HideAllLayers
function GotMapEngine.GotMap.LayerManager.HideAllLayersLocation: \GotMap-1.7.0.js, line: 1018
Hides all layers
LayerExists
function GotMapEngine.GotMap.LayerManager.LayerExistsLocation: \GotMap-1.7.0.js, line: 1039
Checks if a layer with the specified name exists
Returns: bool True if the layer exists else false
Parameters
Name | Datatype | Description |
---|---|---|
layerName | string | The name of the layer |
RemoveAllLayers
function GotMapEngine.GotMap.LayerManager.RemoveAllLayersLocation: \GotMap-1.7.0.js, line: 1046
Removes all layers
RemoveLayer
function GotMapEngine.GotMap.LayerManager.RemoveLayerLocation: \GotMap-1.7.0.js, line: 1066
Removes a specific layer
Parameters
Name | Datatype | Description |
---|---|---|
layerName | string | The name of the new layer |
ReRenderLayersByZindex
function GotMapEngine.GotMap.LayerManager.ReRenderLayersByZindexLocation: \GotMap-1.7.0.js, line: 1087
Rerenders all layers in order of zIndex
Returns: bool True if this will trigger a moveend event
ShowLayer
function GotMapEngine.GotMap.LayerManager.ShowLayerLocation: \GotMap-1.7.0.js, line: 1129
Shows a specific layer
Parameters
Name | Datatype | Description |
---|---|---|
layerName | string | The name of the new layer |
ShowAllLayers
function GotMapEngine.GotMap.LayerManager.ShowAllLayersLocation: \GotMap-1.7.0.js, line: 1149
Shows all layers
ZoomToFeaturesOnLayer
function GotMapEngine.GotMap.LayerManager.ZoomToFeaturesOnLayerLocation: \GotMap-1.7.0.js, line: 1171
Zooms the map as close as posible to show all objects on a specific layer
Parameters
Name | Datatype | Description |
---|---|---|
layerName | string | The name of the new layer |
options | Object | An object containing varius alternativs for the function. |
Options
Name | Datatype | Description |
---|---|---|
maxZoom | int | OPTIONAL The maximum zoomlevel to zoom to |
GeoJsonManager
Object GotMapEngine.GotMap.GeoJsonManagerLocation: \GotMap-1.7.0.js, line: 1290
Handles all GeoJson related functionality (layers and geometrys) in the map
Handles all GeoJson related functionality (layers and geometrys) in the map
- leaflet.markercluster.js https://github.com/Leaflet/Leaflet.markercluster
- leaflet.markercluster.js https://github.com/Leaflet/Leaflet.markercluster
AddFeaturesToLayer
function GotMapEngine.GotMap.GeoJsonManager.AddFeaturesToLayerLocation: \GotMap-1.7.0.js, line: 1300
Adds the GeoJson data to the layer and renders it on the map
Parameters
Name | Datatype | Description |
---|---|---|
geoJson | Array | The GeoJson formated geometry data. A complete GeoJSON Format specification can be found at http://geojson.org/geojson-spec.html |
layerName | string | The name of the new layer, adds a new layer if the layer dosen't exist. |
options | Object | An object containing varius alternativs for the function. |
Options
Name | Datatype | Description |
---|---|---|
editable | bool | Flag whether the features shall be editabla e.g. if the drawtool will be able to manage the features, default false. |
showCollectionsAsOneCluster | bool | Flag whether all features in a GeometryCollections or FeatureCollectins will be show as one when clusterd, default false. |
AddWktToLayer
function GotMapEngine.GotMap.GeoJsonManager.AddWktToLayerLocation: \GotMap-1.7.0.js, line: 1332
Adds well known text specified geometrys to the layer and renders it on the map
Parameters
Name | Datatype | Description |
---|---|---|
wkt | string | The well known text to add |
layerName | string | The name of the new layer, adds a new layer if the layer dosen't exist. |
options | Object | An object containing varius alternativs for the function. |
Options
Name | Datatype | Description |
---|---|---|
useMarkers | bool | Flag whether to user markers, will render points as circles if false. |
popUpContent | string | Html content to render in the popup, no popup will be added if undefined. |
editable | bool | Flag whether the features shall be editabla e.g. if the drawtool will be able to manage the features, default false. |
showCollectionsAsOneCluster | bool | Flag whether all features in a GeometryCollections or FeatureCollectins will be show as one when clusterd, default false. |
ConvertWKTToGeoJsonArray
function GotMapEngine.GotMap.GeoJsonManager.ConvertWKTToGeoJsonArrayLocation: \GotMap-1.7.0.js, line: 1344
Converts a WKT string to an array containing GeoJSON
Parameters
Name | Datatype | Description |
---|---|---|
wkt | string | The well known text to convert |
options | Object | An object containing varius alternativs for the function. |
Options
Name | Datatype | Description |
---|---|---|
useMarkers | bool | Flag whether to user markers, will render points as circles if false. |
popUpContent | string | Html content to render in the popup, no popup will be added if undefined. |
AddLayer
function GotMapEngine.GotMap.GeoJsonManager.AddLayerLocation: \GotMap-1.7.0.js, line: 1396
Adds a new GeoJsonLayer to the map.
Parameters
Name | Datatype | Description |
---|---|---|
layerName | string | The name of the new layer. |
options | Object | An object containing varius alternativs for the function. |
Options
Name | Datatype | Description |
---|---|---|
excludeFromClustering | bool | OPTIONAL Whether the layer should be wxcluded from the main clustering. |
GetLayer
function GotMapEngine.GotMap.GeoJsonManager.GetLayerLocation: \GotMap-1.7.0.js, line: 1432
Gets a specific layer (creats a new layer if a layer with the specified name dosen't exist)
Returns: Object The layer
Parameters
Name | Datatype | Description |
---|---|---|
layerName | string | The name of the layer to get |
GetAllFeaturesOnLayerRecurcive
function GotMapEngine.GotMap.GeoJsonManager.GetAllFeaturesOnLayerRecurciveLocation: \GotMap-1.7.0.js, line: 1447
Recursive method used to find all features on a layer
Returns: Array An array containing all the objects on the specified layer
Parameters
Name | Datatype | Description |
---|---|---|
layer | Object | The layer |
GetLayerAsWKT
function GotMapEngine.GotMap.GeoJsonManager.GetLayerAsWKTLocation: \GotMap-1.7.0.js, line: 1472
Fetches all geometrys on a layer as a WKT(well known text)
Requires:- terraformer-1.0.3.min.js http://terraformer.io/
- terraformer-wkt-parser.min.js http://terraformer.io/
Returns: String The geometries on the layer as a WKT
Parameters
Name | Datatype | Description |
---|---|---|
layerName | string | The name of the layer to get as WKT |
Draw
Object GotMapEngine.GotMap.DrawLocation: \GotMap-1.7.0.js, line: 1730
Container for all drawfunctionality
Note: Drawn features will be GeoJSON
EnableDrawing
function GotMapEngine.GotMap.Draw.EnableDrawingLocation: \GotMap-1.7.0.js, line: 1749
Enables the drawing tool on the specified layer
Note: if editing existing features added via GeoJsonManager.AddFeaturesToLayer, make sure the editable option flag is set to true.
- leaflet.draw.js https://github.com/Leaflet/Leaflet.draw Touch not supported
- leaflet.draw.js https://github.com/michaelguild13/Leaflet.draw Touch supported
Parameters
Name | Datatype | Description |
---|---|---|
layerName | string | The name of the layer to which the drawn geometrys will be added. |
options | Object | An object containing varius alternativs for the function. |
Options
Name | Datatype | Description |
---|---|---|
language | string | Sets the language of the draw tool for gotmap |
DisableDrawing
function GotMapEngine.GotMap.Draw.DisableDrawingLocation: \GotMap-1.7.0.js, line: 1978
Disables drawing
GetDrawnFeaturesAsWKT
function GotMapEngine.GotMap.Draw.GetDrawnFeaturesAsWKTLocation: \GotMap-1.7.0.js, line: 1998
Fetches all features on the draw layer as a WKT
RestrictToArea
function GotMapEngine.GotMap.Draw.RestrictToAreaLocation: \GotMap-1.7.0.js, line: 2017
Restricts drawing to a specified area
Parameters
Name | Datatype | Description |
---|---|---|
areaWKT | string | A string containing a polygon definition in well known text. |
options | Object | An object containing varius alternativs for the function. |
Options
Name | Datatype | Description |
---|---|---|
color | string | Sets the color of the marker |
fillcolor | string | Sets the fillcolor of the marker |
fillOpacity | double | Sets the opacity of the fillcolor for the marker |
SetLanguage
function GotMap.Draw.SetLanguageLocation: \GotMap-1.7.0.js, line: 2174
Sets the language in the drawtool
Avalible languages: English(en), Swedish(sv-SE)
Parameters
Name | Datatype | Description |
---|---|---|
language | string | THe language code of the desired language. |
ClusterManager
Object GotMapEngine.GotMap.ClusterManagerLocation: \GotMap-1.7.0.js, line: 2334
Handles all clustring functionality
AddLayer
function GotMapEngine.GotMap.ClusterManager.AddLayerLocation: \GotMap-1.7.0.js, line: 2346
Adds a new GeoJsonLayer to the map
Parameters
Name | Datatype | Description |
---|---|---|
layerName | string | The name of the new layer |
options | Object | An object containing varius alternativs for the function. |
Options
Name | Datatype | Description |
---|---|---|
disableClusteringAtZoom | int | OPTIONAL Sets the zoom level att which to show the geometrys instad of the cluster groups. |
maxClusterRadius | int | OPTIONAL The maximum radius that a cluster will cover from the central marker (in pixels). |
excludeFromClustering | bool | OPTIONAL Whether the layer should be wxcluded from the main clustering |
AddPointToLayer
function GotMapEngine.GotMap.ClusterManager.AddPointToLayerLocation: \GotMap-1.7.0.js, line: 2384
Adds a point to a specific layer
Parameters
Name | Datatype | Description |
---|---|---|
layerName | string | The name of the new layer |
pointDefinition | Object | See PointDefinition for more info. |
AddPointsToLayer
function GotMapEngine.GotMap.ClusterManager.AddPointsToLayerLocation: \GotMap-1.7.0.js, line: 2393
Adds multiple points to a specific layer
Parameters
Name | Datatype | Description |
---|---|---|
layerName | string | The name of the new layer |
pointDefinitions | array | An array of PointDefinitions. See PointDefinition for more info. |
GetLayer
function GotMapEngine.GotMap.ClusterManager.GetLayerLocation: \GotMap-1.7.0.js, line: 2412
Gets a specific layer (creats a new layer if a layer with the specified name dosen't exist)
Returns: Object The layer
Parameters
Name | Datatype | Description |
---|---|---|
layerName | string | The name of the layer to get |
GetAllFeaturesOnLayerRecurcive
function GotMapEngine.GotMap.ClusterManager.GetAllFeaturesOnLayerRecurciveLocation: \GotMap-1.7.0.js, line: 2425
Gets all features on a specific layer
Returns: Array An array containing all the objects on the specified layer
Parameters
Name | Datatype | Description |
---|---|---|
layer | Object | The layer |
OverlayManager
Object GotMapEngine.GotMap.OverlayManagerLocation: \GotMap-1.7.0.js, line: 2670
Handles all overlays
EnableWmsQueries
function GotMap.OverlayManager.EnableWmsQueriesLocation: \GotMap-1.7.0.js, line: 2681
Enables the wmsquery tool.
Parameters
Name | Datatype | Description |
---|---|---|
options | Object | An object containing varius alternativs for the function. |
Options
Name | Datatype | Description |
---|---|---|
position | string | Defines which corner to place the legend. See ControlPositions |
proxy | string | The url to a relay proxy. Wmsfunction GetFeatureInfo does not support jsonp so this tool uses regular json, crossdomain is not possible! All projects using this functionality need to implement a proxy witch relays all queries. |
proxyUrlParameterName | string | The name och the parameter containing the address that the proxy is suppose to relay. |
AddTileLayer
function GotMap.OverlayManager.AddTileLayerLocation: \GotMap-1.7.0.js, line: 2690
Used for adding a tile layers as baselayers to the map
Parameters
Name | Datatype | Description |
---|---|---|
tileLayerDefinition | Object | An object containing all nessesary information to create the tilelayer. ///See TileLayerDefinition for more info. |
AddWmsLayer
function GotMap.OverlayManager.AddWmsLayerLocation: \GotMap-1.7.0.js, line: 2703
Used for adding a wms layer to the map
Parameters
Name | Datatype | Description |
---|---|---|
wmsLayerDefinition | Object | an object containing all nessesary information to create the wms layer, se GotMapEngine.PreDefinedWmsLayerDefinitions for referense |
GetWmsLayer
function GotMap.OverlayManager.GetWmsLayerLocation: \GotMap-1.7.0.js, line: 2722
Used for getting a specific wms layer in the map
Returns: Object layer The layer if it existes else null
Parameters
Name | Datatype | Description |
---|---|---|
name | String | The name of the desired wms layer |
RemoveWmsLayer
function GotMap.OverlayManager.RemoveWmsLayerLocation: \GotMap-1.7.0.js, line: 2743
Used for removing a specific wms layer from the map
Parameters
Name | Datatype | Description |
---|---|---|
wmsLayer | L.TileLayer.WMS | the layer to remove, tip: use the function GetWmsLayer |
EventManager
Object GotMapEngine.GotMap.EventManagerLocation: \GotMap-1.7.0.js, line: 2910
Handles all events and event callbacks in the map
OnGeometryClickCallback
function GotMapEngine.GotMap.EventManager.OnGeometryClickCallbackLocation: \GotMap-1.7.0.js, line: 2916
Assignable callback function that will be called when a Click event is fired from a geometry
Parameters
Name | Datatype | Description |
---|---|---|
e | Object | The object (tip: e.target.feature) |
OnPointDragStartCallback
function GotMapEngine.GotMap.EventManager.OnPointDragStartCallbackLocation: \GotMap-1.7.0.js, line: 2921
Assignable callback function that will be called when a DragStart event is fired from a marker
Parameters
Name | Datatype | Description |
---|---|---|
e | Object | The object (tip: e.target.feature) |
OnPointDragCallback
function GotMapEngine.GotMap.EventManager.OnPointDragCallbackLocation: \GotMap-1.7.0.js, line: 2926
Assignable callback function that will be called when a Drag event is fired from a marker
Parameters
Name | Datatype | Description |
---|---|---|
e | Object | The object (tip: e.target.feature) |
OnPointDragEndCallback
function GotMapEngine.GotMap.EventManager.OnPointDragEndCallbackLocation: \GotMap-1.7.0.js, line: 2931
Assignable callback function that will be called when a DragEnd event is fired from a marker
Parameters
Name | Datatype | Description |
---|---|---|
e | Object | The object (tip: e.target.feature) |
OnGeometryMouseOverCallback
function GotMapEngine.GotMap.EventManager.OnGeometryMouseOverCallbackLocation: \GotMap-1.7.0.js, line: 2936
Assignable callback function that will be called when a MouseOver event is fired from a geometry
Parameters
Name | Datatype | Description |
---|---|---|
e | Object | The object (tip: e.target.feature) |
OnGeometryMouseOutCallback
function GotMapEngine.GotMap.EventManager.OnGeometryMouseOutCallbackLocation: \GotMap-1.7.0.js, line: 2941
Assignable callback function that will be called when a MouseOut event is fired from a geometry
Parameters
Name | Datatype | Description |
---|---|---|
e | Object | The object (tip: e.target.feature) |
OnMapZoomStartCallback
function GotMapEngine.GotMap.EventManager.OnMapZoomStartCallbackLocation: \GotMap-1.7.0.js, line: 2947
Assignable callback function that will be called when a ZoomStart event is fired from the map.
ZoomStart: Fired when the map zoom is about to change (e.g. before zoom animation).
Parameters
Name | Datatype | Description |
---|---|---|
e | Object | The object (tip: e.target.feature) |
OnMapZoomEndCallback
function GotMapEngine.GotMap.EventManager.OnMapZoomEndCallbackLocation: \GotMap-1.7.0.js, line: 2953
Assignable callback function that will be called when a ZoomEnd event is fired from the map
ZoomEnd: Fired when the map zoom changes.
Parameters
Name | Datatype | Description |
---|---|---|
e | Object | The object (tip: e.target.feature) |
OnMapMoveStartCallback
function GotMapEngine.GotMap.EventManager.OnMapMoveStartCallbackLocation: \GotMap-1.7.0.js, line: 2959
Assignable callback function that will be called when a MoveStart event is fired from the map
MoveStart: Fired when the view of the map starts changing (e.g. user starts dragging the map).
Parameters
Name | Datatype | Description |
---|---|---|
e | Object | The object (tip: e.target.feature) |
OnMapMoveCallback
function GotMapEngine.GotMap.EventManager.OnMapMoveCallbackLocation: \GotMap-1.7.0.js, line: 2965
Assignable callback function that will be called when a Move event is fired from the map
Move: Fired on any movement of the map view.
Parameters
Name | Datatype | Description |
---|---|---|
e | Object | The object (tip: e.target.feature) |
OnMapMoveEndCallback
function GotMapEngine.GotMap.EventManager.OnMapMoveEndCallbackLocation: \GotMap-1.7.0.js, line: 2971
Assignable callback function that will be called when a MoveEnd event is fired from the map
MoveEnd: Fired when the view of the map stops changing (e.g. user stopped dragging the map).
Parameters
Name | Datatype | Description |
---|---|---|
e | Object | The object (tip: e.target.feature) |
OnMapDragStartCallback
function GotMapEngine.GotMap.EventManager.OnMapDragStartCallbackLocation: \GotMap-1.7.0.js, line: 2977
Assignable callback function that will be called when a DragStart event is fired from the map
DragStart: Fired when the user starts dragging the map.
Parameters
Name | Datatype | Description |
---|---|---|
e | Object | The object (tip: e.target.feature) |
OnMapDragCallback
function GotMapEngine.GotMap.EventManager.OnMapDragCallbackLocation: \GotMap-1.7.0.js, line: 2983
Assignable callback function that will be called when a Drag event is fired from the map
Drag: Fired repeatedly while the user drags the map.
Parameters
Name | Datatype | Description |
---|---|---|
e | Object | The object (tip: e.target.feature) |
OnMapDragEndCallback
function GotMapEngine.GotMap.EventManager.OnMapDragEndCallbackLocation: \GotMap-1.7.0.js, line: 2989
Assignable callback function that will be called when a DragEnd event is fired from the map
DragEnd (DragEndEvent): Fired when the user stops dragging the map.
Parameters
Name | Datatype | Description |
---|---|---|
e | Object | The object (tip: distance The distance in pixels the draggable element was moved by.) |
OnWmsLayerLoadedCallback
function GotMapEngine.GotMap.EventManager.OnWmsLayerLoadedCallbackLocation: \GotMap-1.7.0.js, line: 2994
Assignable callback function that will be called when a wms layer is loaded
Parameters
Name | Datatype | Description |
---|---|---|
e | Object | The object (tip: e.target) |
OnDrawCreated
function GotMapEngine.GotMap.EventManager.OnDrawCreatedLocation: \GotMap-1.7.0.js, line: 2999
Assignable callback function that will be called on completion of a drawn object via the drawing tool
Parameters
Name | Datatype | Description |
---|---|---|
e | Object | The created feature |
OnDrawEdited
function GotMapEngine.GotMap.EventManager.OnDrawEditedLocation: \GotMap-1.7.0.js, line: 3004
Assignable callback function that will be called when editing completed via the drawing tool
Parameters
Name | Datatype | Description |
---|---|---|
e | Object | An event containing the edited layer/layers (tip: e.layer) |
OnDrawDeleted
function GotMapEngine.GotMap.EventManager.OnDrawDeletedLocation: \GotMap-1.7.0.js, line: 3009
Assignable callback function that will be called when deleting completed via the drawing tool
Parameters
Name | Datatype | Description |
---|---|---|
e | Object | An event containing the deleted layer/layers (tip: e.layer) |
OnDrawStart
function GotMapEngine.GotMap.EventManager.OnDrawStartLocation: \GotMap-1.7.0.js, line: 3014
Assignable callback function that will be called when the user has chosen to draw a particular vector or marker.
Parameters
Name | Datatype | Description |
---|---|---|
e | Object | An event |
OnDrawStop
function GotMapEngine.GotMap.EventManager.OnDrawStopLocation: \GotMap-1.7.0.js, line: 3019
Assignable callback function that will be called when the user has finished a particular vector or marker.
Parameters
Name | Datatype | Description |
---|---|---|
e | Object | An event |
OnEditStart
function GotMapEngine.GotMap.EventManager.OnEditStartLocation: \GotMap-1.7.0.js, line: 3024
Assignable callback function that will be called when the user starts edit mode by clicking the edit tool button.
Parameters
Name | Datatype | Description |
---|---|---|
e | Object | An event |
OnEditStop
function GotMapEngine.GotMap.EventManager.OnEditStopLocation: \GotMap-1.7.0.js, line: 3029
Assignable callback function that will be calledwhen the user has finshed editing (edit mode) and saves edits.
Parameters
Name | Datatype | Description |
---|---|---|
e | Object | An event |
OnStreetSearchErrorCallback
function GotMapEngine.GotMap.EventManager.OnStreetSearchErrorCallbackLocation: \GotMap-1.7.0.js, line: 3033
Assignable callback function that will be called when an error occurs in the street search
OnStreetSearchGeometryNotFoundCallback
function GotMapEngine.GotMap.EventManager.OnStreetSearchGeometryNotFoundCallbackLocation: \GotMap-1.7.0.js, line: 3037
Assignable callback function that will be called when street geometry was found
OnFindMeShowPositionCallBack
function GotMapEngine.GotMap.EventManager.OnFindMeShowPositionCallBackLocation: \GotMap-1.7.0.js, line: 3043
Assignable callback function that will be called when FindMe control has found the position
Parameters
Name | Datatype | Description |
---|---|---|
lat | double | Latitude of the found position |
lng | double | Longitude of the found position |
CollisionDetection
Object GotMapEngine.GotMap.CollisionDetectionLocation: \GotMap-1.7.0.js, line: 3304
Container for collision detection functions
IsGeoJSONFeatureWithinPolygon
function GotMapEngine.GotMap.CollisionDetection.IsGeoJSONFeatureWithinPolygonLocation: \GotMap-1.7.0.js, line: 3311
Checks if a GeoJSON feature is inside a polygon
Returns: bool True if the feature is within the ploygon else false
Parameters
Name | Datatype | Description |
---|---|---|
feature | Object | The GeoJSON feature to check |
polygonCoordinates | Array | A array containing all the points of the polygon ([{lat, lng}, ...]) |
IsPointOnPolygon
function GotMapEngine.GotMap.CollisionDetection.IsPointOnPolygonLocation: \GotMap-1.7.0.js, line: 3367
Checks if a point(coordinats array) is inside a polygon
Returns: bool True if the point is on the ploygon else false
Parameters
Name | Datatype | Description |
---|---|---|
pointCoordinatesArray | Array | A Array containing the coordinates of the point |
polygonCoordinates | Array | A array containing all the points of the polygon ([{lat, lng}, ...]) |
LineIntersectsWithPolygon
function GotMapEngine.GotMap.CollisionDetection.LineIntersectsWithPolygonLocation: \GotMap-1.7.0.js, line: 3388
Checks if a line intersects with any edge of a polygon
Returns: bool True if the line intersects with any edge of the ploygon else false
Parameters
Name | Datatype | Description |
---|---|---|
linePointA | Array | A Array containing the coordinates of the lines start position |
linePointB | Array | A Array containing the coordinates of the lines end position |
polygonCoordinates | Array | A array containing all the points of the polygon ([{lat, lng}, ...], first and last must be the same!) |
Helpers
Object GotMapEngine.GotMap.HelpersLocation: \GotMap-1.7.0.js, line: 3440
Container for common helper functions
WKTPolygonToCoordinatesArray
function GotMapEngine.GotMap.Helpers.WKTPolygonToCoordinatesArrayLocation: \GotMap-1.7.0.js, line: 3445
Transforms a well known text polygon to a point array
Returns: Array The array containing all the points of the polygon ([{lat, lng}, ...])
Parameters
Name | Datatype | Description |
---|---|---|
wkt | string | The well known text polygon |
ObjectDefinitions
Object GotMapEngine.ObjectDefinitionsLocation: \GotMap-1.7.0.js, line: 3539
Container for the definitions of the objects that some of the functions in GotMap2 uses.
PointDefinition
Object GotMapEngine.ObjectDefinitions.PointDefinitionLocation: \GotMap-1.7.0.js, line: 3549
Properties
Name | Datatype | Description |
---|---|---|
Id | int | The identifyer of the feature. |
UseMarker | bool | Whether to use markers or points. |
MarkerOptions | object | See MarkerOptions for more info. |
Style | object | See Style for more info. |
Lat | double | Latitude of the point. |
Lng | double | Longitude of the point. |
PopupHtml | string | Html that will be added to the popup. |
Draggable | bool | Whether the feature is dragable. |
TileLayerDefinition
Object GotMapEngine.GotMap.ObjectDefinitions.TileLayerDefinitionLocation: \GotMap-1.7.0.js, line: 3565
Properties
Name | Datatype | Description |
---|---|---|
Url | string | The url to the tilelayer |
Name | string | The name that will be displayed in the layerscontrol |
Attribution | string | The string used by the attribution control, describes the layer data |
MaxNativeZoom | int | The maximum zoom the layer suppors(the map will zoom deeper only magnifying the loaded tiles) |
WmsLayerDefinition
Object GotMapEngine.GotMap.ObjectDefinitions.WmsLayerDefinitionLocation: \GotMap-1.7.0.js, line: 3584
Properties
Name | Datatype | Description |
---|---|---|
Url | string | The url to the geoserver that is housing the WMS layer |
Name | string | The name that will be displayed in the layerscontrol |
Layer | string | WMS layer to show |
Format | string | WMS image format (use 'image/png' for layers with transparency) |
Transparent | bool | If true, the WMS service will return images with transparency |
Styles | string | OPTIONAL Comma-separated list of WMS styles |
IsBaseLayer | bool | OPTIONAL If true, the WMS service will be added as a baselayer |
EnableOnLoad | bool | OPTIONAL Flags whether to load the layer by default or not |
MaxNaviveZoom | int | OPTIONAL The maximum zoom of the WMS layer |
TileSize | int | OPTIONAL Tile size (width and height in pixels, assuming tiles are square). Defaults to 256 if undefined. |
GroupName | string | OPTIONAL The name of the group this layer schould belong to |
MenuDefinition
Object GotMapEngine.GotMap.ObjectDefinitions.MenuDefinitionLocation: \GotMap-1.7.0.js, line: 3601
Properties
Name | Datatype | Description |
---|---|---|
brand. | GotMapEngine.GotMap.ObjectDefinitions.MenuBrand | See MenuBrand for more info. |
items | Array | An array of GotMapEngine.GotMap.ObjectDefinitions.MenuItem. See MenuItem for more info. |
MenuBrand
Object GotMapEngine.GotMap.ObjectDefinitions.MenuBrandLocation: \GotMap-1.7.0.js, line: 3612
Properties
Name | Datatype | Description |
---|---|---|
href | string | An url, this will create a actionlink |
text | string | The text to display in the actionlink. |
innerHTML | string | The html to display in the actionlink. |
src | string | An url to a image, this will create an image tag. |
MenuItem
Object GotMapEngine.GotMap.ObjectDefinitions.MenuItemLocation: \GotMap-1.7.0.js, line: 3626
Properties
Name | Datatype | Description |
---|---|---|
href | string | An url, this will create a actionlink |
text | string | The text to display in the actionlink. |
title | string | The title of the actionlink. |
innerHTML | string | The html to display in the actionlink. |
onclick | function | A function, will be called when item is clicked. |
submenuitems | Array | An array of GotMapEngine.GotMap.ObjectDefinitions.MenuItem |