GotMap-1.13.0.min.js

  • GotMapEngine
  • GotMap-1.13.0.min.js

    Namespace: GotMap

    GotMap is a wrapper for leaflet, it includes multiple plugins and extensions all of which are bundled into the gotmapjs file, the only requirements not bundled are jQuery and jQuery UI.
    Note: For ducumentation puropses all requirements are noted through out this documentation.

    GotMap initializes asynchronously, use [gotmapInstance].Ready(function (gotmap){... or [gotmapInstance].on('ready', function (gotmap){... to get the ready event.

    CDN:
    http://karta.miljoforvaltningen.goteborg.se/Dist/gotmap-1.13.0.min.css
    http://karta.miljoforvaltningen.goteborg.se/Dist/gotmap-1.13.0.min.js

    <link rel="stylesheet" href="http://karta.miljoforvaltningen.goteborg.se/Dist/gotmap-1.13.0.min.css" />
    <script src="http://karta.miljoforvaltningen.goteborg.se/Dist/gotmap-1.13.0.min.js"></script>

    Added/Updated functionality

    • - Added GotMapEngine.Options.ContextMenuOptions
    • - Added GotMapEngine.Options.LoadingControlOptions
    • - Added function GotMapEngine.GotMap.AddLoadingControl
    • - Added function GotMapEngine.GotMap.DescribeCoordinate
    • - Added function GotMapEngine.GotMap.ShowCoordinate

    GotMapEngine

    Object GotMapEngine

    Container for all gotmap functionality, e.g. the namespace

    Requires:

    TileLayerDefinitions

    Object GotMapEngine.TileLayerDefinitions

    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.ControlPositions

    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.Options

    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.
    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.
    MinZoomLevel int The minimum allowed level to zoom to (only editable before creation).
    MaxZoomLevel int The maximul allowed level to zoom to (only editable before creation).
    FindMeZoomLevel int The level the map will be zoomed to when activating the findme comtrol.
    FindMeControlPosition string Sets which corner the find me control will be placed
    ClusteringIsEnabled bool Flags wheter the clustering is enabled.
    MaxClusterRadius int The maximum radius that a cluster will cover from the central marker (in pixels).
    DisableClusteringAtZoom int Sets the zoom level att which to show the geometrys instad of the cluster groups, set it to 0 to disable clustering.
    OverlayControlPosition string Sets which corner the overlay control will be placed
    MinimizeOverlayControl bool Flags whether the overlay control schould be minimiced
    LayerInfoButton bool Sets whether to show the info button in the layercontrol
    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)
    Language string The display language, avalible options: English | En-us | Swedish | Sv-se
    RelayProxyUrl string The address to the relayproxy
    RelayProxyParameterName string The name of the get parameter which will contain the url to relay

    ContextMenuOptions

    Object GotMapEngine.Options.ContextMenuOptions

    Container for the contextmenu options.


    Feature

    Object GotMapEngine.Options.ContextMenuOptions.Feature

    The contextmenu top show when rightclicking on a feature.

    Properties

    Name Datatype Description
    Enabled bool Flags wheter the contextmenu is enabled.
    Width int The width of the contextmenu.
    MenuOptions array An array of ContextMenuOption objects. See ContextMenuOption for more info.

    Map

    Object GotMapEngine.Options.ContextMenuOptions.Map

    The contextmenu top show when rightclicking on the map.

    Properties

    Name Datatype Description
    Enabled bool Flags wheter the contextmenu is enabled.
    Width int The width of the contextmenu.
    MenuOptions array An array of ContextMenuOption objects. See ContextMenuOption for more info.

    DrawOptions

    Object GotMapEngine.Options.DrawOptions

    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
    Text bool Enables / Disables the text writing control
    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
    ImportExport bool Enables / Disables the Import/Export control
    ColorPicker bool Enables / Disables the Colorpicker (when feature on drawlayer is clicked)
    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
    GuidelineDistance int The spacing between the dots when drawing lines or polygons

    GeoServerDefinitions

    Object GotMapEngine.Options.GeoServerDefinitions

    Array container for the geoservers used in the application
    See GeoServerDefinition for more info.


    LoadingControlOptions

    Object GotMapEngine.Options.LoadingControlOptions

    Properties

    Name Datatype Description
    Enabled bool Flags wheter the loading control is enabled.
    Separate bool Flags wheter the loading control is from the zoom control.
    Position string Sets which corner the loading control will be placed.
    DelayIndicator int Sets a delay(in milliseconds) before the loading indicator is displayed.

    MarkerOptions

    Object GotMapEngine.Options.MarkerOptions

    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]
    Markers Array An Array containing the avalible marker icons (object containing name and color)
    Draggable bool Sets whether the marker should be draggable or not

    ScaleToolOptions

    Object GotMapEngine.Options.ScaleToolOptions

    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).

    StreetSearchOptions

    Object GotMapEngine.Options.StreetSearchOptions

    Properties

    Name Datatype Description
    GeoCoderUrl string Url to a adress lookup service

    Style

    Object GotMapEngine.Options.Style

    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.

    TileLayerDefinitions

    Object GotMapEngine.Options.TileLayerDefinitions

    Array container for the added tilelayers.
    All layerdefinitions added to this before instantiation of the map will be automaticly added to the map.

    See TileLayerDefinition for more info.


    WmsLayerDefinitions

    Object GotMapEngine.Options.WmsLayerDefinitions

    Array 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.GotMap

    Constructor for GotMap

    Parameters

    Name Datatype Description
    divId string The div in which the map will be displayed

    AddFindMeControl

    function GotMapEngine.GotMap.AddFindMeControl

    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

    AddFullscreenControl

    function GotMapEngine.GotMap.AddFullscreenControl

    Adds a fullscreen button control to the map.
    Note: This is incompatible with the streetsearchcontrol.

    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 addfindmecontrol. See ControlPositions

    AddInformationToLayersControl

    function GotMapEngine.GotMap.AddInformationToLayersControl

    Adds information to the layer control

    Parameters

    Name Datatype Description
    information string The information to display anny html works

    AddLayerToLayersControl

    function GotMapEngine.GotMap.AddLayerToLayersControl

    Adds a layer to the layercontrol

    Parameters

    Name Datatype Description
    layerName string The name of the layer

    AddLegend

    function GotMapEngine.GotMap.AddLegend

    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.

    AddLoadingControl

    function GotMapEngine.GotMap.AddLoadingControl

    Adds a tile/wms-layer loading indicator to the map

    Parameters

    Name Datatype Description
    options Object An object containing varius alternativs for the function.

    Options

    Name Datatype Description
    separate bool OPTIONAL Flags if the loading indicator will be separated from the zoom control (default true).
    position GotMapEngine.ControlPositions OPTIONAL Which corner to place the control (default bottomright).
    delayIndicator int OPTIONAL The number of milliseconds to wait before showing the loading indicator (default 200).

    AddMeasureControl

    function GotMapEngine.GotMap.AddMeasureControl

    Adds a measure tool to the map

    Requires:

    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

    AddMenuContent

    function GotMapEngine.GotMap.AddMenuContent

    Adds content to the menu sidepanel

    Parameters

    Name Datatype Description
    content string The content to att the the menu, can be html or text

    AddMenuControl

    function GotMapEngine.GotMap.AddMenuControl

    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.

    AddPopupToFeature

    function GotMapEngine.GotMap.AddPopupToFeature

    Adds a popup to a specific feature

    Parameters

    Name Datatype Description
    feature Object The feature to which 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

    AddScaleControl

    function GotMapEngine.GotMap.AddScaleControl

    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 GotMapEngine.ControlPositions Which corner to place the control
    maxWidth int What size of the scale control
    metric bool Flag for showing metric
    imperial bool Flag for showing imperial

    AddStreetSearchControl

    function GotMapEngine.GotMap.AddStreetSearchControl

    Adds a street search field control to the map
    Uses http://geocoder.tkgbg.se/ to find streets and addresses in Gothenburg.

    Requires:

    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.

    AddWmsImageExporterControl

    function GotMapEngine.GotMap.AddWmsImageExporterControl

    Adds a WMS-Image exporter control to the map

    Requires:

    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

    ClearInformationInLayersControl

    function GotMapEngine.GotMap.ClearInformationInLayersControl

    Clears all information in the layercontrol


    DescribeCoordinate

    function GotMapEngine.GotMap.DescribeCoordinate

    Gets an object containing FriendlyGPSFormat, WGS84 and SWEREF 99 12 00 for the coordinate

    Returns: object An object FriendlyGPSFormat(Friendly lat,lng), WGS84(WGS84 lat,lng) and SWEREF 99 12 00(SWEREF991200 northing,easting,x,y)

    Parameters

    Name Datatype Description
    lat double Latitude coordinate
    lng double Longitude coordinate

    GetZoom

    function GotMapEngine.GotMap.GetZoom

    Fetches the maps current zoom level index

    Returns: int Index of the maps current zoom level


    Ready

    function GotMapEngine.GotMap.Ready

    Specify a function to execute when the map is fully loaded.
    the function will get executed directly if the map is already loaded.

    Parameters

    Name Datatype Description
    func functoin The function to call when the map is fully loaded.

    RemoveLayerFromLayersControl

    function GotMapEngine.GotMap.RemoveLayerFromLayersControl

    Adds a layer to the layercontrol

    Parameters

    Name Datatype Description
    layerName string The name of the layer

    RestackFindMeControl

    function GotMapEngine.GotMap.RestackFindMeControl

    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


    RestackFullscreenControl

    function GotMapEngine.GotMap.RestackFullscreenControl

    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

    Requires:

    RestackLayersControl

    function GotMapEngine.GotMap.RestackLayersControl

    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.RestackMeasureControl

    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.RestackMenuControl

    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.RestackScaleControl

    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


    RestackWmsImageExporterControl

    function GotMapEngine.GotMap.RestackWmsImageExporterControl

    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.RestackZoomControl

    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


    SetZoom

    function GotMapEngine.GotMap.SetZoom

    Zooms the map to a desired zoom level

    Parameters

    Name Datatype Description
    zoomLevel int Index of the desired zoom level

    ShowCoordinate

    function GotMapEngine.GotMap.ShowCoordinate

    Opens a coordinatedescriptionpopup at the coordinate

    Parameters

    Name Datatype Description
    lat double Latitude coordinate
    lng double Longitude coordinate

    WriteToConsole

    function GotMapEngine.GotMap.WriteToConsole

    Prints the message in the console

    Parameters

    Name Datatype Description
    message string The message to print

    ZoomPanToLatLng

    function GotMapEngine.GotMap.ZoomPanToLatLng

    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

    ZoomToLatLngBounds

    function GotMapEngine.GotMap.ZoomToLatLngBounds

    Zooms the map to specified bounds

    Parameters

    Name Datatype Description
    options object An object containing varius alternativs for the function.

    Options

    Name Datatype Description
    maxZoom int Index of maximum zoomlevel to zoom to, default [gotmap].Options.MaxZoomLevel
    animate bool Flag if the zooming will be animated, default true

    ClusterManager

    Object GotMapEngine.GotMap.ClusterManager

    Handles all clustring functionality


    AddLayer

    function GotMapEngine.GotMap.ClusterManager.AddLayer

    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

    AddPointsToLayer

    function GotMapEngine.GotMap.ClusterManager.AddPointsToLayer

    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.

    AddPointToLayer

    function GotMapEngine.GotMap.ClusterManager.AddPointToLayer

    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.

    GetAllFeaturesOnLayerRecurcive

    function GotMapEngine.GotMap.ClusterManager.GetAllFeaturesOnLayerRecurcive

    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

    GetLayer

    function GotMapEngine.GotMap.ClusterManager.GetLayer

    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

    CollisionDetection

    Object GotMapEngine.GotMap.CollisionDetection

    Container for collision detection functions


    IsGeoJSONFeatureWithinPolygon

    function GotMapEngine.GotMap.CollisionDetection.IsGeoJSONFeatureWithinPolygon

    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.IsPointOnPolygon

    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.LineIntersectsWithPolygon

    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!)

    Draw

    Object GotMapEngine.GotMap.Draw

    Container for all drawfunctionality
    Note: Drawn features will be GeoJSON


    DisableDrawing

    function GotMapEngine.GotMap.Draw.DisableDrawing

    Disables drawing


    EnableDrawing

    function GotMapEngine.GotMap.Draw.EnableDrawing

    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.

    Requires:

    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

    GetDrawnFeaturesAsWKT

    function GotMapEngine.GotMap.Draw.GetDrawnFeaturesAsWKT

    Fetches all features on the draw layer as a WKT


    RestrictToArea

    function GotMapEngine.GotMap.Draw.RestrictToArea

    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

    EventManager

    Object GotMapEngine.GotMap.EventManager

    Handles all events and event callbacks in the map


    OnDrawCreated

    function GotMapEngine.GotMap.EventManager.OnDrawCreated

    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

    OnDrawDeleted

    function GotMapEngine.GotMap.EventManager.OnDrawDeleted

    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)

    OnDrawEdited

    function GotMapEngine.GotMap.EventManager.OnDrawEdited

    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)

    OnDrawStart

    function GotMapEngine.GotMap.EventManager.OnDrawStart

    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.OnDrawStop

    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.OnEditStart

    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.OnEditStop

    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

    OnFindMeShowPositionCallBack

    function GotMapEngine.GotMap.EventManager.OnFindMeShowPositionCallBack

    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

    OnGeometryClickCallback

    function GotMapEngine.GotMap.EventManager.OnGeometryClickCallback

    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)

    OnGeometryMouseOutCallback

    function GotMapEngine.GotMap.EventManager.OnGeometryMouseOutCallback

    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)

    OnGeometryMouseOverCallback

    function GotMapEngine.GotMap.EventManager.OnGeometryMouseOverCallback

    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)

    OnMapDragCallback

    function GotMapEngine.GotMap.EventManager.OnMapDragCallback

    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.OnMapDragEndCallback

    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.)

    OnMapDragStartCallback

    function GotMapEngine.GotMap.EventManager.OnMapDragStartCallback

    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)

    OnMapMoveCallback

    function GotMapEngine.GotMap.EventManager.OnMapMoveCallback

    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.OnMapMoveEndCallback

    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)

    OnMapMoveStartCallback

    function GotMapEngine.GotMap.EventManager.OnMapMoveStartCallback

    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)

    OnMapZoomEndCallback

    function GotMapEngine.GotMap.EventManager.OnMapZoomEndCallback

    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)

    OnMapZoomStartCallback

    function GotMapEngine.GotMap.EventManager.OnMapZoomStartCallback

    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)

    OnPointDragCallback

    function GotMapEngine.GotMap.EventManager.OnPointDragCallback

    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.OnPointDragEndCallback

    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)

    OnPointDragStartCallback

    function GotMapEngine.GotMap.EventManager.OnPointDragStartCallback

    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)

    OnStreetSearchErrorCallback

    function GotMapEngine.GotMap.EventManager.OnStreetSearchErrorCallback

    Assignable callback function that will be called when an error occurs in the street search


    OnStreetSearchGeometryNotFoundCallback

    function GotMapEngine.GotMap.EventManager.OnStreetSearchGeometryNotFoundCallback

    Assignable callback function that will be called when street geometry was found


    OnWmsLayerLoadedCallback

    function GotMapEngine.GotMap.EventManager.OnWmsLayerLoadedCallback

    Assignable callback function that will be called when a wms layer is loaded

    Parameters

    Name Datatype Description
    e Object The object (tip: e.target)

    GeoJsonManager

    Object GotMapEngine.GotMap.GeoJsonManager

    Handles all GeoJson related functionality (layers and geometrys) in the map

    Requires:

    AddFeaturesToLayer

    function GotMapEngine.GotMap.GeoJsonManager.AddFeaturesToLayer

    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
    showCollectionsAsOneCluster bool Flag whether all features in a GeometryCollections or FeatureCollectins will be show as one when clusterd, default false.

    AddLayer

    function GotMapEngine.GotMap.GeoJsonManager.AddLayer

    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.

    AddWktToLayer

    function GotMapEngine.GotMap.GeoJsonManager.AddWktToLayer

    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.
    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.ConvertWKTToGeoJsonArray

    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.

    GetAllFeaturesOnLayerRecurcive

    function GotMapEngine.GotMap.GeoJsonManager.GetAllFeaturesOnLayerRecurcive

    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

    GetLayer

    function GotMapEngine.GotMap.GeoJsonManager.GetLayer

    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

    GetLayerAsWKT

    function GotMapEngine.GotMap.GeoJsonManager.GetLayerAsWKT

    Fetches all geometrys on a layer as a WKT(well known text)

    Requires:

    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

    GeoServerManager

    Object GotMapEngine.GotMap.GeoServerManager

    Manages interaction with GeoServers
    Note: The servers needs to be listed in GotMap, use GotMapEngine.Options.GeoServerDefinitions. Also a RelayProxy needs to be configured.
    See Options for more info.


    DescribeLayerAsync

    function GotMap.GeoServerManager.DescribeLayerAsync

    Querys the GeoServer for additional information about the layer

    Returns: Object A Deferred's Promise object.

    Parameters

    Name Datatype Description
    wmsLayer Object An instanse of L.TileLayerWMS (leaflet wmslayer)

    GetCapabilitiesAsync

    function GotMap.GeoServerManager.GetCapabilitiesAsync

    Querys the GeoServer for its capabilities

    Returns: Object A Deferred's Promise object.

    Parameters

    Name Datatype Description
    url string The url to the wms-service

    GetFeatureAsync

    function GotMap.GeoServerManager.GetFeatureAsync

    Querys the GeoServer for features on specified layer.

    Returns: Object A Deferred's Promise object.

    Parameters

    Name Datatype Description
    layerUrl string A url to the geoserver.
    typeNames string The geoserver name of the layer.
    options Object An object containing varius alternativs for the function.

    Options

    Name Datatype Description
    version string OPTIONAL Service version. Default 1.0.0.
    crs string OPTIONAL Coordinate Reference System of the found features.
    cql_filter string OPTIONAL A cql filter.

    GetMapAsync

    function GotMap.GeoServerManager.GetMapAsync

    Querys the GeoServer for its capabilities

    Returns: Object A Deferred's Promise object.

    Parameters

    Name Datatype Description
    wmsLayerDefinition Object //TODO
    boundingBox Object {minx: value, miny: value, maxx: value, maxy: value};
    width int Width of map output, in pixels.
    height int Height of map output, in pixels.

    GetServerByName

    function GotMap.GeoServerManager.GetServerByName

    Gets a specific server from the GeoServerDefinitions by its defined Name.

    Returns: Object A GeoServerDefinition.

    Parameters

    Name Datatype Description
    name string The name of the server to get.

    GeoTransformer

    Object GotMapEngine.GotMap.GeoTransformer

    Container for common geometry transformation functionality


    BufferGeoJSONGeometry

    function GotMapEngine.Gotmap.GeoTransformer.BufferGeoJSONGeometry

    Extends a GeoJSON geometry geometry with a buffer

    Returns: objec GeoJSON} Buffered GeoJSON

    Parameters

    Name Datatype Description
    GeoJSON.Geometry} objec geometry The GeoJSON geomtry to buffer

    BufferWKT

    function GotMapEngine.Gotmap.GeoTransformer.BufferWKT

    Extends a WKT geometry with a buffer

    Returns: string Buffered WKT

    Parameters

    Name Datatype Description
    wkt string A well known text geometry
    distance double The width of the buffer (may be positive, negative or 0)
    quadrantSegments int The number of line segments used to represent a quadrant of a circle

    GeoGJSONGeometryGeodeticToGrid

    function GotMapEngine.Gotmap.GeoTransformer.GeoGJSONGeometryGeodeticToGrid

    Reprojects a GeoJSON geometry to grid

    Returns: objec GeoJSON} Projected GeoJSON

    Parameters

    Name Datatype Description
    projection string The projection to convert to. Ex. "sweref_99_1200" see gausskruger.js
    GeoJSON.Geometry} objec geometry The geometry to project

    GeoGJSONGeometryGridToGeodetic

    function GotMapEngine.Gotmap.GeoTransformer.GeoGJSONGeometryGridToGeodetic

    Reprojects a GeoJSON geometry to geodetic

    Returns: rojecte GeoJSON

    Parameters

    Name Datatype Description
    projection string The projection to convert from ex. "sweref_99_1200" see gausskruger.js
    GeoJSON.Geometry} objec geometry The geometry to project

    GeoJSONFeatureToWKT

    function GotMapEngine.Gotmap.GeoTransformer.GeoJSONFeatureToWKT

    Converts a GeoJSON feature to WKT

    Returns: string WKT

    Parameters

    Name Datatype Description
    GeoJSON} objec feature The GeoJSON feature to convert

    GeoJSONGeometryToWKT

    function GotMapEngine.Gotmap.GeoTransformer.GeoJSONGeometryToWKT

    Converts a GeoJSON geometry to WKT

    Returns: string WKT

    Parameters

    Name Datatype Description
    GeoJSON.Geometry} objec geometry The GeoJSON geometry to convert

    WKTToGeoJSONGeometry

    function GotMapEngine.Gotmap.GeoTransformer.WKTToGeoJSONGeometry

    Converts a WKT to a GeoJSON geometry

    Parameters

    Name Datatype Description
    wkt string The wkt to transform

    Helpers

    Object GotMapEngine.GotMap.Helpers

    Container for common helper functions


    FlattenArrayRecursive

    function GotMapEngine.GotMap.Helpers.FlattenArrayRecursive

    Transforms a nested array to a flat array

    Returns: Array The flattened array

    Parameters

    Name Datatype Description
    array Array A nested array

    GetCoordinatesCenter

    function GotMapEngine.GotMap.Helpers.GetCoordinatesCenter

    Calculates the center of a set of coordinates

    Returns: Object An object(lat and lng parameters) containing the calculated center cooridnate

    Parameters

    Name Datatype Description
    coordinates Array A set of coordniates

    WKTPolygonToCoordinatesArray

    function GotMapEngine.GotMap.Helpers.WKTPolygonToCoordinatesArray

    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

    LayerManager

    Object GotMapEngine.GotMap.LayerManager

    Handles all layer related functionality


    AddLayer

    function GotMapEngine.GotMap.LayerManager.AddLayer

    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

    AddPointToLayer

    function GotMapEngine.GotMap.LayerManager.AddPointToLayer

    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.

    ClearAllLayers

    function GotMapEngine.GotMap.LayerManager.ClearAllLayers

    Removes all geometrys from all layers


    ClearLayer

    function GotMapEngine.GotMap.LayerManager.ClearLayer

    Removes all geometrys from a specific layer

    Parameters

    Name Datatype Description
    layerName string The name of the new layer

    GetAllFeaturesOnLayer

    function GotMapEngine.GotMap.LayerManager.GetAllFeaturesOnLayer

    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!

    GetLayer

    function GotMapEngine.GotMap.LayerManager.GetLayer

    Gets a specific layer

    Returns: Object The layer if it exists else undefined

    Parameters

    Name Datatype Description
    layerName string The name of the layer

    GetLayerType

    function GotMapEngine.GotMap.LayerManager.GetLayerType

    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

    GetZIndex

    function GotMapEngine.GotMap.LayerManager.GetZIndex

    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

    HideAllLayers

    function GotMapEngine.GotMap.LayerManager.HideAllLayers

    Hides all layers


    HideLayer

    function GotMapEngine.GotMap.LayerManager.HideLayer

    Hides a specific layer

    Parameters

    Name Datatype Description
    layerName string The name of the new layer

    LayerExists

    function GotMapEngine.GotMap.LayerManager.LayerExists

    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.RemoveAllLayers

    Removes all layers


    RemoveFeatureFromLayer

    function GotMapEngine.GotMap.LayerManager.RemoveFeatureFromLayer

    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

    RemoveLayer

    function GotMapEngine.GotMap.LayerManager.RemoveLayer

    Removes a specific layer

    Parameters

    Name Datatype Description
    layerName string The name of the new layer

    ReRenderLayersByZindex

    function GotMapEngine.GotMap.LayerManager.ReRenderLayersByZindex

    Rerenders all layers in order of zIndex

    Returns: bool True if this will trigger a moveend event


    ShowAllLayers

    function GotMapEngine.GotMap.LayerManager.ShowAllLayers

    Shows all layers


    ShowLayer

    function GotMapEngine.GotMap.LayerManager.ShowLayer

    Shows a specific layer

    Parameters

    Name Datatype Description
    layerName string The name of the new layer

    ZoomToFeaturesOnLayer

    function GotMapEngine.GotMap.LayerManager.ZoomToFeaturesOnLayer

    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

    LayerTypes

    Object GotMap.LayerManager.LayerTypes

    Container for the avalible layertypes

    Properties

    Name Datatype Description
    GeoJson string Defines the type of the geojson layers
    Cluster string Defines the type of the cluster layers

    Layers

    Object GotMapEngine.GotMap.LayerManager.Layers

    Container for all added layers


    OverlayManager

    Object GotMapEngine.GotMap.OverlayManager

    Handles all overlays


    AddTileLayer

    function GotMap.OverlayManager.AddTileLayer

    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.AddWmsLayer

    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

    EnableWmsQueries

    function GotMap.OverlayManager.EnableWmsQueries

    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.

    GetWmsLayer

    function GotMap.OverlayManager.GetWmsLayer

    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

    IsTileLayerAccessible

    function GotMap.OverlayManager.IsTileLayerAccessible

    Pings(tries to load the current center tile) of the layer
    Note if using extenal tilelayer creation the tilelayer must be extended with the function IsTileLayer scholud return boolan

    Parameters

    Name Datatype Description
    tileLayer L.tileLayer(.WMS) The desired tile/wms layer
    layerIsAccessibleCallback function Callbackfunction called if the layer is accessible
    layerIsInaccessibleCallback function Callbackfunction called if the layer is inaccessible

    RemoveWmsLayer

    function GotMap.OverlayManager.RemoveWmsLayer

    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

    RelayProxy

    Object GotMapEngine.GotMap.RelayProxy

    A local url which relays requests and responces (See RelayProxy)


    GetFormatedUrl

    function GotMapEngine.GotMap.RelayProxy.GetFormatedUrl

    Returns: string A url formated for use when calling the RelayProxy

    Parameters

    Name Datatype Description
    url string The url to relay

    RemoveUrlFormating

    function GotMapEngine.GotMap.RelayProxy.RemoveUrlFormating

    Returns: string A url without the relayproxy formating

    Parameters

    Name Datatype Description
    url string The url to remove relay fromating from

    Parser

    Object GotMapEngine.Parser

    Container for parsing functionality


    HexToRgb

    function GotMapEngine.Parser.HexToRgb

    Parses a hexadecimal color code into rgb values

    Returns: object An object containing r(red), g(green) and b(blue) values and a string formated rgb code

    Parameters

    Name Datatype Description
    hex string The red hexadecimal color code

    RgbToHex

    function GotMapEngine.Parser.RgbToHex

    Parses red green and blue into a hexadecimal color code

    Returns: string The rgbvalues as hexadecimal color

    Parameters

    Name Datatype Description
    red int The red value
    green int The green value
    blue int The blue value

    ToBool

    function GotMapEngine.Parser.ToBool

    Parses a value as bool

    Returns: bool The value as a bool

    Parameters

    Name Datatype Description
    value object The value to be parsed

    ToFolat

    function GotMapEngine.Parser.ToFolat

    Parses a value as float

    Returns: float The value as a float

    Parameters

    Name Datatype Description
    value object The value to be parsed

    ToInt

    function GotMapEngine.Parser.ToInt

    Parses a value as int

    Returns: int The value as a int

    Parameters

    Name Datatype Description
    value object The value to be parsed

    ToString

    function GotMapEngine.Parser.ToString

    Parses a value as string

    Returns: string The value as a string

    Parameters

    Name Datatype Description
    value object The value to be parsed

    ToXML

    function GotMapEngine.Parser.ToXML

    Parses a value as sml

    Returns: object The value as a xml

    Parameters

    Name Datatype Description
    value string The value to be parsed

    GeoJSON

    Object GotMapEngine.GeoJSON

    Container for GeoJSON functionality


    ToExportFormat

    function GotMapEngine.GeoJSON.ToExportFormat

    Transforms a GeoJSON objects properties for export e.g. (but not full support) to simplestyle-spec
    Addes a style property containing av string concationation of all custom GeoJSON properties on the GeoJSON object

    Requires:

    Returns: object The transformed GeoJSON object

    Parameters

    Name Datatype Description
    geoJSON object The GeoJSON object to transform

    ToImportFormat

    function GotMapEngine.GeoJSON.ToImportFormat

    Transforms a simplestyle-spec formated GeoJSON objects properties for import See (not full support, missing marker support) from simplestyle-spec
    Also supports building custom GeoJSON properties from the feature.properties.style string

    Requires:

    Returns: object The transformed GeoJSON object

    Parameters

    Name Datatype Description
    geoJSON object The GeoJSON object to transform

    CustomGeoJson

    Object GotMapEngine.GeoJSON.CustomGeoJson

    Container for CustomGeoJson functionality


    GetPropertyByName

    function GotMapEngine.GeoJSON.CustomGeoJson.GetPropertyByName

    Gets a custom GeoJSON property definition by its name

    Returns: h custom GeoJSON peroperty definition

    Parameters

    Name Datatype Description
    name string The name of the custom GeoJSON property

    Properties

    Object GotMapEngine.GeoJSON.CustomGeoJson.Properties

    An array containing custom GeoJSON definition objects
    Ex { name: 'Example', alt: 'ex', parser: parsing function e.g. GotMapEngine.Parser.To... }


    FriendlyGpsFormat

    Object GotMapEngine.FriendlyGpsFormat

    Simple tool used for humanreadable formating of location information


    GetFriendlyGpsFormat

    function GotMapEngine.FriendlyGpsFormat.GetFriendlyGpsFormat

    Formats latitude and longitude into humanreadable form

    Returns: Object The humanreadable location information

    Parameters

    Name Datatype Description
    latitude double The latutude to transform
    longitude double The latutude to transform

    ObjectDefinitions

    Object GotMapEngine.ObjectDefinitions

    Container for the definitions of the objects that some of the functions in GotMap2 uses.


    ContextMenuOption

    Object GotMapEngine.GotMap.ObjectDefinitions.ContextMenuOption

    Note use '-' instedad of an ContextMenuOption object to create a separator in the contextmenu.

    Properties

    Name Datatype Description
    text string The text to be displayed in the contextmenu.
    callback function The callback function to be called when clicking the option in the contextmenu.
    context string OPTIONAL The context (this) in the callback, defaults to the GotMapinstanse.
    icon string OPTIONAL The url to the icon to be displayed in the contextmenu.

    GeoServerDefinition

    Object GotMapEngine.GotMap.ObjectDefinitions.GeoServerDefinition

    Properties

    Name Datatype Description
    Name string Short definition of the server
    Url string The rootUrl to the server
    WMSUrl string The url to be used for wms requests
    WMSCacheUrl string The url to be used for cached wms requests
    WFSUrl string The url to be used for wfs requests

    MenuBrand

    Object GotMapEngine.GotMap.ObjectDefinitions.MenuBrand

    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.

    MenuDefinition

    Object GotMapEngine.GotMap.ObjectDefinitions.MenuDefinition

    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.

    MenuItem

    Object GotMapEngine.GotMap.ObjectDefinitions.MenuItem

    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

    TileLayerDefinition

    Object GotMapEngine.GotMap.ObjectDefinitions.TileLayerDefinition

    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.WmsLayerDefinition

    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
    Description string OPTIONAL A description of the layer

    PointDefinition

    Object GotMapEngine.ObjectDefinitions.PointDefinition

    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.