Connection to database failed: Possibly the server was restarted. It takes about 10 minutes to read the database. Please try again later!
Verbindung zur Datenbank fehlgeschlagen: Eventuell wurde der Server neu gestartet.
Das Einlesen der Datenbank dauert etwa 10 Minuten. Bitte versuchen Sie es später noch einmal!
let url = location.protocol + "//" + location.host + "/img/";
let map = L.map('map', {
center: [53.162802869958,7.3447465896606],
zoom: 15,
zoomControl: false,
tap: false
});
//Layers - OSM is pre selected
//variable for OSM
let OpenStreetMap_DE = L.tileLayer('https://{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png', {
maxZoom: 19,
attribution: '© OpenStreetMap contributors'
}).addTo(map);
//Variables for Bing
let BING_KEY = 'AlqnXp9wAwXT2E5_GRJanH9Xrx-olcRR7s8LBnkbiOkD6w-2Z4Cw4l3zuLZFN35M'
//Bing aerial
let bingLayerAerial = L.tileLayer.bing(BING_KEY)
//Bing road
let bingLayerRoad = L.tileLayer.bing({
bingMapsKey: BING_KEY,
imagerySet: 'RoadOnDemand',
culture: 'de_DE'
})
//openRailway
let OpenRailwayMap = L.tileLayer('https://{s}.tiles.openrailwaymap.org/standard/{z}/{x}/{y}.png', {
maxZoom: 19,
attribution: 'Map data: © OpenStreetMap contributors | Map style: © OpenRailwayMap (CC-BY-SA)'
})
//draw circle
let circle = L.circle([53.162802869958,7.3447465896606], {
radius: 1000,
color: '#18BC9C',
fillOpacity: 0.05
});
circle.addTo(map);
//city boarders = Polygon
//Marker Icons
let LeafIcon = L.Icon.extend({
options: {
iconSize: [32, 37],
}
}
)
let cityMarker = new LeafIcon (
{
iconUrl: url + "stadt-icon.png"
}
)
let stopMarker = new LeafIcon (
{
iconUrl: url + "2726.png"
}
)
let stationMarker = new LeafIcon (
{
iconUrl: url + "2725.png"
}
)
let restaurantMarker = new LeafIcon (
{
iconUrl: url + ".png"
}
)
let myPositionMarker = new LeafIcon (
{
iconUrl: url + "myPosition.png"
}
)
//Center Icon
let centerMarker = L.marker([53.162802869958,7.3447465896606], {icon: myPositionMarker})
centerMarker.bindPopup('Mein Standort
53.162802869958,7.3447465896606').addTo(map);
function popUp(f,l){
let out = [];
if (f.properties){
for(key in f.properties){
if (key === 'name') {
f.properties[key] = '
'+ f.properties[key] + '
';
}
out.push(f.properties[key]);
}
l.bindPopup(out.join("
"));
}
}
let hs = new L.geoJSON({"type": "FeatureCollection", "features": [{type: "Feature", "properties": {"name": "Abzw. Holthusen", "street": "Graf-Ulrich-Stra\u00dfe 72", "URL": "Show details<\/a>"}, "geometry": {"type":"Point","coordinates":[7.3392963409424,53.155520773277]}},{type: "Feature", "properties": {"name": "M\u00fchlenstra\u00dfe", "street": "Kreuzstra\u00dfe 5", "URL": "Show details<\/a>"}, "geometry": {"type":"Point","coordinates":[7.3468065261841,53.159895325797]}},{type: "Feature", "properties": {"name": "Suidbroekstra\u00dfe", "street": "Suidbroekstra\u00dfe 1", "URL": "Show details<\/a>"}, "geometry": {"type":"Point","coordinates":[7.3346185684204,53.162597032602]}},{type: "Feature", "properties": {"name": "Weener Friedhof", "street": "Rathausstra\u00dfe 1", "URL": "Show details<\/a>"}, "geometry": {"type":"Point","coordinates":[7.3522567749023,53.163137353557]}},{type: "Feature", "properties": {"name": "Pestalozzischule", "street": "B\u00fcrgermeister-Werner-Stra\u00dfe 32", "URL": "Show details<\/a>"}, "geometry": {"type":"Point","coordinates":[7.3556470870972,53.163471834549]}},{type: "Feature", "properties": {"name": "Floorenstra\u00dfe\/Schule", "street": "Bahnhofstra\u00dfe 13c", "URL": "Show details<\/a>"}, "geometry": {"type":"Point","coordinates":[7.3468065261841,53.164166517511]}},{type: "Feature", "properties": {"name": "Schmiede", "street": "Norderstra\u00dfe 6", "URL": "Show details<\/a>"}, "geometry": {"type":"Point","coordinates":[7.3550462722778,53.165221384952]}},{type: "Feature", "properties": {"name": "Neue Stra\u00dfe", "street": "Neue Strasse 1", "URL": "Show details<\/a>"}, "geometry": {"type":"Point","coordinates":[7.3561191558838,53.167356768938]}},{type: "Feature", "properties": {"name": "H\u00fctthaussiedlung", "street": "Bunder Stra\u00dfe 8", "URL": "Show details<\/a>"}, "geometry": {"type":"Point","coordinates":[7.3364210128784,53.168488736634]}},]}, {
pointToLayer: function(point, latlng) {
return L.marker(latlng, {icon: stopMarker});
},
onEachFeature: popUp
});
let hsCluster = L.markerClusterGroup();
hs.addTo(hsCluster);
hsCluster.addTo(map);
let station =L.geoJSON({"type": "FeatureCollection", "features": [{type: "Feature", "properties": {"name": "Bahnhof", "street": "Graf-Edzard-Strasse 1", "URL": "Show details<\/a>"}, "geometry": {"type":"Point","coordinates":[7.3447465896606,53.162802869958]}},{type: "Feature", "properties": {"name": "Bahnhof", "street": "Graf-Edzard-Stra\u00dfe 3", "URL": "Show details<\/a>"}, "geometry": {"type":"Point","coordinates":[7.3447465896606,53.162802869958]}},]}, {
pointToLayer: function(point, latlng) {
return L.marker(latlng, {icon: stationMarker});
},
onEachFeature: popUp
});
let stationCluster = L.markerClusterGroup();
station.addTo(stationCluster);
stationCluster.addTo(map);
//variable for control.layer
let basemaps = {
"OpenStreetMap": OpenStreetMap_DE,
"Bing Strasse": bingLayerRoad,
"Bing Luftbild": bingLayerAerial,
"Bahnstrecken": OpenRailwayMap
};
let overlays = {
"My Position": centerMarker,
"Stops": hsCluster,
"Station": stationCluster,
}
//control for zoom
L.control.zoom({
zoomInTitle: 'hineinzoomen',
zoomOutTitle: 'herauszoomen',
zoomInText: '',
zoomOutText: '',
}).addTo(map);
//Layer control
L.control.layers(basemaps,overlays).addTo(map);