From d1593fde1c7c3190aec15d45f8d0f2fb73f298c4 Mon Sep 17 00:00:00 2001 From: Boris Mericskay <boris.mericskay@univ-rennes2.fr> Date: Mon, 12 Apr 2021 20:39:42 +0000 Subject: [PATCH] Update Buildingmaps.html --- Buildingmaps.html | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/Buildingmaps.html b/Buildingmaps.html index 038568d..1a471b4 100644 --- a/Buildingmaps.html +++ b/Buildingmaps.html @@ -17,8 +17,7 @@ <script> - //Appel et configuration de la carte - + // Map configuration var map = new mapboxgl.Map({ container: 'map', style: 'https://openmaptiles.geo.data.gouv.fr/styles/osm-bright/style.json', //Fond de carte @@ -29,10 +28,11 @@ var map = new mapboxgl.Map({ minZoom:14.5 }); - // Ajout des données + // Add data (Geojson) map.on('load', function () { - //BATIMENTS + + // Building symbology (3D extrusion and color) map.addSource('Batiments', { type: 'geojson', @@ -43,9 +43,7 @@ map.addLayer({ 'id': 'Batiments', 'type': 'fill-extrusion', 'source': 'Batiments', - 'paint': - {'fill-extrusion-color': '#A9A9A9', - 'fill-extrusion-height':{'type': 'identity','property': 'HAUTEUR'}, + 'paint':{'fill-extrusion-height':{'type': 'identity','property': 'HAUTEUR'}, 'fill-extrusion-color': { 'property': 'HAUTEUR', 'stops': [ @@ -54,26 +52,20 @@ map.addLayer({ [9, '#d9ef8b'], [12, '#ffffbf'], [16, '#fee08b'], - [20, '#fc8d59'], + [20, '#fc8d59'], [30, '#d73027']]}, - 'fill-extrusion-opacity': 0.7, - 'fill-extrusion-base': 0} + 'fill-extrusion-opacity': 0.7, + 'fill-extrusion-base': 0} }); + }); - }); - - - - - // Ajout controle de navigation et echelle + // Add navigation control and scale map.addControl(new mapboxgl.NavigationControl({position: 'top-left'})); - map.addControl(new mapboxgl.ScaleControl({position: 'bottom-right'})); - </script> </body> -</html> \ No newline at end of file +</html> -- GitLab