当前位置:网站首页>Drawing and resetting of mars3d point, line and surface
Drawing and resetting of mars3d point, line and surface
2022-06-23 06:42:00 【~ front small siege lion】
<template>
<div id="app">
Map
<button @click="drawPoint()"> spot </button>
<button @click="drawLine()"> Line </button>
<button @click="drawPolygon()"> Noodles </button>
<button @click="clearFeatures()"> Reset </button>
<div id="mars3dContainer" class="mars3d-container"></div>
</div>
</template>
<script>
import * as mars3d from "mars3d";
export default {
name: "App",
methods: {
init() {
var mapOptions = {
basemaps: [{ name: " Sky map ", type: "tdt", layer: "img_d", show: true }],
};
// Create a 3D Earth scene
const map = new mars3d.Map("mars3dContainer", mapOptions);
this.map = map;
return map;
},
drawPolygon(clampToGround) {
this.map.graphicLayer.startDraw({
type: "polygon",
style: {
color: clampToGround ? "#ffff00" : "#3388ff",
opacity: 0.5,
outline: true,
outlineColor: "#ffffff",
outlineWidth: 2.0,
clampToGround: clampToGround,
},
});
},
drawPoint(clampToGround) {
this.map.graphicLayer.startDraw({
type: "point",
style: {
color: clampToGround ? "#ffff00" : "#3388ff",
opacity: 0.5,
outline: true,
outlineColor: "#ffffff",
outlineWidth: 2.0,
clampToGround: clampToGround,
},
});
},
drawLine(clampToGround) {
this.map.graphicLayer.startDraw({
type: "polyline",
style: {
color: clampToGround ? "#ffff00" : "#3388ff",
opacity: 0.5,
outline: true,
outlineColor: "#ffffff",
outlineWidth: 2.0,
clampToGround: clampToGround,
},
});
},
clearFeatures() {
this.map.graphicLayer.clear();
},
},
mounted() {
this.init();
},
};
</script>
<style>
#mars3dContainer {
height: 800px;
}
</style>边栏推荐
- mysql如何将日期转为数字
- Day_ 09 smart health project - mobile terminal development - Mobile quick login and permission control
- 将TensorFlow1.x改写为pytorch
- Skilled use of slicing operations
- Docker practice - redis cluster deployment and micro service deployment project
- 百度URL参数之LINK?URL参数加密解密研究(代码实例)
- 2.17 haas506 2.0开发教程-system(仅支持2.2以上版本)
- Docker实战 -- 部署Redis集群与部署微服务项目
- 二叉树的遍历及相关知识
- Day_02 传智健康项目-预约管理-检查项管理
猜你喜欢
Link of Baidu URL parameter? Research on URL parameter encryption and decryption (code example)

c#数据库报错问题大家帮我看看吧

js创建数组(元素都是对象)

Day_02 传智健康项目-预约管理-检查项管理

C# wpf 通过绑定实现控件动态加载

Index - MySQL

华为软件测试笔试真题之变态逻辑推理题

Detailed explanation of redis persistence, master-slave and sentry architecture

CPU的功能和基本结构

RF content learning
随机推荐
How to maintain secure encryption of email communication with FDA?
把CSMA/CD、Token Bus、Token Ring说清楚
图解 Google V8 # 18 :异步编程(一):V8是如何实现微任务的?
问题:访问组件中数据object(定义的数据)中属性也为object对象中的属性时,报错现象
XShell7 下载
Test of ers function under the supplier consignment purchase mode of SAP mm
There are so many code comments! I laughed
Kubesphere offline deployment without network environment
SAP execution transaction code mrrl error -no message was found for partner 100065-
c#数据库报错问题大家帮我看看吧
LeetCode笔记:Weekly Contest 298
minio单节点部署 minio分布式部署 傻瓜式部署过程 (一)
QT中的item views与Item widgets控件的用法总结
百度URL參數之LINK?URL參數加密解密研究(代碼實例)
Haas506 2.0 development tutorial - Advanced Component Library -modem Voicecall (only supports versions above 2.2)
json转化为proto
【系统】右键桌面图标,转圈后,资源管理器就崩溃,桌面就重新刷新
微信小程序 - 全局监听globalData的某个属性变化,例如监听网络状态切换
2.17 haas506 2.0 development tutorial system (only versions above 2.2 are supported)
JS to create an array (all elements are objects)