You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Without callbacks for actions it's hard to take full use of map features. Like I wanted to highlight a result on list when infobubble is opened and de-highlight it when closed.
I've hacked the googlv3.core.js and added custom attribute for markers:
@@ -636,6 +658,8 @@ Marker: {
this.openInfoBubble.fire( { 'marker': this } );
infowindow.open(this.map, this.proprietary_marker);
this.proprietary_infowindow = infowindow; // Save so we can close it later
+ var callback = marker.getAttribute('bubbleOpenedCallback');
+ callback(marker);
},
closeBubble: function() {
@@ -643,6 +667,8 @@ Marker: {
this.proprietary_infowindow.close();
this.proprietary_infowindow = null;
this.closeInfoBubble.fire( { 'marker': this } );
+ var callback = this.getAttribute('bubbleClosedCallback');
+ callback();
}
},
@@ -711,3 +737,4 @@ Polyline: {
It's not a generic solution, but such callbacks would be very handy in general.
Closing other infobubbles on Google v3 when another one is getting opened could also be a callback or built it (openstreetmap closes other bubbles) - mxn.googlev3.core.js release-3.0 branch:
Without callbacks for actions it's hard to take full use of map features. Like I wanted to highlight a result on list when infobubble is opened and de-highlight it when closed.
I've hacked the googlv3.core.js and added custom attribute for markers:
It's not a generic solution, but such callbacks would be very handy in general.
Closing other infobubbles on Google v3 when another one is getting opened could also be a callback or built it (openstreetmap closes other bubbles) - mxn.googlev3.core.js release-3.0 branch:
The text was updated successfully, but these errors were encountered: