Browse Source

switch to mapbox maps. closes #25

main
Aaron Parecki 2 years ago
parent
commit
460f708eb9
1 changed files with 15 additions and 4 deletions
  1. +15
    -4
      compass/public/assets/map.js

+ 15
- 4
compass/public/assets/map.js View File

@ -1,9 +1,20 @@
var map = L.map('map', { zoomControl: false }).setView([45.516, -122.660], 14, null, null, 24);
var layer = L.esri.basemapLayer("Topographic");
layer.maxZoom = 24;
layer.maxNativeZoom = 24;
layer.addTo(map);
// var layer = L.esri.basemapLayer("Topographic");
// layer.maxZoom = 24;
// layer.maxNativeZoom = 24;
// layer.addTo(map);
var opts = {
attribution: 'Map data &copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="https://www.mapbox.com/">Mapbox</a>',
maxZoom: 24,
zoomOffset: -1,
tileSize: 512,
id: 'mapbox/light-v10',
accessToken: 'pk.eyJ1IjoiYWFyb25wayIsImEiOiJja3A0eXV2ZXIwMGt3MnVuc2Uzcm1yYzFuIn0.-_qwPOLRiQk8t56xs6vkfg'
};
L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', opts).addTo(map);
new L.Control.Zoom({ position: 'topleft' }).addTo(map);

Loading…
Cancel
Save