Mars3d development template based on Vue3.x + Vite
- Visual Studio Code editor is recommended
- It is recommended to install ESlint、Volar plug-ins (if the vehicle plug-in has been installed, it needs to be disabled) And set the formatting tool to eslint (settings.json is configured as follows)
"[vue]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[typescript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[javascript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
npm i
npm run dev
npm run build
npm install mars3d //or cnpm install mars3d or yarn add mars3d
Scene profile:
public\config\config.json
Component definition file:
src\components\mars3d\Map.vue
Refer to the src\views\Index.vue
file to introduce map components and structures to create the earth. Mainly focus on the following code
// script
import MarsMap from "@comp/MarsMap/index.vue";
<!-- template -->
<MarsMap url="config/config.json" map-key="yourkey" @onload="loadHandler" />
Mars3d and Cesium instances have been mounted to globalproperties in the project, and can be obtained as follows
const instance = getCurrentInstance()
const mars3d = instance?.appContext.config.globalProperties.mars3d;
const Cesium = instance?.appContext.config.globalProperties.Cesium;
Mars3D
is Mars technology developed a WebGL based 3 d client development platform, based on Cesium is optimized with B/S structure design, The lightweight and efficient GIS development platform supports multi-industry expansion. It can run efficiently in the browser without installation and plug-in, and can quickly access and use a variety of GIS data and 3D models to present 3d space visualization and complete the flexible application of the platform in different industries.
The Mars3D platform can be used to build plug-in free, cross-operating system, cross-browser 3D GIS applications. The platform uses WebGL for hardware-accelerated graphics, cross-platform and cross-browser to achieve real dynamic 3d visualization of big data. Through Mars3D products, beautiful and smooth 3D map presentation and spatial analysis can be quickly realized on browsers and mobile terminals.
-
Mars3D official website:http://mars3d.cn
-
Mars3D GitHub navigation list:https://github.com/marsgis/mars3d