https://github.com/zzcyrus/maptalks.IdwLayer
A small maptalks plugin to generate an IDW layer
https://github.com/zzcyrus/maptalks.IdwLayer
idw maptalks maptalks-plugin
Last synced: about 1 year ago
JSON representation
A small maptalks plugin to generate an IDW layer
- Host: GitHub
- URL: https://github.com/zzcyrus/maptalks.IdwLayer
- Owner: zzcyrus
- License: mit
- Created: 2017-10-19T09:53:58.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-10-23T08:53:21.000Z (over 8 years ago)
- Last Synced: 2024-11-11T16:41:29.437Z (over 1 year ago)
- Topics: idw, maptalks, maptalks-plugin
- Language: JavaScript
- Size: 53.7 KB
- Stars: 7
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# maptalks-plugin-IdwLayer
A small maptalks plugin to generate an IDW interpolated map, based on [Leaflet.idw](https://github.com/JoranBeaufort/Leaflet.idw) by JoranBeaufort

## Examples
[Demo](http://kael.top/maptalks.IdwLayer/demo/demo.html)
## Install
Just include the maptalks-IdwLayer.js/maptalks-Idwlayer.min.js from the dist folder:
```
```
## Usage
```js
var idw = new maptalks.IdwLayer('idw', data, {
opacity: 0.3,
cellSize: 10,
exp: 2,
max: 1200
}).addTo(map);
```
## `Constructor`
```javascript
new maptalks.IdwLayer(id, data, options)
```
* id **String** layer id
* data **Array[]** layer data: [[x, y, value], [x, y, value]..]
* options **Object** options
* max **Number** maximum point values (1 by default)
* exp **Number** exponent used for weighting(1 by default)
* cellSize **Number** height and width of each cell(25 by default)
* opacity **Number** the opacity of the IDW layer (0.3 by default)
* gradient **Object** color gradient config, e.g. {0.4: 'blue', 0.65: 'lime', 1: 'red'} (demo by default)
* more infomation please check [maptalks.Layer](https://maptalks.github.io/maptalks.js/api/0.x/Layer.html)