-
3 Jan 2013 4:15 PM #1
Unanswered: How do I add event to google.maps.InfoWindow() - on the popup window of marker?
Unanswered: How do I add event to google.maps.InfoWindow() - on the popup window of marker?
I have markers displayed on a map, but I can't figure out how to add an event after the google.maps.InfoWindow() opens the popup marker. I want the user to click on the pop window and then see the details of the results. Thanks for your help.
-
5 Jan 2013 7:41 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 438
- Answers
- 3113
After you execute the open() method on the infowindow then use the fireEvent method on the component (not the google map, the ST Ext.Map)
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
5 Jan 2013 12:57 PM #3
Thank you for your response. I'm new to Sencha. Where would I put the firevent in the code snippet below? I basically want the event to be called when someone taps on a specific marker.
var infoWindow = new google.maps.InfoWindow({
content: tooltip
});
google.maps.event.addListener(marker, 'click', function() {
infoWindow.open(myMap.getMap(), marker);
});
-
5 Jan 2013 1:06 PM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 438
- Answers
- 3113
Right after
Code:infoWindow.open(myMap.getMap(), marker);
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
5 Jan 2013 1:11 PM #5
Sorry, but the part I'm stuck on is "use the fireEvent method on the component (not the google map, the ST Ext.Map)". I can't figure out how to use the fireEvent method.
-
5 Jan 2013 1:12 PM #6Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 438
- Answers
- 3113
Here is a sample:
The 'eventname' is the event you want to fire. arg1, arg2 are just arguments you want to send, this can be any number of arguments.Code:component.fireEvent('eventname', arg1, arg2);Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.


Reply With Quote