<script type="text/javascript">
//<![CDATA[
var map = null;
var geocoder = null;
function load() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map"));
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
//Vis længde/bredde grader i bunden
GEvent.addListener(map, "moveend", function() {
var center = map.getCenter();
});
map.setCenter(new GLatLng(56.30434864830831,10.34912109375),5);
geocoder = new GClientGeocoder();
//sæt zoom på
map.addControl(new GSmallMapControl());map.addControl(new GMapTypeControl());
// Create our "tiny" marker icon
var icon = new GIcon();
function henticon(iconet) {
icon.image = "
http://labs.google.com/ridefinder/images/mm_20_"+iconet+".png";icon.shadow = "
http://labs.google.com/ridefinder/images/mm_20_shadow.png";icon.iconSize = new GSize(12, 20);
//icon.iconSize = new GSize(38, 33);
icon.shadowSize = new GSize(22, 20);
icon.iconAnchor = new GPoint(6, 20);
//icon.infoWindowAnchor = new GPoint(5, 1);
icon.infoWindowAnchor = new GPoint(5, 1);
return icon;
}
// Creates a marker at the given point with the given number label
function createMarker(point, number, tekst,ikonet,titeltekst,url) {
henticon(ikonet);
//var marker = new GMarker(point, icon);
var marker = new GMarker(point,{ title: titeltekst, icon: icon });
GEvent.addListener(marker, "click", function() {
//location.href=url+'';
parent.location.href=url;
//marker.openInfoWindowHtml(tekst);
});
/*mouseover effekten
GEvent.addListener(marker, "mouseover", function() {
marker.openInfoWindowHtml("tekst");
});
//slut mouseover effekt*/
return marker;
}
function showAddress(address,tekst,ikonet,titeltekst,url) {
if (geocoder) {
geocoder.getLatLng(
address,
function(point) {
if (!point) {
//alert(address + " blev ikke fundet");
} else {
//henticon('brown');
//map.setCenter(point, 10);
var marker = new GMarker(point);
map.addOverlay(createMarker(point,400,tekst,ikonet,titeltekst,url));
//marker.openInfoWindowHtml(address);
}
}
);
}
}