On Nov 2, 3:19 pm, Nick <[EMAIL PROTECTED]> wrote:
> ExtInfoWindow doesn't allow you to have more than one open at a time.
>
> I want GMarker to emit an "extinfowindowclose" event because I'm
> setting up a unique listener for that event for each marker.
>
> I just searched around some more, and found this bug report, which
> includes a solution to my 
> problem:http://code.google.com/p/gmaps-utility-library-dev/issues/detail?id=66
>
> I've patched extinfowindow.js with the suggestion in the bug report,
> and confirm that GMarker now emits an "extinfowindowclose" event when
> its ExtInfoWindow is closed.
>
> Cheers,
> Nick

I just found another solution, which is less intrusive than modifying
extinfowindow.js :

function create_marker(lat, lng) {
  // Validate arguments here.

  var marker = new GMarker(...);

  GEvent.addListener(marker, 'click', function() {
    marker.openExtInfoWindow(...);
    current_open_marker = marker;
    });

  GEvent.addListener(marker, 'extinfowindowclose', function() {
    // Do whatever you want here.
    });

  return marker;
  }

Event.observe(window, 'load', function() {
  current_open_marker = undefined;

  GEvent.addListener(RentalMap, 'extinfowindowclose', function() {
    GEvent.trigger(current_open_marker, 'extinfowindowclose');
    current_open_marker = undefined;
    });
  });

What do you guys think?
-Nick
--~--~---------~--~----~------------~-------~--~----~
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