summaryrefslogtreecommitdiff
path: root/chimere/static/main_map.js
diff options
context:
space:
mode:
Diffstat (limited to 'chimere/static/main_map.js')
-rw-r--r--chimere/static/main_map.js32
1 files changed, 24 insertions, 8 deletions
diff --git a/chimere/static/main_map.js b/chimere/static/main_map.js
index 67d1bee..fb736f5 100644
--- a/chimere/static/main_map.js
+++ b/chimere/static/main_map.js
@@ -115,6 +115,9 @@ var markers = new Array();
var layerMarkers;
var layerVectors;
+var simple = false;
+var first = true;
+
var currentPopup;
var currentFeature;
var clicked = false;
@@ -239,7 +242,8 @@ function updateCategories(response){
/* load geo objects with an AJAX request */
function loadGeoObjects(){
- updateCheckedCategories();
+ if (!first){ updateCheckedCategories(); }
+ first = false;
/* 0 stand for all categories */
if (!checked_categories) checked_categories = '0';
var uri = extra_url + "getGeoObjects/" + checked_categories;
@@ -255,7 +259,9 @@ function setGeoObjects(response){
/* clean the marker layer */
if (currentPopup) {
currentPopup.hide();
- hide('detail');
+ if (!simple){
+ hide('detail');
+ }
}
layerVectors = new OpenLayers.Layer.Vector("Vector Layer");
map.addLayer(layerVectors);
@@ -329,7 +335,9 @@ function putMarker(layer, mark) {
if (currentPopup == this.popup) {
this.popup.hide();
clicked = false;
- hide('detail');
+ if (!simple){
+ hide('detail');
+ }
} else {
currentPopup.hide();
showPop(this);
@@ -359,9 +367,11 @@ function putMarker(layer, mark) {
var hidePopUp = function (evt) {
if (clicked) {
- currentPopup.hide();
- clicked = false;
- hide('detail');
+ currentPopup.hide();
+ clicked = false;
+ if (!simple){
+ hide('detail');
+ }
}
}
@@ -378,8 +388,13 @@ function updateDetail(pk){
/* update the detail panel from an http response */
function setDetail(response){
if (response.responseText.indexOf('no results') == -1) {
- document.getElementById('detail').innerHTML = response.responseText;
- show('detail');
+ if (!simple){
+ document.getElementById('detail').innerHTML = response.responseText;
+ show('detail');
+ } else {
+ currentPopup.setContentHTML("<div class='cloud'>" +
+ response.responseText + "</div>");
+ }
}
}
@@ -491,6 +506,7 @@ function init(){
}
}
}
+ checked_categories = p_checked_categories.join('_');
}
}
/* if not zoom to the extent in cookies */