GMap3 GPolyline addListener problem.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

GMap3 GPolyline addListener problem.

chrome1235
Hi,

When I want to use an event handler in GPolyline, it does not work. For GMarker, there is no problem.

I think the problem is in wicket-gmap.js file at "this.addOverlayListener = function(overlayID, event)" method.

I changed this line
   params['overlay.latLng'] = overlay.getPosition();
with these lines.
   if (overlay.position) {
       params['overlay.latLng'] = overlay.getPosition();
   }

//-----------------------
    this.addOverlayListener = function(overlayID, event) {
        var self = this;
        var overlay = this.overlays[overlayID];
        google.maps.event.addListener(overlay, event, function() {
            var params = {};
            for ( var p = 0; p < arguments.length; p++) {
                if (arguments[p] != null) {
                    params['argument' + p] = arguments[p];
                }
            }
//changed..
            if (overlay.position) {
                params['overlay.latLng'] = overlay.getPosition();
            }
 
           params['overlay.overlayId'] = overlay.overlayId;
            params['overlay.event'] = event;
            self.onEvent(self.overlayListenerCallbackUrl, params);
        });
    }
Reply | Threaded
Open this post in threaded view
|

Re: GMap3 GPolyline addListener problem.

rlkraus
thank you! guess this is still a bug that should be fixed