Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yohanboniface/Leaflet.FormBuilder
Utility to create forms connected to L.Class instances
https://github.com/yohanboniface/Leaflet.FormBuilder
Last synced: 5 days ago
JSON representation
Utility to create forms connected to L.Class instances
- Host: GitHub
- URL: https://github.com/yohanboniface/Leaflet.FormBuilder
- Owner: yohanboniface
- Created: 2014-09-22T12:11:51.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2024-07-09T08:33:14.000Z (4 months ago)
- Last Synced: 2024-10-27T11:28:00.005Z (12 days ago)
- Language: JavaScript
- Size: 27.3 KB
- Stars: 7
- Watchers: 4
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-starred - yohanboniface/Leaflet.FormBuilder - Utility to create forms connected to L.Class instances (others)
README
# Leaflet.FormBuilder
Helpers to build forms synchronized with Leaflet objects.
# Usage
```
var tilelayerFields = [
['options.tilelayer.name', {handler: 'BlurInput', placeholder: 'display name'}],
['options.tilelayer.url_template', {handler: 'BlurInput', helpText: 'Supported scheme: http://{s}.domain.com/{z}/{x}/{y}.png', placeholder: 'url'}],
['options.tilelayer.maxZoom', {handler: 'BlurIntInput', placeholder: 'max zoom'}],
['options.tilelayer.minZoom', {handler: 'BlurIntInput', placeholder: 'min zoom'}],
['options.tilelayer.attribution', {handler: 'BlurInput', placeholder: 'attribution'}],
['options.tilelayer.tms', {handler: 'CheckBox', helpText: 'TMS format'}]
];
var builder = new L.FormBuilder(myObject, tilelayerFields, {
callback: myCallback,
callbackContext: this
});
myContainer.appendChild(builder.build());
```See more examples of usage:
- https://github.com/yohanboniface/Leaflet.Storage/blob/master/src/js/leaflet.storage.forms.js
- https://github.com/kosmtik/kosmtik/blob/master/src/front/FormBuilder.js
- https://github.com/kosmtik/kosmtik/blob/master/src/front/Core.js#L102-L114