data-field-geojson v2.0.1
data-field-geojson
API
createGeoJSONField
Create a virtual-dom geojson data-field for use with data-ui.
Parameters
options
Object an options object, including any properties you can pass to leaflet & virtual-dom/hoptions.accessToken
String mapbox access token for using their APIoptions.tileLayer
Object Leaflet tilelayer, default is osm tilesoptions.imagePath
String path to leaflet imagesoptions.display
Boolean true for display mode, default is false for input mode
Examples
var createGeoJSONField = require('data-field-geojson')
var field = createGeoJSONField(options)
field.render(h, {}, geojsonObject)
field.render
Render the virtual-dom geojson data-field.
Parameters
h
function virtual-domh
functionproperties
Object an options object, including any properties you can pass to leaflet & virtual-dom/hproperties.display
Boolean true for display mode, default is false for input modeproperties.value
Object a geojson Feature or Featurecollection
value
Object a geojson Feature or Featurecollection
Examples
var createGeoJSONField = require('data-field-geojson')
var field = createGeoJSONField(options)
field.render(h, properties, geojsonObject)
Installation
npm install data-field-geojson --save
Or install the data-fields module:
npm install data-fields --save
Right now this module relies on leaflet v1.0.0-beta2, and you must build the dependency manually:
cd node_modules/leaflet
npm install
npm run build
Tests
npm install
npm test
See also
- data-fields – all data fields packaged together.
- data-ui – a collection of modules for managing data.