<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Animate the camera along a path</title>
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
<link href='css/mapbox.css' rel='stylesheet' />
<link rel="stylesheet" href="css/my.css">
<script src="https://api.mapbox.com/mapbox-gl-js/v2.9.2/mapbox-gl.js"></script>
<style>
body {
margin: 0;
padding: 0;
}
#map {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
}
</style>
</head>
<body>
<div id="map"></div>
<div id="parent">
<div class="divhead">智慧电商酷炫系统 </div>
<div class="divt"> </div>
<div class="divall"> </div>
<!-- <div class="divleft"> </div>
<div class="divright"> </div> -->
<div class="div7"> </div>
<div class="div8"> </div>
<div class="div9"> </div>
<div class="div10"> </div>
<div class="div11"> </div>
<div class="div12"> </div>
<div id="da1"> </div>
</div>
<script src="js/echarts.min.js"></script>
<script type="text/javascript" src=" js/jquery.min.js"></script>
<script src="./js/my.js"></script>
<script>
// TO MAKE THE MAP APPEAR YOU MUST
// ADD YOUR ACCESS TOKEN FROM
// https://account.mapbox.com
mapboxgl.accessToken = 'pk.eyJ1IjoiZ3V2aXZhIiwiYSI6ImNranBzaTNhNjFmaDkyc3Fwdzl0ZTZ4Z3UifQ.n3irOnfErJxXZRTcpnpQ-w';
var height = 100;
var map = new mapboxgl.Map({
container: 'da1',
style: 'mapbox://styles/mapbox/dark-v9',
center: [121.50113734499996, 31.237367840599973],
zoom: 15,
pitch: 65,
bearing: -17.6
});
var popup = new mapboxgl.Popup({
closeButton: false,
closeOnClick: false,
});
map.on('load', function () {
var layers = map.getStyle().layers;
var labelLayerId;
for (var i = 0; i < layers.length; i++) {
if (layers[i].type === 'symbol' && layers[i].layout['text-field']) {
labelLayerId = layers[i].id;
break;
}
}
map.addLayer({
'id': '3d-buildings',
'source': 'composite',
'source-layer': 'building',
'filter': ['==', 'extrude', 'true'],
'type': 'fill-extrusion',
'minzoom': 15,
'paint': {
'fill-extrusion-color': [
'interpolate',
['linear'],
['get', 'height'],
0, '#845EC2',
75, '#86A8E7',
150, "#5FFBF1",
],
'fill-extrusion-height': ['get', 'height'],
'fill-extrusion-opacity': .6
}
});
map.on('mousemove', '3d-buildings', function (e) {
map.getCanvas().style.cursor = 'pointer';
var aggregate = Math.round(Math.random()*100+100);
var agg_freq = Math.round(Math.random()*100+200);
// .mapboxgl-Popup-content
popup.setLngLat(e.lngLat)
.setHTML('<strong> 总计收件: </strong>' + aggregate +
'<p> <strong> 总计送件: </strong>' + agg_freq + '</p>')
.addTo(map);
});
map.on('mouseleave', '3d-buildings', function () {
map.getCanvas().style.cursor = '';
popup.remove();
});
});
</script>
</body>
</html>
viva302
- 粉丝: 0
- 资源: 2
最新资源
- MQTT协议的原理、特点、工作流程及应用场景
- Ruby语言教程从介绍入门到精通详教程跟代码.zip
- PM2.5-Prediction-Based-on-Random-Forest-Algorithm-master.zip
- Delphi开发详解:从入门到高级全面教程
- 物理机安装群晖DS3617教程(用U盘做引导)
- 使用jQuery实现一个加购物车飞入动画
- 本项目旨在开发一个基于情感词典加权组合方式的文本情感分析系统,通过以下几个目标来实现: 构建情感词典:收集并整理包含情感极性(正面或负面)的词汇 加权组合:通过加权机制,根据词汇在文本中的重要性、
- Visual Basic从入门到精通:基础知识与实践指南
- 炫酷文本粒子threejs特效
- hreejs地球世界轮廓线条动画
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈