-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.js
More file actions
65 lines (52 loc) · 1.26 KB
/
init.js
File metadata and controls
65 lines (52 loc) · 1.26 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
var app_lang = 'de';
var map,baseLayers,overlays;
$(function(){
map = initMap();
baseLayers = getBaseLayers();
//var overlays = getOverlays();
addLayers();
addControls();
});
function initMap(){
var maxB = new L.LatLngBounds(new L.LatLng(47.84,15.87),new L.LatLng(47.98,16.28));
var fitB = new L.LatLngBounds(new L.LatLng(47.87,16.00),new L.LatLng(47.96,16.16));
return new L.Map('map',
{
minZoom: 10,
maxZoom: 18,
maxBounds: maxB
}).fitBounds(
fitB
).locate({
watch: true,
setView: true,
maxZoom: 17
});
}
function getBaseLayers(){
var austrox = new L.TileLayer(
'http://rfmtc.no-ip.org/osm/austrox/tiles/{z}/{x}/{y}.png',
{ attribution: 'Map data © OpenStreetMap contributors - MapStyle AustroX (c) by Thomas Rupprecht' }
);
var osm = new L.TileLayer(
'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
{ attribution: 'Map data © OpenStreetMap contributors' }
);
return {
"AustroX": austrox,
"OpenStreetMap": osm
};
}
/*function getOverlays(){
return {
};
}*/
function addLayers(){
map.addLayer(baseLayers.AustroX);
//map.addLayer(baseLayers.OpenStreetMap);
//map.addLayer(overlays.xxx);
}
function addControls(){
map.addControl(new L.Control.Scale());
map.addControl(new L.Control.Layers(baseLayers,overlays));
}