From 3c762e77b024e3bdd261002e415bc2e931b3d52f Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Thu, 19 Sep 2013 12:20:06 +0200 Subject: [PATCH] reworked googlemap * one marker per site; infowindow then has a list of checkboxed resource hrn's * seems to play fine with related hazelnut (resources as a list) and resourcesselected (pending operations) for adding / removing stuff all ways through known bugs * right hand side zoom-control area still all munched probably needs more extensive testing for cases where the map is hidden or does not have focus --- plugins/googlemap/static/css/googlemap.css | 30 +- plugins/googlemap/static/googlemap.html | 12 +- plugins/googlemap/static/js/googlemap.js | 314 +++++++++------------ 3 files changed, 155 insertions(+), 201 deletions(-) diff --git a/plugins/googlemap/static/css/googlemap.css b/plugins/googlemap/static/css/googlemap.css index 4399c1e1..bba477fa 100644 --- a/plugins/googlemap/static/css/googlemap.css +++ b/plugins/googlemap/static/css/googlemap.css @@ -1,15 +1,27 @@ -#map-container { +div.geo { + height: 500px; +/* these don't play out too well - somehow the bottom is off padding: 6px; border-width: 1px; border-style: solid; - border-color: #ccc #ccc #999 #ccc; - -webkit-box-shadow: rgba(64, 64, 64, 0.5) 0 2px 5px; - -moz-box-shadow: rgba(64, 64, 64, 0.5) 0 2px 5px; - box-shadow: rgba(64, 64, 64, 0.1) 0 2px 5px; - /*width: 800px;*/ + border-color: #ccaaaa; +*/ } -.map { - /*width: 800px;*/ - height: 500px; +/* the content of the info windows */ +p.geo { + text-align: center; + font-weight: bold; +} + +ul.geo { + list-style-type: none; + text-align: left; +} + +li.geo { + font-style: italic; +} +span.geo { + padding-left: 20px; } diff --git a/plugins/googlemap/static/googlemap.html b/plugins/googlemap/static/googlemap.html index 4aee23be..15b82fb5 100644 --- a/plugins/googlemap/static/googlemap.html +++ b/plugins/googlemap/static/googlemap.html @@ -1,11 +1 @@ -
-
- - -
-
- - {% templatetag openvariable %} action_message {% templatetag closevariable %} -
'; -
-
+
diff --git a/plugins/googlemap/static/js/googlemap.js b/plugins/googlemap/static/js/googlemap.js index 118cfa60..3f3c9950 100644 --- a/plugins/googlemap/static/js/googlemap.js +++ b/plugins/googlemap/static/js/googlemap.js @@ -8,7 +8,9 @@ * - infowindow is not properly reopened when the maps does not have the focus */ -googlemap_debug=true; +// events that happen in the once-per-view range +googlemap_debug=false; +// more on a on-per-record basis googlemap_debug_detailed=false; (function($){ @@ -16,31 +18,38 @@ googlemap_debug_detailed=false; var GoogleMap = Plugin.extend({ init: function(options, element) { - if (googlemap_debug) messages.debug("GoogleMap.init"); this._super(options, element); /* Member variables */ // query status this.received_all = false; this.received_set = false; - this.in_set_buffer = []; + this.in_set_backlog = []; - // key -> { marker, checked } - this.map_markers = {} + // we keep a couple of global hashes + // lat_lon --> { marker,