diff options
| author | Étienne Loks <etienne.loks@peacefrogs.net> | 2012-08-26 14:10:54 +0200 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@peacefrogs.net> | 2012-08-26 14:10:54 +0200 |
| commit | 0ee09412bff460d70894e9b11ed3a90481a74608 (patch) | |
| tree | 6e0f78adee31bb07fc5f42f521a0c03e557b2602 /chimere/static | |
| parent | 095e0ac0304e90f2e07a23b745571c781005920c (diff) | |
| download | Chimère-0ee09412bff460d70894e9b11ed3a90481a74608.tar.bz2 Chimère-0ee09412bff460d70894e9b11ed3a90481a74608.zip | |
Improve detail display
* add a short_description property to marker which cut desc
* add options in jquery.chimere.js to customize popup display
Diffstat (limited to 'chimere/static')
| -rw-r--r-- | chimere/static/chimere/css/styles.css | 3 | ||||
| -rw-r--r-- | chimere/static/chimere/js/jquery.chimere.js | 21 |
2 files changed, 17 insertions, 7 deletions
diff --git a/chimere/static/chimere/css/styles.css b/chimere/static/chimere/css/styles.css index ecdd70c..640fc29 100644 --- a/chimere/static/chimere/css/styles.css +++ b/chimere/static/chimere/css/styles.css @@ -367,8 +367,6 @@ ul#share li{ #main-map{ position:absolute; - margin:0px; - padding:0px; height:93%; margin:0; padding:0; @@ -697,7 +695,6 @@ table.inline-table td input[type=file]{ margin-right: auto; } - /* openlayer customisation */ .olControlPermalink { display: block; diff --git a/chimere/static/chimere/js/jquery.chimere.js b/chimere/static/chimere/js/jquery.chimere.js index 12fb68f..4bc487e 100644 --- a/chimere/static/chimere/js/jquery.chimere.js +++ b/chimere/static/chimere/js/jquery.chimere.js @@ -74,15 +74,18 @@ OpenLayers.Layer.MapQuestOSM = OpenLayers.Class(OpenLayers.Layer.XYZ, { // Provide this function for overriding the getSubcategories default get_subcategories_fx: null, hide_popup_fx: null, + // if leave to false every click on the map hide the pop-up + explicit_popup_hide: false, controls:[new OpenLayers.Control.Navigation(), new OpenLayers.Control.SimplePanZoom(), new OpenLayers.Control.ScaleLine()], popupClass: OpenLayers.Popup.FramedCloud, + popupContentFull: false, // if true the detail is inside the popup category_accordion: true, // category opening behave like an accordion maxResolution: 156543.0399, units: 'm', projection: new OpenLayers.Projection('EPSG:4326'), - theme:null, + theme: null, routing: false, // enable routing management routing_panel_open: function(){ $('#chimere_itinerary_panel').dialog('open'); @@ -454,6 +457,14 @@ OpenLayers.Layer.MapQuestOSM = OpenLayers.Class(OpenLayers.Layer.XYZ, { var marker = feature.createMarker(); /* manage markers events */ var _popup = function() { + if (settings.popupContentFull){ + var pixel = new OpenLayers.Pixel(0, 60); + var lonlat = map.getLonLatFromPixel(pixel); + lonlat.lon = settings.current_feature.lonlat.lon; + settings.map.setCenter(lonlat); + } else { + methods.center_on_feature(); + } /* show the popup */ if (settings.current_popup != null) { settings.current_popup.hide(); @@ -466,7 +477,9 @@ OpenLayers.Layer.MapQuestOSM = OpenLayers.Class(OpenLayers.Layer.XYZ, { } settings.current_popup = feature.popup; /* hide on click on the cloud */ - settings.current_popup.groupDiv.onclick = methods.hidePopup; + if (!settings.explicit_popup_hide){ + settings.current_popup.groupDiv.onclick = methods.hidePopup; + } settings.permalink.updateLink(); } var markerClick = function (evt) { @@ -716,14 +729,14 @@ OpenLayers.Layer.MapQuestOSM = OpenLayers.Class(OpenLayers.Layer.XYZ, { var params = {} if (settings.simple) { params["simple"] = 1; } $.ajax({url: uri, - data: params, + data: params, success: function (data) { if ( settings.display_feature_detail_fx ) { // Custom function ? settings.display_feature_detail_fx(data, settings); } else { - if (!settings.simple) { + if (!settings.popupContentFull) { $('#detail').html(data).show(); } else { |
