Simplified the python and style sheet code for Place Maps.
svn: r15570
This commit is contained in:
parent
d6fa234f9b
commit
82cb3ff0cc
@ -31,25 +31,15 @@ div#mapstraction {
|
|||||||
|
|
||||||
/* Middle
|
/* Middle
|
||||||
------------------------------------------------- */
|
------------------------------------------------- */
|
||||||
|
|
||||||
div#middle {
|
div#middle {
|
||||||
float: center;
|
float: center;
|
||||||
height: 400px;
|
height: 400px;
|
||||||
width: 60%;
|
width: 60%;
|
||||||
margin: 10px 0px 10px 0px;
|
margin: 10px 0px 10px 0px;
|
||||||
padding: 0% 20% 0% 20%;
|
padding: 0% 20% 0% 20%;
|
||||||
text-align: center;
|
|
||||||
}
|
}
|
||||||
div#middle div#geo-info {
|
div#middle div#geo-info {
|
||||||
font: bold 6px serif;
|
font: bold 6px sans-serif;
|
||||||
}
|
|
||||||
div#middle a {
|
|
||||||
color: #000;
|
|
||||||
background: none;
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
div#middle a:hover {
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* GoogleV3
|
/* GoogleV3
|
||||||
@ -57,5 +47,4 @@ div#middle a:hover {
|
|||||||
div#googlev3 {
|
div#googlev3 {
|
||||||
height: 400px;
|
height: 400px;
|
||||||
width: 500px;
|
width: 500px;
|
||||||
margin-bottom: 6px;
|
|
||||||
}
|
}
|
||||||
|
@ -356,13 +356,9 @@ class BasePage(object):
|
|||||||
head += Html("script", type = "text/javascript",
|
head += Html("script", type = "text/javascript",
|
||||||
src = "http://maps.google.com/maps/api/js?sensor=false", inline = True)
|
src = "http://maps.google.com/maps/api/js?sensor=false", inline = True)
|
||||||
|
|
||||||
# add openlayers specific javascript code
|
|
||||||
head += Html("script", src = "http://openlayers.org/api/OpenLayers.js", inline = True)
|
|
||||||
|
|
||||||
# add mapstraction javascript code
|
# add mapstraction javascript code
|
||||||
fname = "/".join(["mapstraction", "mxn.js"])
|
fname = "/".join(["mapstraction", "mxn.js?(googlev3)"])
|
||||||
url = self.report.build_url_fname(fname, None, self.up)
|
url = self.report.build_url_fname(fname, None, self.up)
|
||||||
url += "?(googlev3,openlayers)"
|
|
||||||
head += Html("script", src = url, inline = True)
|
head += Html("script", src = url, inline = True)
|
||||||
|
|
||||||
# Place Map division
|
# Place Map division
|
||||||
@ -410,46 +406,18 @@ class BasePage(object):
|
|||||||
|
|
||||||
//add a marker
|
//add a marker
|
||||||
add_marker();
|
add_marker();
|
||||||
}
|
|
||||||
|
|
||||||
function add_marker() {
|
// add marker
|
||||||
var marker;
|
var marker;
|
||||||
marker = new mxn.Marker(latlon);
|
marker = new mxn.Marker(latlon);
|
||||||
|
|
||||||
// openlayers mapstraction problem here : drift if anchor.
|
|
||||||
if ( provider == 'googlev3' ) {
|
|
||||||
marker.setIcon('../../../images/gramps-geo-' +icon+ '.png',
|
|
||||||
[22,22],
|
|
||||||
[0,22]);
|
|
||||||
} else {
|
|
||||||
marker.setIcon('../../../images/gramps-geo-' +icon+ '.png',
|
|
||||||
[22,22]);
|
|
||||||
};
|
|
||||||
map.addMarker(marker,true);
|
map.addMarker(marker,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeprovider() {
|
|
||||||
if ( pprovider == 'googlev3') {
|
|
||||||
provider = 'openlayers';
|
|
||||||
icon = 'mainmap';
|
|
||||||
} else {
|
|
||||||
provider = 'googlev3';
|
|
||||||
icon = 'altmap';
|
|
||||||
};
|
|
||||||
mao.swap(provider, provider);
|
|
||||||
add_marker();
|
|
||||||
}
|
|
||||||
|
|
||||||
//]]>"""
|
//]]>"""
|
||||||
|
|
||||||
# there is no need to add an ending "</script>" as it will be added automatically!
|
# there is no need to add an ending "</script>" as it will be added automatically!
|
||||||
|
|
||||||
middle += Html("div", id = "googlev3", inline = True)
|
middle += Html("div", id = "googlev3", inline = True)
|
||||||
middle += Html("div", id = "openlayers", inline = True)
|
|
||||||
|
|
||||||
middle += Html("a", _("change provider"), attr = 'onclick = "changeprovider();"',
|
|
||||||
href = "#", inline = True)
|
|
||||||
|
|
||||||
# return placedetail division back to its callers
|
# return placedetail division back to its callers
|
||||||
return placedetail, head
|
return placedetail, head
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user