[aida] Javascripts
Dirk Verleysen
dirk.verleysen at roots.be
Tue Oct 2 17:57:31 CEST 2007
New question but I first want to thank Nicholas and Janko for their
answers.
I want to display a googlemap. I need some javascript in my code.
The first line is this one:
<script type="text/javascript"
src="http://maps.google.com/maps?file=api&v=2&key=myKeyxxxx"></s
cript>
Then there is this javascript code that I need in the html file. I tried
putting it in an external file but this didn't work.
<script>
//<![CDATA[
function load() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map"));
var geocoder = null;
var trafficInfo = new GTrafficOverlay();
map.setCenter(new GLatLng(50.968580,4.073543,0), 15);
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
geoCode = new GClientGeocoder();
var encodedPolyline = new GPolyline.fromEncoded({
color: "#09E466",
weight: 10,
points: "gxavHgvzW{GiItCwElAbD_ op h@lC`Eq op tC",
levels: "BBBBBBB",
zoomFactor: 32,
numLevels: 4
});
map.addOverlay(encodedPolyline);
} }
function showAddress(address) {
geocoder.getLatLng(
address,
function(point) {
if (!point) {
alert(address + " not found");
} else {
map.setCenter(point, 13);
var marker = new GMarker(point);
map.addOverlay(marker);
marker.openInfoWindowHtml(address);
}
}
);
}
//]]>
</script>
The <body> tag also needs the onLoad="load()" onUnload="GUnload()".
What's the best way to deal with this ?
Dirk
------------- volgend deel ------------
Een HTML-bijlage is verwijderd...
URL: http://lists.aidaweb.si/pipermail/aida/attachments/20071002/66086808/attachment.htm
More information about the Aida
mailing list