summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 690fc69..65dd200 100644
--- a/chimere/static/chimere/js/jquery.chimere.js
+++ b/chimere/static/chimere/js/jquery.chimere.js
@@ -1483,12 +1483,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);
}
});
},
@@ -1529,7 +1534,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;
}
@@ -3080,6 +3085,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);