Archives for JavaScript

Subscribe
  1. Dual road shields, improved city labeling and coastline trimming


    If you are using MapQuest-OSM tiles in your application — either by accessing the map tiles directly or using the Open JavaScript Maps API, Open Flash Maps API, or Open Static Maps API – you probably noticed quite a few improvements to the look and feel of the tiles over the past few days.

    The most noticeable improvement is the addition of terrain, but there are quite a few other style-related improvements that we’re excited to announce as well:

    • Support for dual road shields
    • Improved road shield spacing
    • Improved road shield density per zoom level
    • Improved city styles
    • Improved tunnel styles
    • Improved coastline trimming

    Did you know that MapQuest started offering tiles based on OpenStreetMap data back in 2010? Since then, we’ve expanded our Open data offerings to include a number of APIs – all of which are free to anyone who would like to use them. Unlike our licensed data offerings, MapQuest-OSM tiles are available for direct access and can be consumed by other mapping toolkits, such as Leaflet and OpenLayers.

    Have questions or need help getting started with using MapQuest-OSM tiles? Feel free to check out the Open Initiatives – Tiles forum on the MapQuest Developer Network or tweet us. We love to hear from developers who are using our tiles and APIs!

    Terrain and improved tunnel styling

  2. Despite the many mapping industry changes, where tech giants are switching providers on what seems like a daily basis, OpenStreetMap has been the clear leader in meaningful solutions. Their lack of legal and technical restrictions, not to mention the remarkable level of contributors and data contributed, make them a popular alternative to other commercially available datasets.

    MapQuest first began offering products and services based on data from OpenStreetMap back in July 2010, and today we’re extremely proud to be announcing a slew of updates to our Open APIs – all of which are still available for free and without any limit on transactions!

    Open JavaScript Maps API v7.0

    Multipoint routing using the Open JavaScript API v7.0

    This highly anticipated update includes several major improvements to the API:

    Open Aerial Tiles
    For those of you looking to add aerial imagery to your application, you’ll be happy to learn the MapQuest Open Aerial Tiles have been fully integrated into the API. The tiles are composed only of imagery in the public domain (or released under similar licenses) and can be used for any purpose without any restrictions.

    Geolocation Control
    As the name indicates, this new control can be used to detect the user’s location and automatically re-center the map. A custom handler can also be added to perform a task, such as getting directions to the nearest ice cream shop after the user has been geolocated.

    Increased Mobile Support
    A major focus for the v7.0 release was to significantly improve performance and functionality on mobile devices. Key bug fixes were made in order to better handle touch events and increase support for pop-up InfoWindows and other popular features.

    Many, many more upgrades are still to come, but we think you’ll love all the enhancements we’ve already made! We strongly encourage you to switch to the new Open JavaScript API v7.0 and check out the much improved Developer’s Guide.

    Open Geocoding API

    One obstacle with using OpenStreetMap has always been geocoding, but the new Open Geocoding API (our first stab at releasing a first-rate open geocoder) allows users to geocode, reverse geocode and batch geocode addresses. Powered by Nominatim, the Open Geocoding API makes it possible for users to specify which country to search, which city to search, and use other advanced specifications to further refine their request.

    Basic Geocode Request:
    http://open.mapquestapi.com/geocoding/v1/address?location=Lancaster,PA

    Advanced Geocode Request:
    http://open.mapquestapi.com/geocoding/v1/address?json={location:{city:”Portland”,state:”OR”}}

    To learn more about the API, including information about returning the geocode quality and static map thumbnails in the response, be sure to read the Open Geocoding Developer’s Guide. If you also have suggestions on how we can improve the service, please let us know!

    Open Directions API, Open Guidance API & Open Static Map API

    Continuing with the geocoding theme, both the Open Directions API and Open Guidance API now support addresses as their input.

    Example:
    http://open.mapquestapi.com/directions/v1/route?from=Lancaster,PA&to=York,PA&ambiguities=ignore

    The Open Static Map API has also been updated to support address locations when making a getplacemap request.

    Example:
    http://open.mapquestapi.com/staticmap/v4/getplacemap?location=1090 N Charlotte St, Lancaster, PA&size=500,300&type=map&zoom=17&showicon=red_1

    (Note to current Open Static Map users: please switch to v4 as v3 has been deprecated).

    All the above geocoding capabilities, as well as the Open JavaScript API v7.0 we announced today, help add an incredible new level of depth to our APIs. It’s a truly significant step towards advancing the MapQuest Open APIs into becoming not only the most unique and disruptive mapping API available, but also a legitimate competitor against other paid solutions.

    We owe many thanks to the OpenStreetMap community for contributing their time and efforts to the project, and we hope you share with us all the creative ways in which you use our APIs!

    Have questions or comments? Please post them on our forums or on Twitter @MapQuestTech and we’ll get back to you as soon as we can. Thank you and enjoy!

  3. Transaction limits among free map APIs have been a hot topic lately.  MapQuest is excited to announce a change to our limits, which includes no preset limit on maps within our free Community Edition license!  In addition, we are setting higher limits on our other service calls (the highest in the industry), with 5,000 geocodes, 5,000 routes and 5,000 search calls allowed per day.

    In addition to our new transactional limits (or lack thereof!) we wanted to clarify where and how you can use our APIs with a Community Edition license.  You CAN develop paid mobile applications for app stores using our Community Edition licenses.  You can also use SSL.

    For all the details, check out the following Map API Licensing and Terms Overview.  Also check out the Terms of Use for all the legal specifics.  I’ve included the handy chart available from the overview below.  Head over to the MapQuest Developer Network to sign up for a free map API key and start developing!

      ENTERPRISE COMMUNITY
      Licensed Data Licensed Data Open Data
    Maps (No preset limit)* (No preset limit)* (No preset limit)*
    Directions (No preset limit)* (5000 calls/day) (No preset limit)*
    Geocoding (No preset limit)* (5000 calls/day) (No preset limit)*
    Search (No preset limit)* (5000 calls/day) (No preset limit)*
    Route Matrix (No preset limit)* (5000 route pairs/day)  
    Traffic **  
    Non-Commercial or
    Public Web Apps
    Non-Commercial or
    Public Mobile Apps
    Private and/or Paid
    Commercial Web Apps
     
    Paid Mobile Apps
    SSL  
    Forum Support
    Premium Support(24/7 Phone & Email Support)    
    System Performance Levels    
    Account Management    

    * MapQuest operates a shared service and reserves the right to limit access to prevent service degradation.  Please contact MapQuest to discuss applications with heavy traffic volume expectations.

    ** The Traffic API Web Service cannot be used for real-time navigation, in conjunction with in-car or stand alone portable navigation devices, or be used as the primary purpose of your website or application.

    About the Author

    Roman Hardgrave
    @MapQuestRoman I am the product manager for MapQuest Platform Services, including our APIs, web services and the Developer Network. I've worked at MapQuest for almost 10 years. I'm a full fledged geonerd who is excited to be working on the next generation of mapping APIs.
  4. This week is exciting, we should have several things to announce.  First up, version 7 of our JavaScript Mapping API has been released.  This release features expanded mobile support, updated map controls, better documentation and for you geonerds out there, a special treat – MapQuest now is on the Mercator projection.

    Mobile Support

    We support iOS and Android with version 7, and we expect this list to expand over the coming months.  Additionally, we’ve expanded our event handling on mobile devices to enable interaction such as touchable POIs. Mobile mapping is a major focus going forward, so this is just the beginning.

    Updated Map Controls Including Geolocation
    Yes, the beautiful map controls featured on MapQuest.com are now available through our API.  Plus, you get a bonus control that we have not exposed on MapQuest.com.  The waving man!  Click him and he automatically centers the map based on the W3C Geolocation Specification implemented in many of the latest browsers. Additionally, you can add a custom handler to perform some task after you’ve been geolocated: find the closest store, reverse geocode, etc.  Here’s a sample using geolocation with a reverse geocode.

    Better Documentation
    Is there anything more frustrating that trying to develop something with incomplete or incorrect documentation?  We feel your pain.  Our goal is to make working with the MapQuest Platform easy, so we’ve added “try it now” features to all of our docs, allowing you to edit the code in the browser and see the result.  Plus, we’re expanding our samples and pages, including the new Customize the Map Interface page for all those folks who like to put their own look on the map controls or info bubbles.

    Nerd Alert
    Changing our projection to Mercator might not seem like a big deal, but to those who might have struggled overlaying data, it will greatly simplify using our maps with other systems.  On the API side, we’re continually streamlining to simplify development.  You’ll notice a new map constructor object with an easy way to initialize the map based on specific points – just pass the collection object to the constructor.

    For all you version 6 users, upgrading to version 7 is as easy as changing the version string in your JS include URL!

    This is just the beginning…please stay tuned for further updates by following the blog or our Twitter feed (@MapQuestTech).  Follow me at @MapQuestRoman.

    Next up…a way to code once and deploy mobile apps with stunning maps to iOS, Android and Blackberry!  Impossible you say?

    About the Author

    Roman Hardgrave
    @MapQuestRoman I am the product manager for MapQuest Platform Services, including our APIs, web services and the Developer Network. I've worked at MapQuest for almost 10 years. I'm a full fledged geonerd who is excited to be working on the next generation of mapping APIs.
  5. It’s summer time and no matter where you are, that can mean some pretty interesting weather! Let’s explore what we can do to mash-up weather forecasts with MapQuest maps.

    Step One:  Find a simple weather web service. I like to use the GeoNames web service for two reasons: it’s free and in json. Further documentation for the GeoNames weather web service can be found here http://www.geonames.org/export/JSON-webservices.html.

    Click map for weather

    Step Two:  Get a map from the map constructor (http://www.mapquestapi.com/sdk/js/v6.0.0/basic-map.html#basicmap). and create a location. To do this, add a click event listener to the map (http://www.mapquestapi.com/sdk/js/v6.0.0/basic-map.html#events).

    Step Three:  Now grab the lat/lng from the map click event and use it in the GeoNames service request.  You can use your own username! Once you have the weather json response, you can grab the current conditions. I created a simple POI (point of interest) with the station name in the title, and the clouds and temperature in the content window. After adding the POI to the map, the info window is toggled on since it’s the only POI on the map.

    Congratulations: You now have weather on click anywhere in the US!

    That’s all there is to it! You can see it working here http://www.mqdemo.com/brian/clickEvent.html.

Follow @MapQuestTech on Twitter

MapQuest DevBlog RSS

Want to stay updated on all the latest advances? Subscribe to our blog feed and be among the first to receive the news!