2020-06-25 23:07:23 +02:00
|
|
|
(function ($) {
|
|
|
|
// Define a Drupal ajax command for loading the assets current location
|
|
|
|
// wkt from the hidden input field and preview it on the map.
|
|
|
|
Drupal.ajax.prototype.commands.previewCurrentLocation = function() {
|
|
|
|
var wkt = $('#current-location input[name="move[current_location]"]').val();
|
2020-07-02 18:57:43 +02:00
|
|
|
if (wkt !== 'undefined') {
|
2020-06-25 23:07:23 +02:00
|
|
|
farmOS.map.behaviors.move.previewCurrentLocation(wkt);
|
|
|
|
}
|
|
|
|
}
|
2020-06-26 20:23:41 +02:00
|
|
|
|
|
|
|
// Define a Drupal ajax command for loading the Movement To area wkt
|
|
|
|
// from a hidden input field and preview it as an editable layer in the map.
|
|
|
|
Drupal.ajax.prototype.commands.updateMovementLayer = function() {
|
2020-07-02 18:46:10 +02:00
|
|
|
var wkt = $('#movement-geometry textarea[name="move[area][geometry][data]"]').val();
|
2020-06-26 20:23:41 +02:00
|
|
|
if (wkt) {
|
|
|
|
farmOS.map.behaviors.move.updateMovementLayer(wkt);
|
|
|
|
}
|
|
|
|
}
|
2020-06-25 23:07:23 +02:00
|
|
|
}(jQuery));
|