https://github.com/jfrankl/netlify-cms-widget-geojson
A Netlify CMS widget that allows drawing points, lines, and polygons.
https://github.com/jfrankl/netlify-cms-widget-geojson
geojson geospatial netlify-cms
Last synced: 1 day ago
JSON representation
A Netlify CMS widget that allows drawing points, lines, and polygons.
- Host: GitHub
- URL: https://github.com/jfrankl/netlify-cms-widget-geojson
- Owner: jfrankl
- License: mit
- Created: 2018-09-18T09:30:22.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-09-18T10:52:22.000Z (over 6 years ago)
- Last Synced: 2025-04-23T16:37:11.037Z (6 days ago)
- Topics: geojson, geospatial, netlify-cms
- Language: JavaScript
- Homepage:
- Size: 181 KB
- Stars: 3
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-decap-cms - netlify-cms-widget-geojson - A Netlify CMS widget that allows drawing points, lines, and polygons. (Custom Widget)
README
# Netlify CMS Widget GeoJSON
A Netlify CMS widget that allows drawing points, lines, and polygons. This is still in very early stages.
## Install
As an npm package:
```shell
npm install --save netlify-cms-widget-geojson
``````js
import geojson from 'netlify-cms-widget-geojson'CMS.registerWidget('geojson', GeoControl, GeoPreview)
```Via `script` tag:
```html
CMS.registerWidget('geojson', GeoControl, GeoPreview)
```
## How to use
Add to your Netlify CMS configuration:
```yaml
fields:
- {label: "Geometry", name: "geojson", widget: geojson, draw: 'polygon', single: false, lat: 0, lng: 0, zoom: 1 }
```- `draw`: Sets the type of geometry you can draw. Options: `marker`, `polyline`, and `polygon`. Remove property if you want to be able to draw all types.
- `single`: Default: `false`. Set to `true` to limit the user to drawing one feature.
- `lat`, `lng`, `zoom`: Set the default position for the map.