2.0.11-0 • Published 3 years ago

dq-fengyu v2.0.11-0

Weekly downloads
-
License
-
Repository
-
Last release
3 years ago

大气事业部风羽图插件

此插件基于mapbox地图,命名规则基于dq (大气)拼音简写。

作者:张向阳

Getting started

npm  install  dq-fengyu

使用教程

  1. 引入该模块
import  dqfengyu  from 'dq-fengyu'
  1. 初始化风羽图
let config = {
    map: map, //地图对象
    size: 1,//风杆大小比例 0-1
    color: "blue",//风杆颜色
    lineWidth:3 //  风杆的粗细
 }
var Qqfengyu = new dqfengyu(config)
  1. 添加自定义symbol 类型 image-icon
  Qqfengyu.addimageIocn()
  1. 实例化自定义id的图层到地图上
//后台数据
  var data = {
        'type': 'FeatureCollection',
        'features': [
            {
                'type': 'Feature',
                'properties': {},
                'geometry': {
                    'type': 'Point',
                    'coordinates': [
                        108.767, 34.246
                    ]
                },
                'properties': {
                    'pngName': 'wind60',
                    'WindDirection': 10,

                }
            },
            {
                'type': 'Feature',
                'properties': {},
                'geometry': {
                    'type': 'Point',
                    'coordinates': [
                        108.867, 34.246
                    ]
                },
                'properties': {
                    'pngName': 'wind24',
                    'WindDirection': 10,

                }
            },


        ]
    }
    var config = {
        id: 'layer1',
        data: data
    }
    Qqfengyu.addLayer(config)
  1. 删除图层
  var config = {
    id: 'layer1'
    }
 Qqfengyu.removeLayer(config)

说明(具体用法切换到 node_modules/dq-fengyu/example/index.html)

主类

var Qqfengyu=new dqfengyu(params) // 有参数
 //示例: params={
    map: map, //地图对象
    size: 1,//风杆大小比例 0-1
    color: "blue",//风杆颜色
    lineWidth:3 //风杆粗细
}
主类的方法
  1.addimageIocn()// 添加icon至地图  无参数类型 有返回值可以打印 分别为各个级别的风杆
  2.removeimageIocn()  //删除icon 
  
  3.addLayer(params)// 添加图层 有参数  示例: params={
      id:'' //图层id
      data:{}// geojson  集合数据
  }

  4.removeLayer(params)// 有参数  示例:params={
      id:'' //图层id
     
  }
  

License

MIT.

2.0.11-0

3 years ago

2.0.8-0

3 years ago

2.0.6-0

3 years ago

2.0.5-0

3 years ago

2.0.3-0

3 years ago

2.0.2-0

3 years ago

2.0.1-0

3 years ago

2.0.0

3 years ago

1.0.3-0

3 years ago

1.0.2-0

3 years ago

1.0.1-0

3 years ago

1.0.0

3 years ago