@mapgis/webclient-mapboxgl-plugin

[![npm version][npm-img]][npm-url] [![build status][travis-img]][travis-url]

Usage no npm install needed!

<script type="module">
  import mapgisWebclientMapboxglPlugin from 'https://cdn.skypack.dev/@mapgis/webclient-mapboxgl-plugin';
</script>

README

MapGIS WebClient-JavaScript-Plugin

npm version build status apache licensed

WebClient-JavaScript 的官方插件。针对 IGService-X服务类型. 集成百度 MapV, 百度Echarts 阿里L7 L7 Data-Driven DocumentsD3等常见互联网的技术.

该工程由中地数码多个团队协同配合,主要是将公网的开源技术进行整合,如果需要高级收费的js版本,请联系内部维护人员.

这个工程的目标 不是 替代司马云上的官方 WebClient-JavaScript 而是作为一种补集 针对 传统GIS技术中较少使用的大数据可视化,时空聚类,前端空间分析,客户端专题去等提供额外的功能支撑.

司马云上的官方的传统的WebClient-JavaScript完全满足常规的GIS开发模式

目录

示例

请看 Zondy.Echarts, Zondy.Mapv, Zondy.D3.

示例图片

http://client.snanyun.com:8899/ui/index.html

使用方式

两种使用方式:

  1. 配合WebClient-JavaScript使用
  2. 单独使用WebClient-JavaScript-Plugin

1.WebClient-JavaScript使用

WebClient-JavaScript中的include-leaflet/cesium/openlayers/mapboxgl.js默认自动引入该脚本, 前提是没有使用exclude标签将plugin插件单独排除出去

使用方式

    <script src="./libs/zondyclient/include-mapboxgl-local.js"></script>
    if (!inArray(excludes, 'plugin')) {
        //这里是三方如igserver-x,datastore,mapv,echart等的api    
        inputCSS(httpUrl + "/cdn/zondyclient/webclient-mapboxgl-plugins.css");
        inputScript(httpUrl + "/cdn/zondyclient/webclient-mapboxgl-plugins.min.js");
    }

2.单独使用

以百度Echatrs为例,如果要使用 EchartsLayer图层:

    layer = new mapboxgl.zondy.EchartsLayer(map, option).addTo(map);

引用顺序如下: 必须是地图脚本主题先引入-> 使用的三方js(echarts/mapv)-> 本文的插件js

  1. 引入基本的 mapbox-gl.js脚本库 mapbox-gl.js
  2. 引入使用的echarts.js库 incubator-echarts
  3. 引入本文提到的 WebClient-JavaScript-Plugin.js库

API接口

  1. Leaflet API
  2. OpenLayers API
  3. MapboxGL API

cesium模块由三维部门单独负责

独立插件

除了基本的地图脚本库:leaflet,openlauyer之外 一些常见的js库如:turfjs(空间分析)等可以直接单独引入。 推荐使用Turf做几何判断

独立js库 cdn地址 node使用
turfjs https://npmcdn.com/@turf/turf/turf.min.js import * as turf from '@turf/turf'

问题

深入了解

开发说明

如何从源代码编译脚本.

  1. 分支 & 克隆 WebClient-JavaScript-Plugin
  2. cd 进入 WebClient-JavaScript-Plugin 文件夹 3.安装 package.json 所需依赖 npm install
  3. 执行命令 npm run mapbox-cmj 编译通用的commonjs版本的mapboxgl-plugin插件js,生成的js文件保存到 dist 文件夹下.
  4. 拷贝编译好的webclient-mapboxgl-plugins.cmj.min.js文件单独使用
  5. 将你自己的修改提交到远程仓库pull request

依赖

本仓库 master 分支 针对最新版的的脚本库。

版本控制

  1. master分支实时更新10.3.0.201xmmdd
  2. release分支, 一月一次大的版本更新10.3.0.20190101 -> 10.3.1.20190201
  3. cd leaflet root path & npm publish --access public

贡献方式

请参考 guidelines for contributing.

团队

L.zondy.EchartsLayer(map, option).addTo(map);

证书

Copyright © 2014-2019 MapGIS

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

A copy of the license is available in the repository's LICENSE file.