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:
parent
b082ee8d55
commit
f8d698aecb
@ -4133,24 +4133,6 @@ class IndividualPage(BasePage):
|
|||||||
|
|
||||||
jsc += """
|
jsc += """
|
||||||
var mapCenter = new google.maps.LatLng(%s, %s);
|
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;
|
var map;
|
||||||
|
|
||||||
function initialize() {
|
function initialize() {
|
||||||
@ -4160,26 +4142,23 @@ class IndividualPage(BasePage):
|
|||||||
center: mapCenter
|
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() {
|
var markers = new google.maps.Marker({
|
||||||
for (var i = 0; i < markerPoints.length; i++) {
|
position: latlong,
|
||||||
setTimeout(function() {
|
|
||||||
addMarker();
|
|
||||||
}, i * 200);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function addMarker() {
|
|
||||||
markers.push(new google.maps.Marker({
|
|
||||||
position: markerPoints[iterator],
|
|
||||||
map: map,
|
map: map,
|
||||||
draggable: true,
|
draggable: true,
|
||||||
animation: google.maps.Animation.DROP
|
animation: google.maps.Animation.BOUNCE
|
||||||
}));
|
});
|
||||||
iterator++;
|
}"""
|
||||||
}""" % zoomlevel
|
|
||||||
# there is no need to add an ending "</script>",
|
# there is no need to add an ending "</script>",
|
||||||
# as it will be added automatically!
|
# as it will be added automatically!
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ div#XMap {
|
|||||||
height: 800px;
|
height: 800px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Family GoogleV3
|
/* map_canvas
|
||||||
------------------------------------------------- */
|
------------------------------------------------- */
|
||||||
div#map_canvas {
|
div#map_canvas {
|
||||||
height: 100%;
|
height: 100%;
|
@ -107,8 +107,8 @@ def load_on_reg(dbstate, uistate, plugin):
|
|||||||
path_css('behaviour.css'), None, [], []],
|
path_css('behaviour.css'), None, [], []],
|
||||||
|
|
||||||
# mapstraction style sheet for NarrativeWeb place maps
|
# mapstraction style sheet for NarrativeWeb place maps
|
||||||
["mapstraction", 0, "mapstraction",
|
["mapstraction", 0, "",
|
||||||
path_css("Mapstraction.css"), None, [],
|
path_css("narrative-maps.css"), None, [],
|
||||||
[path_js("mapstraction", "mxn.core.js"),
|
[path_js("mapstraction", "mxn.core.js"),
|
||||||
path_js("mapstraction", "mxn.googlev3.core.js"),
|
path_js("mapstraction", "mxn.googlev3.core.js"),
|
||||||
path_js("mapstraction", "mxn.js"),
|
path_js("mapstraction", "mxn.js"),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user