Git Product home page Git Product logo

gismap's Introduction

使用说明

安装

npm i  @kdhy/gismap

使用前注意事项

因为使用cesium,需要配置静态资源目录

1.服务配置静态资源目录

2.window['CESIUM_BASE_URL'] = '/static/Cesium'

Cesium使用静态资目录: node_modules/@kdhy/gismap/build/Cesium


使用

import GisMap from "@kdhy/gismap"

const gisMap = new GisMap('cesium')

使用文档目录

文档地址

基础方法

methods

方法名 说明 类型
setView 设置视角 (position) => void
cZoomIn 放大 () => void
cZoomOut 缩小 () => void
setSceneMode2D3D 2/3维转换 (type: 2 | 3)=> void
drawPoint 绘制点 (drawMpointOptions) => point
drawLine 绘制线 (Array<[longitude,latitude,height]>,lineOptions) => polyLine
drawAnimateLine 绘制动态线 (Array<[longitude,latitude,height]>,lineOptions) => polyLine
drawPolyLine 绘制管线 (Array<[longitude,latitude,height]>,lineOptions) => polyLine
remove 移除元素节点 (id | Entity)=>void

position:{}

名称 说明 类型
longitude 经度 number
latitude 纬度 number
height 高度 number

pointOptions:{}

名称 说明 类型
longitude 经度 number
latitude 纬度 number
height 高度 number
label label展示 Label
tip 单击展示 Tip
menu 右键展示 Menu

lineOptions:{}

名称 说明 类型
width 宽度 number
color 颜色 CssColor

Label:{}

名称 说明 类型
show 是否展示 number
text 文本内容 string
fillColor 标签填充颜色 CssColor
outlineColor 标签字体轮廓 CssColor

Tip:{}

名称 说明 类型
show 是否展示 number
content 内容 HtmlString
style 样式 {key:value}
className 外层类名 string

Menu:{}

名称 说明 类型
show 是否展示 number
style 样式 {key:value}
className 外层类名 string
menuItems 右键菜单 Array<{text:string,type:string}>
onSelect 选中回调 function(type,Entity)

天气

方法名 说明 类型
setWeather 设置天气 (wether:'rain' | 'snow' | 'fog' ) => void
clearWeather 关闭天气

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.