Class: Map

MobileAge.Component.Map(dom, options)

Map-Component

Constructor

new Map(dom, options)

Class representing a single Map component.
Parameters:
Name Type Description
dom string Id, css-query or a ElementNode to connect to.
options Object
Properties
Name Type Attributes Default Description
tileserver_url String <optional>
"window.location.protocol + '//' + 'geo.mobile-age.eu/tiles/" Base URI of a public tile-server serving tiles in standard format (http://URI/zoom/x/y.png)
fullsize Boolean <optional>
false Wether to display the map in full screen size
centerLat Number <optional>
0 The latitude to center the map at initially in "Web Mercator (EPSG:3857/900913)" projection
centerLng Number <optional>
0 The longitude to center the map at initially in "Web Mercator (EPSG:3857/900913)" projection
zoom Number <optional>
14 The initial zoom level of the map's viewport. Possible values: 1 to 18
zoomControl Boolean <optional>
true Wether to display the map in full screen size
zoomControlPosition String <optional>
'bottomleft' The position of the zoom control buttons. Possible values: 'topleft', 'topright', 'bottomleft', 'bottomright'
zoomInText String <optional>
'+' The text set on the 'zoom in' button.
zoomInTitle String <optional>
'Zoom in' The title set on the 'zoom in' button.
zoomOutText String <optional>
'&#x2212' The text set on the 'zoom out' button.
zoomOutTitle String <optional>
'Zoom out' The title set on the 'zoom out' button.
attribution String <optional>
"Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http:/ftb-esv.de">FTB</a>" The attribution added to the bottom right corner of the map.
Source:

Extends

  • Component

Methods

(static) _create()

Creates a Map-Component
Source:

(static) _debounce()

debounces a function call
Source:

(static) _drawLayer(layerDefinition)

Draw a layer initially to the map (without debounce)
Parameters:
Name Type Description
layerDefinition layer definition of the layer, which shall be drawn
Source:

(static) _updateLayers(array)

Update the layers that are added to the map (debounced, called if map is idle)
Parameters:
Name Type Description
array layers of layerDefinition - definition of the markers, which shall be received
Source:

(static) addLayer()

Adds a layer to the map
Parameters:
Type Description
layerDefinition definition of what shall be added
Source:

(static) getMap()

Optionally inits and returns the Leaflet instance of the map
Source:

(static) getMap()

Returns the Leaflet map for further customization (public interface)
Source:

(static) removeLayer()

Removes a layer from the map
Parameters:
Type Description
layerDefinition definition of what shall be added
Source:

(static) showCurrentLocation(showopt, optionsopt)

Display current position on the map
Parameters:
Name Type Attributes Description
show Boolean <optional>
whether to show the location
options object <optional>
Properties
Name Type Attributes Default Description
iconUrl String <optional>
Base64-encoded icon URI of the image used as marker.
iconWidth Number <optional>
64 Width of the icon.
iconHeight Number <optional>
51 Height of the icon.
zoomLevel Number <optional>
Zoom level to set when showing location on map
setView Boolean <optional>
true Center map to found location
focusInitially Boolean <optional>
false Center map to found location only on the first retrieval. Afterwards options.setView is set to false.
watch Boolean <optional>
false Continous refresh of location
Source: