mirror of
https://github.com/farmOS/farmOS.git
synced 2024-02-23 11:37:38 +01:00
6ce9ec2480
**Why?** There were a bunch of places where farmOS implicitly depends on the id of the map element to look up settings and access the map element after the map is instantiated. This change makes it so there is only one place in the JS that depends on the map id to dereference the drupalSettings and assign them under `instance.farmMapSettings` so behaviors can access them.
14 lines
399 B
JavaScript
14 lines
399 B
JavaScript
(function () {
|
|
farmOS.map.behaviors.geofield = {
|
|
attach: function (instance) {
|
|
instance.editAttached.then(() => {
|
|
instance.edit.wktOn('featurechange', function(wkt) {
|
|
instance.map.getTargetElement().parentElement.querySelector('textarea').value = wkt;
|
|
});
|
|
});
|
|
},
|
|
|
|
// Make sure this runs after farmOS.map.behaviors.wkt.
|
|
weight: 101,
|
|
};
|
|
}());
|