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

Custominzing POI's

Forums

» SDKs - Flash Maps API » Custominzing POI's
Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Custominzing POI's Jack Nicolai 2/24/10 5:36 PM
RE: Custominzing POI's Brian Coakley 3/1/10 4:46 PM
RE: Custominzing POI's Jack Nicolai 3/1/10 6:48 PM
RE: Custominzing POI's Brian Coakley 3/2/10 5:43 PM
Jack Nicolai
Jack Nicolai Rank: Youngling Posts: 15
Join Date: 2/12/10

Recent Posts
Custominzing POI's
Answer (Unmark)
2/24/10 5:36 PM
I am using to the Flash IDE to develop my project. In it I am customizing the POI icons. I have MovieClip assets in the library I am using as the custom icons. They are simple rounded rectangle shapes. The MovieClips have the content's top left corner aligned to the 0,0 point. I am using the same asset for the main and alternate icon options for the POI. See my code sample below. When tested it appears that the size values passed into the setImage method or not being applied. Also, there is some odd behavior with the icon is rolled over. On rollover the alt icon appears to be displaced up(lower on the y-axis) and to the left(lower on the x-axis). If I roll out of the shape from its' top or left side the icon it will reset to the original icon correctly. If I roll out of the shape from its' right or bottom side it does not reset. What is the default behavior for the alt state icon?

Note: If I omit the size values or pass in values that match the dimensions of the original symbol there is no shift.

I am also working with decluttering. I am initially decluttering after the POI's are added to the map. When I roll over a POI it jumps to where it would be located if decluttering had not been executed. The POI remains in that new location until decluttered again.

In the online example for Multiple POI Collections image files are used. In the example the alt size is declared as slightly larger than the original. On rollover the icon appears to re-size from the center.

 1// POIIconEat is a MovieClip in the library
 2var iconEat:Class = POIIconEat;
 3
 4// create and assign the map icons
 5var emi:MapIcon = new MapIcon();
 6emi.setImage(new POIIconEat(), 22, 22);
 7var emiAlt:MapIcon = new MapIcon();
 8emiAlt.setImage(new POIIconEat(), 30, 30);
 9
10var emiPOIemoticonoi = new Poi(emiLL);
11with(emiPOI){
12    icon = emi;
13    altIcon = emiAlt;
14    addEventListener(MouseEvent.ROLL_OVER,onMouseOver);
15    addEventListener(MouseEvent.ROLL_OUT,onMouseOut);
16}
17
18private function onMouseOver(event:MouseEvent):void {
19    event.currentTarget.altStateFlag = true;
20}
21      
22private function onMouseOut(event:MouseEvent):void {
23    event.currentTarget.altStateFlag = false;
24}
Sign in to vote.
Flag
Please sign in to flag this as inappropriate.
  • Top
Brian Coakley
Brian Coakley Rank: Yoda Posts: 2329
Join Date: 10/13/09

Recent Posts
RE: Custominzing POI's
Answer (Unmark)
3/1/10 4:46 PM as a reply to Jack Nicolai.
Glancing at this quickly, one of our developers suggests casting event targets as pois. Something like...


(e.currentTarget as Poi).altStatFlag = true;
Sign in to vote.
Flag
Please sign in to flag this as inappropriate.
  • Top
Jack Nicolai
Jack Nicolai Rank: Youngling Posts: 15
Join Date: 2/12/10

Recent Posts
RE: Custominzing POI's
Answer (Unmark)
3/1/10 6:48 PM as a reply to Brian Coakley.
That does appear to have resolved the issue. Any idea why this was occuring?
Sign in to vote.
Flag
Please sign in to flag this as inappropriate.
  • Top
Brian Coakley
Brian Coakley Rank: Yoda Posts: 2329
Join Date: 10/13/09

Recent Posts
RE: Custominzing POI's
Answer (Unmark)
3/2/10 5:43 PM as a reply to Jack Nicolai.
Honestly, no. Our developer made that suggestion and he is head down on a project right now so since it works, I'm going to have to leave him be. Sorry.
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......