3
0
Fork 0
mirror of https://github.com/farmOS/farmOS.git synced 2024-02-23 11:37:38 +01:00
farmOS/modules/core/map/js/farmOS.map.behaviors.geofield.js
paul121 71159d83c3 Issue #3232237 by paul121: Allow the map widget textarea to be hidden
Add display_raw_geometry setting to the map widget.
2021-09-10 07:17:47 -04:00

14 lines
416 B
JavaScript

(function () {
farmOS.map.behaviors.geofield = {
attach: function (instance) {
instance.editAttached.then(() => {
instance.edit.wktOn('featurechange', function(wkt) {
instance.map.getTargetElement().parentElement.querySelector('[data-map-geometry-field]').value = wkt;
});
});
},
// Make sure this runs after farmOS.map.behaviors.wkt.
weight: 101,
};
}());