Repository navigation
Expand file tree
/
Copy pathdefault.js
More file actions
77 lines (76 loc) · 2.52 KB
/
Copy pathdefault.js
File metadata and controls
77 lines (76 loc) · 2.52 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import i18n from './i18n'
// the default config, maps.config.js is merged into it: objects are merged, all other values,
// including arrays like maps, are replaced
export default {
brand: {},
view: {
center: [
52.51,
13.37628,
],
zoom: 10,
minZoom: 0,
maxZoom: 20,
},
geolocate: {
maxZoom: 18,
},
search: {
url: 'https://nominatim.openstreetmap.org/search',
maxZoom: 18,
},
panes: {
maxLevel: 3,
},
thumbnail: '13/4400/2686',
// the options of the tiles, like the transition, the duration in milliseconds in which they fade in,
// missing options use the defaults of openlayers
tiles: {},
// which parts of the interface are shown: the search, the buttons in the nav, the button of a pane which opens
// the modal to choose its map, and the filmstrip, a strip with the thumbnails of all maps above the search and
// the buttons
show: {
search: true,
zoom: true,
geolocate: true,
grid: true,
crosshair: true,
labels: true,
options: true,
modal: true,
filmstrip: false,
},
// the external maps which can show the current view, {zoom}, {lat} and {lng} in the url are replaced,
// urls without them get the view appended as #map=zoom/lat/lng, like on openstreetmap.org,
// the url can also be a function which gets { zoom, lat, lng } and returns the url
external: [
{
name: 'OpenStreetMap',
url: 'https://www.openstreetmap.org/',
},
{
name: 'Google Maps',
url: 'https://www.google.com/maps/@{lat},{lng},{zoom}z',
},
{
name: 'Google Earth',
// google earth uses the distance of the camera in meters instead of a zoom level, it is estimated from
// the meters per pixel at the zoom level for a screen of about 800 pixels height and its 35° field of view
url: ({ zoom, lat, lng }) => {
const metersPerPixel = 156543 * Math.cos(lat * Math.PI / 180) / 2 ** zoom
const distance = Math.round(800 * metersPerPixel / (2 * Math.tan(17.5 * Math.PI / 180)))
return `https://earth.google.com/web/@${lat},${lng},0a,${distance}d,35y,0h,0t,0r`
},
},
],
// the texts of the interface by language, the language is taken from the browser, see src/config/i18n.js
i18n,
// the maps, either as a flat array or in groups like { name, maps }
maps: [
{
name: 'OpenStreetMap',
url: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
attribution: '<a href="https://www.openstreetmap.org/copyright">OpenStreetMap contributors</a>',
},
],
}