diff options
Diffstat (limited to 'static/main_map.js')
| -rw-r--r-- | static/main_map.js | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/static/main_map.js b/static/main_map.js index 1d5d845..0bcf972 100644 --- a/static/main_map.js +++ b/static/main_map.js @@ -97,10 +97,14 @@ function putMarker(mark) { /*feature.closeBox = false;*/ feature.pk = mark.properties.pk; feature.popupClass = OpenLayers.Class(OpenLayers.Popup.FramedCloud); - feature.data.popupContentHTML = "<div class='cloud'>" + mark.properties.name + "<br/> </div>"; + feature.data.popupContentHTML = "<div class='cloud'>"; + feature.data.popupContentHTML += mark.properties.name; + feature.data.popupContentHTML += "<br/><div id='popup_link'>\ +<a href='javascript:showDetail()'>"; + feature.data.popupContentHTML += gettext("Show details"); + feature.data.popupContentHTML += "</a></div></div>"; feature.data.overflow = 'hidden'; var marker = feature.createMarker(); - /* manage markers events */ var markerClick = function (evt) { currentFeature = this; @@ -145,13 +149,19 @@ function updateDetail(pk){ /* update the detail panel from an http response */ function setDetail(response){ if (response.responseText.indexOf('no results') == -1) { - document.getElementById('detail_content').innerHTML = response.responseText; + document.getElementById('detail').innerHTML = response.responseText; } } + +/* show the detail windows */ +function showDetail(){ + document.getElementById('detail').style.display = 'block'; +} + /* hide content of detail panel */ function hideDetail(){ - document.getElementById('detail_content').innerHTML = ''; + document.getElementById('detail').style.display = 'None'; } /* main initialisation function */ |
