Skip to content

Commit

Permalink
reduce layers to open street map only
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcel Riedel authored and Marcel Riedel committed Aug 22, 2023
1 parent 3af420f commit cb30a89
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 38 deletions.
30 changes: 10 additions & 20 deletions src/nodes/extrafeature/extrafeature_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,38 +22,28 @@ ExtrafeatureView.Prototype = function() {
this.initMap = function(id, coord) {

// set tile layers:
var mapLayer = L.tileLayer.wms("https://basemap.dainst.org/osm/wms?service=WMS", {
layers: "osm:Vector--color-slow",
tiled: true,
format: "image/jpeg",
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
});

var imageryLayer = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
attribution: '© Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community'
var mapLayer = L.tileLayer.wms("https://tile.openstreetmap.de/{z}/{x}/{y}.png", {
tiled: true,
format: "image/jpeg",
attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap contributors</a>'
});

var baseMaps = {
"Open Street Map": mapLayer,
"World imagery": imageryLayer
};

var location = {lat: coord[1], lng: coord[0]};

var map = L.map(
document.getElementById("map_" + id), {
zoom: 6,
doubleClickZoom: false,
dragging: false,
zoomSnap: false,
trackResize: false,
touchZoom: false,
scrollWheelZoom: false,
center: location,
});

// disable zooming by scroll wheel:
map.scrollWheelZoom.disable();

// show mapLayer by default:
mapLayer.addTo(map);

// add all layers to layer-control
L.control.layers(baseMaps).addTo(map);
L.control.scale().addTo(map); // show dynamic scale (Maßstab)

// add a marker to location:
Expand Down
26 changes: 8 additions & 18 deletions src/nodes/supplement/supplement_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,38 +22,28 @@ SupplementView.Prototype = function() {
this.initMap = function(id, coord) {

// set tile layers:
var mapLayer = L.tileLayer.wms("https://basemap.dainst.org/osm/wms?service=WMS", {
layers: "osm:Vector--color-slow",
var mapLayer = L.tileLayer.wms("https://tile.openstreetmap.de/{z}/{x}/{y}.png", {
tiled: true,
format: "image/jpeg",
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap contributors</a>'
});

var imageryLayer = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
attribution: '© Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community'
});

var baseMaps = {
"Open Street Map": mapLayer,
"World imagery": imageryLayer
};

var location = {lat: coord[1], lng: coord[0]};

var map = L.map(
document.getElementById("map_" + id), {
zoom: 6,
doubleClickZoom: false,
dragging: false,
zoomSnap: false,
trackResize: false,
touchZoom: false,
scrollWheelZoom: false,
center: location,
});

// disable zooming by scroll wheel:
map.scrollWheelZoom.disable();

// show mapLayer by default:
mapLayer.addTo(map);

// add all layers to layer-control
L.control.layers(baseMaps).addTo(map);
L.control.scale().addTo(map); // show dynamic scale (Maßstab)

// add a marker to location:
Expand Down

0 comments on commit cb30a89

Please sign in to comment.