# HG changeset patch # User cavaliet # Date 1374139519 -7200 # Node ID ef0fd5125713bc3e12e307ffd36cea9a4e06a1de # Parent 9aa2f966465b3313fbee2b3588ac12913cc0ad00 enhance geographical view and version number to 0.7 diff -r 9aa2f966465b -r ef0fd5125713 src/egonomy/__init__.py --- a/src/egonomy/__init__.py Wed Jul 17 13:23:35 2013 +0200 +++ b/src/egonomy/__init__.py Thu Jul 18 11:25:19 2013 +0200 @@ -1,4 +1,4 @@ -VERSION = (0, 6, 12, "final", 1) +VERSION = (0, 7, 0, "final", 1) VERSION_STR = unicode(".".join(map(lambda i:"%02d" % (i,), VERSION[:2]))) diff -r 9aa2f966465b -r ef0fd5125713 src/egonomy/templates/egonomy_view_collection.html --- a/src/egonomy/templates/egonomy_view_collection.html Wed Jul 17 13:23:35 2013 +0200 +++ b/src/egonomy/templates/egonomy_view_collection.html Thu Jul 18 11:25:19 2013 +0200 @@ -254,13 +254,13 @@ // Locations have now lat and lng, we can init the map initmap(); } -function initmap() { +function initmap(){ // set up the map map = new L.Map('map'); // create the tile layer with correct attribution var osmUrl='http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'; - var osm = new L.TileLayer(osmUrl, {minZoom: 3, maxZoom: 20}); + var osm = new L.TileLayer(osmUrl); // start the map in South-East England map.setView(new L.LatLng(48.833, 2.333),4); @@ -269,14 +269,57 @@ // markers for (var loc in places) { if(places[loc]["location"]["lat"] && places[loc]["location"]["lng"]){ + // Set marker var marker = L.marker([places[loc]["location"]["lat"], places[loc]["location"]["lng"]]).addTo(map); marker.bindPopup(loc); - marker.on('click', function (d) { + places[loc]["marker"] = marker; + // Marker click behaviour : highlight items + marker.on('click', function(d){ // Get the marker's title thanks to leaflet object organisation marker_title = d.target._popup._content; // Get the items highlight_items(places[marker_title]["items"]); }); + // Item hover bevahiour : open/close popup + for(var i=0;i