back | source
How to check an overlay type after clicking
  1. After you create a Marker or Geometry that you want then let's use event 'overlayClick'
    map.Event.bind('overlayClick', function(overlay) {
      if (overlay instanceof longdo.Marker) {
        document.getElementById('overlayselect').innerHTML = 'Marker';
      } else if(overlay instanceof longdo.Polyline){
        document.getElementById('overlayselect').innerHTML = 'Polyline';
      } else if(overlay instanceof longdo.Polygon){
        document.getElementById('overlayselect').innerHTML = 'Polygon';
      } else if(overlay instanceof longdo.Dot){
        document.getElementById('overlayselect').innerHTML = 'Dot';
      } else if(overlay instanceof longdo.Circle){
        document.getElementById('overlayselect').innerHTML = 'Circle';
      }
    });
    • overlayClick: User click overlay event
    Example
  2. click overlay

    More information: Event Handler