[TikiWiki-commits] [Git][tikiwiki/tiki][27.x] Revert "[FIX] maps: Another fix for multi-layer maps
"Jonny Bradley \(@jonnybradley\) via TikiWiki-cvs" <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <699f29c28699d_3b187b809a9@gitlab-sidekiq-low-urgency-cpu-bound-v2-74dd89c46d-7dd6t.mail> |
Jonny Bradley pushed to branch 27.x at Tiki Wiki CMS Groupware / Tiki
Commits:
e9219ec0 by Jonny Bradley at 2026-02-25T16:48:43+00:00
Revert "[FIX] maps: Another fix for multi-layer maps
---
* [FIX] maps: Replace deprecated `complete` with `always` for jquery 3+
* [FIX] maps: Partially revert ba3a1ed7 for Cartograf - the Editable layer needs to not have a name currently, and this controls the modify tool
* [FIX] maps: One more `on("error")` to `fail` fix (45dc0a39 again)
* [FIX] maps: Mainly fix the change to `on("error")` and update it to `fail` (yet another regression from 45dc0a39) and modernise the js generally to be closer to master.
* Revert "[FIX] maps: Another fix for multi-layer maps with other vector layers apart..."
This reverts commit 96c1b7bb28b4abf2fcc75e7a22e28021d32387c9.
See merge request tikiwiki/tiki!9646
- - - - -
2 changed files:
- lib/jquery_tiki/tiki-maps.js
- lib/wiki-plugins/wikiplugin_appframe.php
Changes:
=====================================
lib/jquery_tiki/tiki-maps.js
=====================================
@@ -356,13 +356,6 @@
event.feature.executor();
}
$(container).setMapPopup(null);
-
- if (modifyControl && modifyControl.active && event.feature) {
- modifyControl.unselectFeature(event.feature);
- }
- if (modifySelectControl && modifySelectControl.active && event.feature) {
- event.feature.layer.drawFeature(event.feature, "default");
- }
},
featuremodified: function (event) {
if (event.feature.executor) {
@@ -712,13 +705,6 @@
selectControl.deactivate();
selectControl.activate();
}
- container.modeManager.modes.forEach(function(mode) {
- mode.controls.forEach(function(control) {
- if (control.displayClass === "olControlSelectFeature") {
- control.setLayer(vectorLayerList);
- }
- });
- });
}
return container.layers[name];
@@ -1076,25 +1062,29 @@
var layerName = $(form).data('result-layer'), suffix = $(form).data('result-suffix');
if (layerName && i[layerName]) {
- layerName = i[layerName] + ": ";
- } else if (! layerName) {
- layerName = ' -- ';
+ layerName = i[layerName];
+ } else if (!layerName) {
+ layerName = "";
}
if (suffix && i[suffix]) {
- layerName = layerName + i[suffix];
+ layerName = layerName + ": " + i[suffix];
}
if (-1 === $.inArray(layerName, form.autoLayers)) {
form.autoLayers.push(layerName);
}
- var icon;
- $(i.link).each(function () { // if the object has an img with it (tracker status for instance) then we need to find the <a>
- if ($(this).is("a")) { // and just using $(i.link).find("a") doesn't work for some reason
- icon = $(this).data('icon-src');
- }
- });
+ let icon = "";
+ try {
+ $(i.link).each(function () {
+ // if the object has an img with it (tracker status for instance) then we need to find the <a>
+ if ($(this).is("a")) {
+ // and just using $(i.link).find("a") doesn't work for some reason
+ icon = $(this).data("icon-src");
+ }
+ });
+ } catch (e) {}
if (i.geo_location) {
$(container).addMapMarker({
@@ -1163,23 +1153,24 @@
fields[i.geo_feature_field] = format.write(feature);
- if (current === initial || layer.id.indexOf("OpenLayers.Layer.Vector") === -1) {
- // not changed or not a vector layer
+ if (current === initial || layer !== container.vectors) {
return;
}
$.post(
- $.service('tracker', 'update_item'),
+ $.service("tracker", "update_item"),
{
trackerId: i.tracker_id,
itemId: i.object_id,
- fields: fields
- }, function () {
+ fields: fields,
+ },
+ function () {
initial = current;
- }, 'json')
- .error(function () {
- $(container).trigger('changed');
- });
+ },
+ "json"
+ ).fail(function () {
+ $(container).trigger("changed");
+ });
});
});
layer.addFeatures(features);
@@ -1262,7 +1253,7 @@
}
}
});
- }, 'json').complete(function () {
+ }, 'json').always(function () {
$(container).trigger("complete.map.search");
});
return false;
@@ -1530,8 +1521,8 @@
}, function () {
initial = current;
}, 'json')
- .on("error", function () {
- $(container).trigger('changed');
+ .fail(function () {
+ $(container).trigger("changed");
});
});
}
=====================================
lib/wiki-plugins/wikiplugin_appframe.php
=====================================
@@ -437,25 +437,16 @@ function wikiplugin_appframe_mapcontrol($data, $params, $start)
}
break;
case 'select_feature':
- $control = $ol2 ? 'new OpenLayers.Control.SelectFeature([vlayer])' : '';
+ $control = $ol2 ? 'new OpenLayers.Control.SelectFeature(vlayer)' : '';
$label = tr('Select');
break;
case 'modify_feature':
- $control = $ol2 ? 'modifyControl = new OpenLayers.Control.ModifyFeature(vlayer, {
- mode: OpenLayers.Control.ModifyFeature.DRAG | OpenLayers.Control.ModifyFeature.RESHAPE,
- standalone: true,
- virtualStyle: drawStyle,
- vertexRenderIntent: "vertex",
- autoActivate: true
-}), modifySelectControl = new OpenLayers.Control.SelectFeature([vlayer], {
- autoActivate: true,
- onSelect: function (feature) {
- modifyControl.selectFeature(feature);
- },
- onUnselect: function (feature) {
- //modifySelectControl.unselect(feature);
- }
-})' : '';
+ $control = $ol2 ? 'new OpenLayers.Control.ModifyFeature(vlayer, {
+ mode: OpenLayers.Control.ModifyFeature.DRAG | OpenLayers.Control.ModifyFeature.RESHAPE,
+ standalone: true,
+ virtualStyle: drawStyle,
+ vertexRenderIntent: "vertex"
+ }), new OpenLayers.Control.SelectFeature(vlayer)' : '';
$label = tr('Select/Modify');
break;
case 'draw_polygon':
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/e9219ec0e6472ebb96e4dc0fe443d20b478eb37c
--
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/e9219ec0e6472ebb96e4dc0fe443d20b478eb37c
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help
_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs