ol-geometry-editor Getting started

Draw a GeoJSON Point in a standard HTML form

Note that you can submit your form as usual, no need to introduce GeoJSON Feature or FeatureCollection.

Code

html

<form action="#" method="get">
<div class="form-group">
    <label for="name">name</label>
    <input id="name" class="form-control" type="text" placeholder="The place name" />
</div>
<div class="form-group">
    <label for="the_geom">the_geom</label>
    <input type="text" id="the_geom" class="geometry form-control" name="the_geom" value='{"type":"Point","coordinates":[2.33,48.85]}' />
</div>
</form>

javscript

$(document).ready(function () {
$('.geometry').geometryEditor({
    'geometryType': 'Point',
    'editable': true,
    'hide': false,
    'precision': 4
});
});