Skip to main content

README

#Set the layer visual level

You can customize the maximum and minimum levels that the current layer can display.

show
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Set layer visual level</title>
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no"/>
<style>
body {
margin: 0;
padding: 0;
}

#map {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
}
</style>
<script src="https://delivery.mapmost.com/cdn/sdk/webgl/v9.16.0/mapmost-webgl-min.js"></script>
</head>
<body>
<div id="map"></div>
<script>
let map = new mapmost.Map({
container: 'map',
style: "<your style url>",
center: [120.72541613154851, 31.31171803927643],
zoom: 14,
pitch:60,
userId: '***', // Authorization code
});

map.on('load', function () {

// Set layers 13-15 to be visible within layers
map.addLayer({
"id": "building-hig",
"type": "fill-extrusion",
"source": "cultural",
"source-layer": "b_buildings",
"layout": {
"visibility": "visible",
},
"minzoom": 13,
"maxzoom": 15,
"paint": {
"fill-extrusion-height": ["get", "jzzgdgd"],
"fill-extrusion-color": {
"stops": [
[
14.5,
"rgba(252, 254, 255, 1)"
],
[
16,
"rgba(255, 255, 255, 1)"
]
]
},
"filter": [">=", "dscs", 18]
}
})
})
</script>
</body>
</html>