Hi Harry,
Your "var marker" is done inside a "if" block. You need to declare
your variable at the top of the initialize function if you want
"marker" to be visible below the "if" block. So write :
var marker;
if (geocoder) {
(...)
marker = new google.maps.Marker({
map: map,
position: zentrum,
title: adresse
});
(...)
}
google.maps.event.addListener(marker, 'click', function(event) {
marker.setMap(null);
});
Hope this helps.
Grégoire
> I have a problem in line 168 onhttp://
www.effenberg.de/maps-v3-e.htm
>
> "marker is not defined"
>
> The code is
>
> google.maps.event.addListener(marker, 'click', function(event)
> {
> marker.setMap(null);
> });
>
> But there is always a marker if I remove those lines, no matter if it
> is at it's default place onhttp://
www.effenberg.de/maps-v3.htm
> or at a variable place on i.e.
http://www.effenberg.de/maps-v3.htm?mainstreet