diff --git a/src/plugins/webreport/NarrativeWeb.py b/src/plugins/webreport/NarrativeWeb.py index 0886eed38..877f7da74 100644 --- a/src/plugins/webreport/NarrativeWeb.py +++ b/src/plugins/webreport/NarrativeWeb.py @@ -4133,24 +4133,6 @@ class IndividualPage(BasePage): jsc += """ var mapCenter = new google.maps.LatLng(%s, %s); - - var markerPoints = [""" % (centerX, centerY) - - for index in xrange(0, (number_markers - 1)): - (lat, long, p, h, d) = place_lat_long[index] - - jsc += """ - new google.maps.LatLng(%s, %s),""" % (lat, long) - - (lat, long, p, h, d) = place_lat_long[-1] - jsc += """ - new google.maps.Latlng(%s, %s) - ];""" % (lat, long) - - jsc += """ - var markers = []; - var iterator = 0; - var map; function initialize() { @@ -4160,26 +4142,23 @@ class IndividualPage(BasePage): center: mapCenter }; - map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions); + map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);""" % ( + centerX, centerY, zoomlevel) + for (latitude, longitude, p, h, d) in place_lat_long: + jsc += """ + addMarker(%s, %s);""" % (latitude, longitude) + jsc += """ } + function addMarker(latitude, longitude) { + var latlong = new google.maps.LatLng(latitude, longitude); - function drop() { - for (var i = 0; i < markerPoints.length; i++) { - setTimeout(function() { - addMarker(); - }, i * 200); - } - } - - function addMarker() { - markers.push(new google.maps.Marker({ - position: markerPoints[iterator], + var markers = new google.maps.Marker({ + position: latlong, map: map, draggable: true, - animation: google.maps.Animation.DROP - })); - iterator++; - }""" % zoomlevel + animation: google.maps.Animation.BOUNCE + }); + }""" # there is no need to add an ending "", # as it will be added automatically! diff --git a/src/plugins/webstuff/css/Mapstraction.css b/src/plugins/webstuff/css/narrative-maps.css similarity index 99% rename from src/plugins/webstuff/css/Mapstraction.css rename to src/plugins/webstuff/css/narrative-maps.css index 452aa11e9..116695a28 100644 --- a/src/plugins/webstuff/css/Mapstraction.css +++ b/src/plugins/webstuff/css/narrative-maps.css @@ -104,7 +104,7 @@ div#XMap { height: 800px; } -/* Family GoogleV3 +/* map_canvas ------------------------------------------------- */ div#map_canvas { height: 100%; diff --git a/src/plugins/webstuff/webstuff.py b/src/plugins/webstuff/webstuff.py index 4448c81fe..367f5de21 100644 --- a/src/plugins/webstuff/webstuff.py +++ b/src/plugins/webstuff/webstuff.py @@ -107,8 +107,8 @@ def load_on_reg(dbstate, uistate, plugin): path_css('behaviour.css'), None, [], []], # mapstraction style sheet for NarrativeWeb place maps - ["mapstraction", 0, "mapstraction", - path_css("Mapstraction.css"), None, [], + ["mapstraction", 0, "", + path_css("narrative-maps.css"), None, [], [path_js("mapstraction", "mxn.core.js"), path_js("mapstraction", "mxn.googlev3.core.js"), path_js("mapstraction", "mxn.js"),