mapbox 分屏对比2

编程入门 行业动态 更新时间:2024-10-18 18:26:49

<a href=https://www.elefans.com/category/jswz/34/1770319.html style=mapbox 分屏对比2"/>

mapbox 分屏对比2

这个是纯手写

 mapboxgl 

<template><div class="hello" style="height: 100%; width: 100%; position: relative"><divclass="map1"id="map1"style="width: 50%; height: 100%; float: left"></div><divclass="map1"id="map2"style="width: 50%; height: 100%; float: left"></div></div>
</template>
<script>
import { syncMaps } from "./mapbox-gl-sync-move";
export default {name: "Map",components: {},data() {return {};},watch: {},methods: {initmap() {var map1 = new mapboxgl.Map({container: "map1",style: window.beforestyle,zoom: 12,center: [117.72, 39.05],});var map2 = new mapboxgl.Map({container: "map2",style: window.afterstyle,zoom: 12,center: [117.72, 39.05],});syncMaps(map1, map2);},},mounted() {this.initmap();},
};
</script>
<style scoped>
.map {position: absolute;top: 0;bottom: 0;width: 100%;
}
</style>

更多推荐

mapbox 分屏对比2

本文发布于:2024-03-06 14:27:55,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1715547.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:mapbox

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!