http://developer.mapquest.com/web/guest
MapQuest Developer Network
  • Sign In  |
  • Create Account  |
  • Contact Us
  •   |
  • Quick Start  |
    For Businesses For Developers For Easy Mapping Tools Get MapQuest AppKey
  • Business Solutions  |
    Enterprise Solutions Business Listings
  • APIs  |
    Licensed Data APIs Open Data APIs Licensed vs. Open Data
  • Mapping Tools  |
    Overview Map Builder Route Planner Link to MapQuest Link to Route Planner Distance Calculator Latitude/Longitude Finder Static Map Wizard
  • Resources  |
    Licensed vs. Open Data Developer Guides Terms Overview Terms of Use
  • Blog  |
    MapQuest Developer Blog MapQuest Blog
  • Support
    FAQ Forums Contact
Answer ( Unmark )
Mark as an Answer

RolloverWindow

Forums

» SDKs - Open Flash Maps API » RolloverWindow
Combination View Flat View Tree View
Threads [ Previous | Next ]
Tommy Wirestam
Tommy Wirestam Rank: Neighborly Posts: 9
Join Date: 2/27/12

Recent Posts
RolloverWindow
Answer (Unmark)
3/5/12 10:40 AM
Hi,

For some map markers I would like an information window to pop up at rollover instead of simply the marker title. Another way to describe it, is that I want the InfoWindow to be visible immediately at rollover.

As there is an object called RolloverWindow, it sounds like the thing I would use here. But the documentation is almost non-existent, so could you please tell me how to use one of these windows.

Tommy
Sign in to vote.
Flag
Please sign in to flag this as inappropriate.
  • Top
Brian Coakley
Brian Coakley Rank: Neighborly Posts: 21
Join Date: 10/13/09

Recent Posts
RE: RolloverWindow
Answer (Unmark)
3/5/12 2:27 PM as a reply to Tommy Wirestam.
Here is how I did it.

 1                var poi4emoticonoi=new Poi(new LatLng(39.7503,-104.9972));
 2                poi4.rolloverAndInfoTitleText="4a";
 3                poi4.infoContent="quatro";
 4                poi4.addEventListener(MouseEvent.ROLL_OVER,onPoiMouseEvent);
 5                pois.add(poi4);
 6
 7...
 8
 9
10            private function onPoiMouseEvent(event:MouseEvent):void{
11                var thepoiemoticonoi=Poi(event.target);
12                thepoi.showInfoWindow();
13            }



DIE SMILEYS, DIE
Sign in to vote.
Flag
Please sign in to flag this as inappropriate.
  • Top
Brian Coakley
Brian Coakley Rank: Neighborly Posts: 21
Join Date: 10/13/09

Recent Posts
RE: RolloverWindow
Answer (Unmark)
3/5/12 2:31 PM as a reply to Brian Coakley.
Better yet (less code is always better)...

1poi4.addEventListener(MouseEvent.ROLL_OVER,function onPoiMouseEvent(event:MouseEvent):void{(Poi(event.target)).showInfoWindow();});



smileys dead!!!
Sign in to vote.
Flag
Please sign in to flag this as inappropriate.
  • Top
Tommy Wirestam
Tommy Wirestam Rank: Neighborly Posts: 9
Join Date: 2/27/12

Recent Posts
RE: RolloverWindow
Answer (Unmark)
3/6/12 10:17 AM as a reply to Brian Coakley.
Thanks Brian,

that would have been great, but there doesn't seem to be any hideInfoWindow() method:

1poi4.addEventListener(MouseEvent.ROLL_OUT,onLeavePoi);
2
3private function onLeavePoi(event:MouseEvent):void{
4    var thepoi: Poi = Poi(event.target);
5    thepoi.hideInfoWindow();
6}


The user surely doesn't want to close the InfoWindow manually every time he happens to mouse-over a marker.

Tommy
Sign in to vote.
Flag
Please sign in to flag this as inappropriate.
  • Top
Brian Coakley
Brian Coakley Rank: Neighborly Posts: 21
Join Date: 10/13/09

Recent Posts
RE: RolloverWindow
Answer (Unmark)
3/6/12 10:40 AM as a reply to Tommy Wirestam.
Here is how I did it.

1poi4.addEventListener(MouseEvent.ROLL_OUT,function(event:MouseEvent):void{(Poi(event.target)).infoWindow.hide()});
Sign in to vote.
Flag
Please sign in to flag this as inappropriate.
  • Top
Brian Coakley
Brian Coakley Rank: Neighborly Posts: 21
Join Date: 10/13/09

Recent Posts
RE: RolloverWindow
Answer (Unmark)
3/6/12 10:56 AM as a reply to Brian Coakley.
Here is my poi4 now.

1poi4=new Poi(new LatLng(39.7503,-104.9972));
2poi4.rolloverAndInfoTitleText="4";
3poi4.infoContent="quatro";
4poi4.addEventListener(MouseEvent.ROLL_OVER,function(e:MouseEvent):void{(Poi(e.target)).showInfoWindow();});
5poi4.addEventListener(MouseEvent.ROLL_OUT,function(e:MouseEvent):void{(Poi(e.target)).infoWindow.hide()});
6map.addShape(poi4);
Sign in to vote.
Flag
Please sign in to flag this as inappropriate.
  • Top
Tommy Wirestam
Tommy Wirestam Rank: Neighborly Posts: 9
Join Date: 2/27/12

Recent Posts
RE: RolloverWindow
Answer (Unmark)
3/6/12 5:39 PM as a reply to Brian Coakley.
Thanks Brian,

that seems to be working - I did not think of looking in the InfoWindow class for the hide() and show() methods.

However, it looks like I am the number one bugfinder at the moment - and I'm sorry to say, but I seem to have found another one. If you look at your example "POI with HTML InfoWindow" and click the Chicago marker to show the infowindow a couple of times, you will see that the size of the text changes to make it unreadable. The same thing happens with my infowindows. I guess the InfoWindow is using a TextArea or TextField object - is there any way to get access to it?

Tommy
Sign in to vote.
Flag
Please sign in to flag this as inappropriate.
  • Top
Brian Coakley
Brian Coakley Rank: Neighborly Posts: 21
Join Date: 10/13/09

Recent Posts
RE: RolloverWindow
Answer (Unmark)
3/7/12 8:39 AM as a reply to Tommy Wirestam.
Yup, it looks like you are our top bug finder this week. Sorry, no prize besides glory, respect, and a little swagger in your step (Penguins of Madagascar). This has been forwarded on to the Flash development team.
Sign in to vote.
Flag
Please sign in to flag this as inappropriate.
  • Top
Platforms & Technologies
Quick Start for Developers
Quick Start for Easy Mapping Tools
Licensed Data APIs
Open Data APIs
Popular Products
JavaScript Maps API
Flex Map API
Geocoding API Web Service
Directions API Web Service
Search API Web Service
Support
Licensing
Developer Forums
Contact Us
FAQ
Products
MapQuest.com
Mobile Products
Route Planner
Gas Prices
Follow MapQuest
MapQuest Developer Blog
MapQuest Blog
MapQuest on Facebook
MapQuest on Twitter
Join our Mailing List

©2012 MapQuest, Inc. All rights reserved.    Privacy Policy | Terms of Use

Site Map | Help

Loading......