MapLayer.kt
1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package map
/**
* Enumeration for all supported map layers.
*
* @author Stefan Saring
*/
enum class MapLayer(val displayName: String, val javaScriptCode: String) {
/** OpenStreetMap layer. */
OPENSTREETMAP("OpenStreetMap", """
L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: 'Map data © OpenStreetMap and contributors', noWrap: true
})"""),
/** OpenCycleMap layer. */
OPENCYCLEMAP("OpenCycleMap", """
L.tileLayer('http://{s}.tile.opencyclemap.org/cycle/{z}/{x}/{y}.png', {
attribution: '© OpenCycleMap, Map data © OpenStreetMap contributors', noWrap: true
})"""),
/** Hike & bike maps layer (HikeBikeMap.org). */
HIKE_BIKE_MAP("Hike & Bike Map", """
L.tileLayer('http://{s}.tiles.wmflabs.org/hikebike/{z}/{x}/{y}.png', {
attribution: '© HikeBikeMap.org, Map data © OpenStreetMap and contributors', noWrap: true
})"""),
/** MTB map (mtbmap.cz). */
MTB_MAP("MTB Map", """
L.tileLayer('http://tile.mtbmap.cz/mtbmap_tiles/{z}/{x}/{y}.png', {
attribution: '© OpenStreetMap and USGS', noWrap: true
})"""),
/** MapBox layer in streets mode (consider: a project specific access token is required!). */
MAPBOX("MapBox", """
L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', {
id: 'mapbox.streets',
attribution: 'Map data © OpenStreetMap contributors, Imagery © Mapbox', noWrap: true
})""")
}