当前位置:网站首页>Further optimize Baidu map data visualization
Further optimize Baidu map data visualization
2022-04-23 17:03:00 【Eli-sun】
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
html, body{
height: 100%;
height: 100%;
margin: 0;
padding: 0;
}
#map{
height: 100%;
width: 100%;
margin: 0;
padding: 0;
}
.anchorBL, .BMap_cpyCtrl{
display: none;
}
</style>
</head>
<body>
<div id="map"></div>
<script>
console.log(window.BMapGL);
function init(){
var map = new BMapGL.Map('map') // Initialize map
var point = new BMapGL.Point(116.404,39.915) // Set map coordinates
map.centerAndZoom(point, 10) // Central Map display level
map.enableScrollWheelZoom(true) // Zoom in and out of the map through the scroll wheel
}
// onload Page loading complete
window.onload = function() {
// src="https://api.map.baidu.com/api?v=1.0&type=webgl&ak=cXG18I5SNt2EZNvG7CVyE4jjTr8swlo4"
var script = document.createElement('script')
// To initialize the map, you can src Add one at the end &callback=init Add one more callback Parameter this parameter points to init Method
script.src = "https://api.map.baidu.com/api?v=1.0&type=webgl&ak=cXG18I5SNt2EZNvG7CVyE4jjTr8swlo4&callback=init"
document.body.appendChild(script)
}
</script>
</body>
</html>
版权声明
本文为[Eli-sun]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230554289772.html
边栏推荐
猜你喜欢
Deepinv20 installation MariaDB
Detailed explanation of the penetration of network security in the shooting range
PyMySQL
STM32__03—初识定时器
Selenium IDE and XPath installation of chrome plug-in
文件操作《二》(5000字总结篇)
STM32__ 03 - beginner timer
TypeError: set_figure_params() got an unexpected keyword argument ‘figsize‘
Rtklib 2.4.3 source code Notes
Mock test using postman
随机推荐
[markdown notes]
Freecodecamp ---- budget & category exercise
TypeError: set_ figure_ params() got an unexpected keyword argument ‘figsize‘
Wiper component encapsulation
Redis docker installation
ACL 2022 | dialogved: a pre trained implicit variable encoding decoding model for dialogue reply generation
1-4 configuration executable script of nodejs installation
MySQL master-slave replication
Preliminary understanding of promse
Your brain expands and shrinks over time — these charts show how
How to implement distributed locks with redis?
信息摘要、数字签名、数字证书、对称加密与非对称加密详解
How to choose the wireless gooseneck anchor microphone and handheld microphone scheme
Bytevcharts visual chart library, I have everything you want
聊一聊浏览器缓存控制
Quick install mongodb
拷贝构造函数 浅拷贝与深拷贝
Detailed explanation of the penetration of network security in the shooting range
计算饼状图百分比
[C#] 彻底搞明白深拷贝