codesite-noreply at google.com
2009-Oct-08 18:04 UTC
[Mapstraction] [mapstraction] r48 committed - Marker and map click events added
Revision: 48 Author: duvander Date: Thu Oct 8 11:03:12 2009 Log: Marker and map click events added http://code.google.com/p/mapstraction/source/detail?r=48 Modified: /trunk/source/mxn.google.core.js /trunk/source/mxn.googlev3.core.js ======================================--- /trunk/source/mxn.google.core.js Sat Oct 3 09:29:49 2009 +++ /trunk/source/mxn.google.core.js Thu Oct 8 11:03:12 2009 @@ -14,7 +14,7 @@ marker.mapstraction_marker.click.fire(); } else if ( location ) { - me.click.fire({''location'': new mxn.LatLonPoint(location.y, location.x)}); + /*me.click.fire({''location'': new mxn.LatLonPoint(location.y, location.x)});*/ } // If the user puts their own Google markers directly on the map ======================================--- /trunk/source/mxn.googlev3.core.js Thu Oct 8 10:48:23 2009 +++ /trunk/source/mxn.googlev3.core.js Thu Oct 8 11:03:12 2009 @@ -13,6 +13,9 @@ var map = new google.maps.Map(element, myOptions); // deal with click + google.maps.event.addListener(map, ''click'', function(location){ + me.clickHandler(location.latLng.lat(),location.latLng.lng(),location,me); + }); // deal with zoom change google.maps.event.addListener(map, ''zoom_changed'', function(){ @@ -346,6 +349,10 @@ var icon = new google.maps.MarkerImage(this.iconUrl); google.maps.event.addListener(marker, "mouseout", function(){ marker.setIcon(icon); }); } + + google.maps.event.addListener(marker, ''click'', function() { + marker.mapstraction_marker.click.fire(); + }); return marker; },