A snap tool used for mouse point to adsorb geometries on map
npm install maptalks.glowlayernpm install maptalks.GlowLayer`.
* Download from dist directory.
* Use unpkg CDN: `https://unpkg.com/maptalks.GlowLayer/dist/maptalks.GlowLayer.min.js`
Usage
As a plugin, `maptalks.GlowLayer` must be loaded after `maptalks.js` in browsers. You can also use `'import { GlowLayerol } from "maptalks.GlowLayer"` when develope with webpack.
`html
`
Supported Browsers
IE 9-11, Chrome, Firefox, other modern and mobile browsers.
Examples
* See the demo.
API Reference
setLayer(layer||maptalks.VectorLayer) specify a layer which has geometries to snap to.
setGeometries(geometries||Array specify a geometry collection to snap to.
enable() start snap to.
disable() end snap to.
setMode(mode||String) set the snap strategy, when mode is 'point', it will snap to geometries's end points.When it set to 'line',it will snap a point which is mearest to mouse on a LineString.
$3
`
Contributing
We welcome any kind of contributions including issue reportings, pull requests, documentation corrections, feature requests and any other helps.
Develop
The only source file is `index.js`.
It is written in ES6, transpiled by babel and tested with mocha and expect.js.
$3
* Install dependencies
`shell
$ npm install
`
* Watch source changes and generate runnable bundle repeatedly
`shell
$ gulp watch
`
* Tests
`shell
$ npm test
`
* Watch source changes and run tests repeatedly
`shell
$ gulp tdd
`
* Package and generate minified bundles to dist directory
`shell
$ gulp minify
`
* Lint
`shell
$ npm run lint
``