Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
marsgis-editor
Advanced tools
marsgis-editor 是 margis 平台的,示例运行容器,内置了 mars3d mars2d 的运行环境,可以在各种技术栈中使用,如 vue react angular 等。或者也可以选择直接通过 script 标签加载的方式。
npm install marsgis-editor --save
vite-plugin-monaco-editor
npm install vite-plugin-monaco-editor -save-dev
import monacoEditorPlugin from "vite-plugin-monaco-editor"
// 在pligins数组中加入以下配置
plugins: [monacoEditorPlugin()]
import MarsgisEditor from "marsgis-editor"
import "marsgis-editor/dist/style.css"
const marsEditor = new MarsgisEditor({})
支持的配置如下
interface Config {
configFetchType?: "online" | "local" // 是否始终加载在线的配置文件
baseUrl?: string // 基础请求路径
code?: string // 是否默认打开编辑器
fullScreen?: string // 是否全屏
packageName?: string // 运行基础库包名
homepage?: string // 首页地址,用于快捷跳转
configLibs?: any // lib公共依赖配置
libPublicPath?: string // libs资源的公共路径,可用于配置cdn地址
thumbnailPublicPath?: string // 缩略图的公共路径
configSourceUrl?: string // 配置文件地址
alwaysUseOrigin?: boolean // true 始终使用 src 的方式加载map.js
resourcePublicPath?: string //
expandBtnText?: string // 展开按钮文字
collapseBtnText?: string // 收起按钮文字
links?: {
title: string
url: string
icon: string
description: string
}[] // 快捷跳转链接数组
UIFile?: string | ((main: string) => string) // UI面板代码的url
UIFileLanguage?: "html" | "javascript" | "typescript" // UI面板的代码语言
fetchUICode?: (main: string) => string | Promise<string> // 返回UI面板代码,配置此项后 UIfile配置不再生效
}
import MarsgisEditor from "marsgis-editor"
import { configLibs } from "./includeLibs"
const marsEditor = new MarsgisEditor({
configLibs,
resourcePublicPath: "src/example",
thumbnailPublicPath: "/config/",
libPublicPath: "/lib/"
})
const componentId = "map/test"
let inited = false
marsEditor.on("loaded", () => {
if (inited) {
destoryUI()
}
initUI()
inited = true
})
function initUI() {
document.getElementById("mars-main-view").innerHTML = `<div class="test-pannel"></div>`
}
function destoryUI() {
document.getElementById("mars-main-view").innerHTML = ""
}
marsEditor.render("app", componentId)
FAQs
Mars3D平台功能示例通用示例容器
We found that marsgis-editor demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.