Répare la carte
This commit is contained in:
parent
2e92d5aa8a
commit
18d1d53c45
3 changed files with 10 additions and 4 deletions
|
@ -83,10 +83,10 @@ function InterfaceRecherche(STATIC_ROOT, API_LIEU, MAPBOX_API_KEY, ITEMS_URL, li
|
||||||
function initCarte() {
|
function initCarte() {
|
||||||
if (map !== undefined) return;
|
if (map !== undefined) return;
|
||||||
map = L.map("carte").panTo([30, 15]).setZoom(1);
|
map = L.map("carte").panTo([30, 15]).setZoom(1);
|
||||||
var layer = L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}', {
|
var layer = L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {
|
||||||
attribution: 'Map data © <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>',
|
attribution: 'Map data © <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: 18,
|
maxZoom: 18,
|
||||||
id: 'mapbox.streets',
|
id: 'mapbox/streets-v11',
|
||||||
accessToken: MAPBOX_API_KEY
|
accessToken: MAPBOX_API_KEY
|
||||||
});
|
});
|
||||||
map.addLayer(layer);
|
map.addLayer(layer);
|
||||||
|
|
|
@ -6,6 +6,9 @@
|
||||||
{% block extra_head %}
|
{% block extra_head %}
|
||||||
<script src="{% static 'js/toc.min.js' %}" type="text/javascript"></script>
|
<script src="{% static 'js/toc.min.js' %}" type="text/javascript"></script>
|
||||||
<script type="text/javascript" src="{% static "js/leaflet.js" %}"></script>
|
<script type="text/javascript" src="{% static "js/leaflet.js" %}"></script>
|
||||||
|
<script src='https://api.mapbox.com/mapbox-gl-js/v2.0.0/mapbox-gl.js'></script>
|
||||||
|
<link href='https://api.mapbox.com/mapbox-gl-js/v2.0.0/mapbox-gl.css' rel='stylesheet' />
|
||||||
|
<script src="https://cdn.maptiler.com/mapbox-gl-leaflet/latest/leaflet-mapbox-gl.js"></script>
|
||||||
<link rel="stylesheet" type="text/css" href="{% static "css/leaflet.css" %}" />
|
<link rel="stylesheet" type="text/css" href="{% static "css/leaflet.css" %}" />
|
||||||
<script type="text/javascript" src="{% static "js/tile.stamen.js" %}"></script>
|
<script type="text/javascript" src="{% static "js/tile.stamen.js" %}"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
@ -13,10 +16,10 @@
|
||||||
var STATIC_ROOT = "{{ STATIC_URL|escapejs }}";
|
var STATIC_ROOT = "{{ STATIC_URL|escapejs }}";
|
||||||
function initStageMap(lieux) {
|
function initStageMap(lieux) {
|
||||||
var map = L.map("stage-map");
|
var map = L.map("stage-map");
|
||||||
var layer = L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}', {
|
var layer = L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {
|
||||||
attribution: 'Map data © <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>',
|
attribution: 'Map data © <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: 18,
|
maxZoom: 18,
|
||||||
id: 'mapbox.streets',
|
id: 'mapbox/streets-v11',
|
||||||
accessToken: "{{ MAPBOX_API_KEY|escapejs }}"
|
accessToken: "{{ MAPBOX_API_KEY|escapejs }}"
|
||||||
});
|
});
|
||||||
map.addLayer(layer);
|
map.addLayer(layer);
|
||||||
|
|
|
@ -10,6 +10,9 @@
|
||||||
<link rel="stylesheet" type="text/css" href="{% static 'css/leaflet.css' %}" />
|
<link rel="stylesheet" type="text/css" href="{% static 'css/leaflet.css' %}" />
|
||||||
<link rel="stylesheet" type="text/css" href="{% static 'css/MarkerCluster.css' %}" />
|
<link rel="stylesheet" type="text/css" href="{% static 'css/MarkerCluster.css' %}" />
|
||||||
<link rel="stylesheet" type="text/css" href="{% static 'css/MarkerCluster.Default.css' %}" />
|
<link rel="stylesheet" type="text/css" href="{% static 'css/MarkerCluster.Default.css' %}" />
|
||||||
|
<script src='https://api.mapbox.com/mapbox-gl-js/v2.0.0/mapbox-gl.js'></script>
|
||||||
|
<link href='https://api.mapbox.com/mapbox-gl-js/v2.0.0/mapbox-gl.css' rel='stylesheet' />
|
||||||
|
<script src="https://cdn.maptiler.com/mapbox-gl-leaflet/latest/leaflet-mapbox-gl.js"></script>
|
||||||
<script type="text/javascript" src="{% static "js/render.js" %}"></script>
|
<script type="text/javascript" src="{% static "js/render.js" %}"></script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue