Browse Source

Mapa passa a usar os tiles servidos pela Stadiamaps.com

pull/167/head
Sesóstris Vieira 1 year ago
parent
commit
29dd4bdc64
  1. 31
      sigi/apps/home/templates/home/openmap.html

31
sigi/apps/home/templates/home/openmap.html

@ -24,11 +24,9 @@
</script> </script>
<script src="https://code.jquery.com/jquery-3.6.0.min.js" <script src="https://code.jquery.com/jquery-3.6.0.min.js"
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script> integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
<!-- script src="https://code.jquery.com/ui/1.13.1/jquery-ui.min.js" integrity="sha256-eTyxS0rkjpLEo16uXTS0uVCS4815lc40K2iVpWDvdSY=" crossorigin="anonymous"></script -->
<script src="https://unpkg.com/leaflet@1.9.3/dist/leaflet.js" <script src="https://unpkg.com/leaflet@1.9.3/dist/leaflet.js"
integrity="sha256-WBkoXOwTeyKclOHuWtc+i2uENFpDZ9YPdf5Hf+D7ewM=" integrity="sha256-WBkoXOwTeyKclOHuWtc+i2uENFpDZ9YPdf5Hf+D7ewM="
crossorigin=""></script> crossorigin=""></script>
<script type="text/javascript" src="https://stamen-maps.a.ssl.fastly.net/js/tile.stamen.js?v1.3.0"></script>
<script type="text/javascript" src="{% static "admin/js/core.js" %}"></script> <script type="text/javascript" src="{% static "admin/js/core.js" %}"></script>
{% endblock %} {% endblock %}
@ -87,6 +85,15 @@
{{ block.super }} {{ block.super }}
<script type="text/javascript" src="{% static 'js/search.js' %}"></script> <script type="text/javascript" src="{% static 'js/search.js' %}"></script>
<script> <script>
const stadia_tiles_options = {
attribution:
`
&copy; <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a>
&copy; <a href="https://stamen.com/" target="_blank">Stamen Design</a>
&copy; <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a>
&copy; <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>"
`
};
var mymap; var mymap;
var orgao_layer_group = L.layerGroup(); var orgao_layer_group = L.layerGroup();
var map_center = [-14.235004, -51.92528]; var map_center = [-14.235004, -51.92528];
@ -98,15 +105,27 @@
$("input[type=checkbox]").change(filtra); $("input[type=checkbox]").change(filtra);
var base_layers = { var base_layers = {
"Terrain": new L.StamenTileLayer("terrain"), "Toner": L.tileLayer(
"https://tiles.stadiamaps.com/tiles/stamen_toner/{z}/{x}/{y}{r}.png",
stadia_tiles_options,
),
"Toner lite": L.tileLayer(
"https://tiles.stadiamaps.com/tiles/stamen_toner_lite/{z}/{x}/{y}{r}.png",
stadia_tiles_options,
),
"Terrain": L.tileLayer(
"https://tiles.stadiamaps.com/tiles/stamen_terrain/{z}/{x}/{y}{r}.png",
stadia_tiles_options,
),
"Water color": L.tileLayer(
"https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.jpg",
stadia_tiles_options,
),
"Open street": L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', { "Open street": L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: 'Map data and imagery &copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, ', attribution: 'Map data and imagery &copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, ',
id: 'mapbox/streets-v11',
tileSize: 512, tileSize: 512,
zoomOffset: -1 zoomOffset: -1
}), }),
"Water color": new L.StamenTileLayer("watercolor"),
"Toner": new L.StamenTileLayer("toner")
}; };

Loading…
Cancel
Save