1.使用arcgis api for js,地图底部会有一行esri公司的一些信息
2. 代码设置不添加地图底部属性即可:
view.ui.remove("attribution");
3.项目完整代码如下:
<script setup>
import { onMounted } from "vue";
import WebScene from "@arcgis/core/WebScene";
import SceneView from "@arcgis/core/views/SceneView";
onMounted(() => {
MapInit();
});
function MapInit() {
let scene = new WebScene({
portalItem: {
id: "579f97b2f3b94d4a8e48a5f140a6639b",
portal: "https://www.arcgis.com",
},
ground: "flat",
layers: [],
});
let view = new SceneView({
container: "map_box",
map: scene,
camera: {
position: [118.29597977877853, 32.2673315514992, 210.6],
tilt: 75.6,
heading: 65,
},
});
// 关键是这个 ↓↓↓
// "view"和前面代码创建地图实例时,变量名view一致!
view.ui.remove("attribution");
// 关键是这个 ↑↑↑
}
</script>
<template>
<div id="map_box"></div>
</template>
<style scoped lang="less">
#map_box {
position: absolute;
left: 0vw;
top: 0vh;
height: 100vh;
width: 100vw;
background: rgba(255, 255, 255, 0);
}
</style>
(ps:如果文章有帮助到你,请点个小小的赞鼓励一下作者哟~~)