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

Custom Marker

Forums

» SDKs - Open JavaScript Maps API » Custom Marker
Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Custom Marker Brennan Ujcich 1/5/12 4:36 PM
RE: Custom Marker Jonathan Harahush 1/6/12 11:01 AM
Brennan Ujcich
Brennan Ujcich Rank: Neighborly Posts: 10
Join Date: 12/19/11

Recent Posts
Custom Marker
Answer (Unmark)
1/5/12 4:36 PM
Hello all, I am trying to place a multiple markers on a JS map, and I want one particular POI to stand out. I would like to use a different color marker. I have found the code to place a custom icon, but I cannot find any that match the map. Is there anywhere I can source a different color mapquest marker, or is there a way programatically to change the marker color. Below is the code I am using for a custom marker.

 1                //Add Marker for root location
 2                var root = new MQA.Poi({ lat: txtCityLAT, lng: txtCityLNG });
 3
 4                //Create Icon
 5                var icon = new MQA.Icon("./marker.png", 32, 32);
 6
 7                /*This tells the POI to use the Icon object that was created rather than the default POI icon.*/
 8                root.setIcon(icon);
 9
10                /*This will add the POI to the map in the map's default shape collection.*/
11                map.addShape(root);


Thanks,
Brennan
Sign in to vote.
Flag
Please sign in to flag this as inappropriate.
  • Top
Jonathan Harahush
Jonathan Harahush Rank: Neighborly Posts: 18
Join Date: 12/5/11

Recent Posts
RE: Custom Marker
Answer (Unmark)
1/6/12 11:01 AM as a reply to Brennan Ujcich.
Hi Brennan,

There are other POI icons available that you can use and the documentation is located here. If you have any questions or need help, let me know!

Jonathan
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......