Name: terra-draw-map
Owner: Makina Corpus
Description: null
Created: 2018-04-23 09:44:04.0
Updated: 2018-04-30 10:47:21.0
Pushed: 2018-05-04 15:48:36.0
Homepage: null
Size: 2730
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Component created with React, Leaflet, Leaflet Draw, and turfjs.
Display a map with props layer.
And get info layer who intercept our drawing or on click.
port TerraDrawMap from 'TerraDrawMap';
.
erraDrawMap
config={{ layers: [polygon] }}
maxBounds={[[48.815575, 2.224122], [48.902157, 2.46976]]}
center={[48.856840, 2.351239]}
zoom={11}
getDataOnClick={data => this.getDataOnClick(data)}
getDataOnDraw={data => this.getDataDraw(data)}
Config variable= { layers: [Array on layer] }
Layer = {
id: 'id of layer',
display: boolean,
type: 'fill' or 'line'
geometry: {
type: 'supported types: Polygon, MultiPolygon, LineString, MultilineString',
coordinates: [coordinates]
},
paint: () => {
'function to handle color ... of layer'
}
}
For more : Look for the example inside tests folder.
Get data when the user click on layer
Return {'id of layer' : {properties}}
Get data layer under the drawing
Return [{'id of layer' : {properties}}]
Contain all stories for this component
Contain example app (created with create react app) with tests
Contain the src component