Updated FamilyMap to use current google v3 javascript. No longer needs mxn/ Mapstraction jaqvascript files. Changed name of a css file for using with these maps.

svn: r17937
This commit is contained in:
Rob G. Healey 2011-07-18 22:09:00 +00:00
parent b082ee8d55
commit f8d698aecb
3 changed files with 16 additions and 37 deletions

View File

@ -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 "</script>",
# as it will be added automatically!

View File

@ -104,7 +104,7 @@ div#XMap {
height: 800px;
}
/* Family GoogleV3
/* map_canvas
------------------------------------------------- */
div#map_canvas {
height: 100%;

View File

@ -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"),