@web-map-service/map2d-app
Version:
基于openlayer的2D地图应用
36 lines (28 loc) • 584 B
text/typescript
import { type App, type Plugin } from '../types'
export function closeTools(app: App) {
for (const tool of Object.values(app.tools)) {
tool.close()
}
}
/**
*
* 工具插件, 提供工具能力
*/
export function createPlugin() {
let app: App
const plugin: Plugin = {
type: 'tool',
install(_app: App) {
app = _app
app.tools = {} as Tools
return app
}
}
return plugin
}
export interface Tools {}
declare module '../types' {
interface ComponentCustomProperties {
tools: Tools;
}
}