summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2016-11-21 11:58:36 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2016-11-21 12:09:16 +0100
commit0dc8fec9a2cc24ad099f0d31e1464fac124dc136 (patch)
treea812668e4c32c24079f24013094afaaeb5df9817
parent3ad5c69bea8e79234a32ed1532be4d43b64b7d68 (diff)
downloadChimère-v2.9.tar.bz2
Chimère-v2.9.zip
ol3: display specific marker not present on the map (useful for permalink)v2.9
-rw-r--r--chimere/static/chimere/js/jquery.chimere.js15
1 files changed, 12 insertions, 3 deletions
diff --git a/chimere/static/chimere/js/jquery.chimere.js b/chimere/static/chimere/js/jquery.chimere.js
index 4461297..294c5dc 100644
--- a/chimere/static/chimere/js/jquery.chimere.js
+++ b/chimere/static/chimere/js/jquery.chimere.js
@@ -1550,12 +1550,17 @@ function transformCoordToLonLat(coord) {
}
},
*/
- loadMarker: function(object_id) {
+ loadMarker: function(object_id, open_popup) {
var uri = extra_url + "get-marker/" + object_id;
$.ajax({url: uri,
dataType: "json",
success: function (data) {
- for (idx in data) methods.addMarker(data[idx]);
+ var c_feat = null;
+ for (idx in data){
+ c_feat = methods.addMarker(data[idx]);
+ }
+ if (c_feat && open_popup != 'undefined' && open_popup)
+ methods.openPopup(c_feat);
}
});
},
@@ -1596,7 +1601,7 @@ function transformCoordToLonLat(coord) {
if (settings.enable_clustering){
settings.clusterSource.getSource().clear();
}
- if (!data.features) return;
+ if (!data.features) data.features = [];
if (data.zoom_need_reload){
settings._zoom_need_reload = data.zoom_need_reload;
}
@@ -3124,6 +3129,10 @@ function transformCoordToLonLat(coord) {
return true
}
}
+ // only manage marker for now
+ if (feature_pk.substring(0, 7) == "marker-"){
+ var feat = methods.loadMarker(feature_pk.substring(7), true);
+ }
return false;
//feature.markerClick();
//OpenLayers.Popup.popupSelect.clickFeature(feature);