codesite-noreply at google.com
2009-Nov-04 16:35 UTC
[Mapstraction] [mapstraction] r53 committed - applied patch from John McKerrell
Revision: 53 Author: freyfogle Date: Wed Nov 4 08:34:55 2009 Log: applied patch from John McKerrell http://code.google.com/p/mapstraction/source/detail?r=53 Modified: /trunk/source/mxn.cloudmade.core.js ======================================--- /trunk/source/mxn.cloudmade.core.js Sun Sep 20 06:30:15 2009 +++ /trunk/source/mxn.cloudmade.core.js Wed Nov 4 08:34:55 2009 @@ -7,6 +7,21 @@ var cloudmade = new CM.Tiles.CloudMade.Web({key: cloudmade_key}); this.maps[api] = new CM.Map(element, cloudmade); this.loaded[api] = true; + + CM.Event.addListener(this.maps[api], ''click'', function(location,marker) { + if ( marker && marker.mapstraction_marker ) { + marker.mapstraction_marker.click.fire(); + } + else if ( location ) { + me.click.fire({''location'': new mxn.LatLonPoint(location.lat(), location.lng())}); + } + + // If the user puts their own Google markers directly on the map + // then there is no location and this event should not fire. + if ( location ) { + me.clickHandler(location.lat(),location.lng(),location,me); + } + }); }, applyOptions: function(){ @@ -87,6 +102,7 @@ removeMarker: function(marker) { var map = this.maps[this.api]; + marker.proprietary_marker.closeInfoWindow(); map.removeOverlay(marker.proprietary_marker); },