大佬教程收集整理的这篇文章主要介绍了在 iframe MapBox 嵌入地图中隐藏搜索框,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我成功地按照 MapBox iframe 教程 (https://docs.mapbox.com/Help/glossary/iframe/) 在我的网站中添加了地图,现在我需要从地图中隐藏搜索框,我想在字符串中添加了一些额外的参数,但是无法弄清楚如何。 感谢您的帮助。
this is the map with the search box that I need to hide
在 iframe 的情况下没有隐藏或显示地图控制框的参数,我建议使用 javascript Api 访问大量参数来控制您的嵌入地图
重要:撤销您的访问令牌,因为您不应该公开您的密钥
mapboxgl.accessToken = 'pk.eyJ1IjoiYXZpb3BvcnRvbGFubyIsImEiOiJja212cmrrd2QwN3dzMnZuMXV2d25xbWsxIn0.x3y36v9arY9wmBOCZlCXUA#15/37.771/-122.436';
var map = new mapboxgl.Map({
container: 'map',// container id
style: 'mapbox://styles/mapbox/streets-v11',// style URL
center: [-74.5,40],// starTing position [lng,lat]
zoom: 9 // starTing zoom
});
body { margin: 0; padding: 0; }
#map { position: absolute; top: 0; bottom: 0; width: 100%; }
<link href="https://api.mapbox.com/mapbox-gl-js/v2.2.0/mapbox-gl.css" rel="stylesheet">
<script src="https://api.mapbox.com/mapbox-gl-js/v2.2.0/mapbox-gl.js"></script>
<div id="map"></div>
以上是大佬教程为你收集整理的在 iframe MapBox 嵌入地图中隐藏搜索框全部内容,希望文章能够帮你解决在 iframe MapBox 嵌入地图中隐藏搜索框所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。