Hallo,

ich bin neu in Sachen GoogleMaps und relativ neu mit JavaScript.
Mein Problem ist folgendes:
Ich erstelle per Klick auf die Map einen Marker, dieser bekommt ein
dbclick event
um ein htmlWindow anzuzeigen.
Das funktioniert eigentlich auch ganz gut, bis auf das das Window
immer am letzten Marker angezeigt wird (aber der htmlText ist
richtig).

    function initialize() {
      if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("map"));
        var meinMarker;
        map.setCenter(new GLatLng(51.55822311449297,
7.208415269851685), 15);
                var mapControl = new GMapTypeControl();
                map.addControl(mapControl);
                map.addControl(new GLargeMapControl());
                GEvent.addListener(map,"click",function(e,t) {
                        map.addOverlay(createMarker(t));
                });
      }
    }

    function createMarker(point){
                meinMarker = new GMarker(point);
                markerPool[counter] = meinMarker;
                var s = "<%=mjb.getVariablen()%>";
                var myArray = s.split(",");
                clickCounter++;
                var currentStation = myArray[clickCounter-1];
                GEvent.addListener(meinMarker, "dblclick", function() {
                        meinMarker.openInfoWindowHtml(currentStation);
                });
                counter++;
                return meinMarker;

    }

Danke für die Hilfe.

MbG

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to