Posts with tag javascript

JavaScript SDK 6.0 Beta: Now with iPhone Events

iPhone ScreenshotWe've had a lot of excitement this month with multiple launches and cool projects. We wanted to make sure that we also highlight our recently updated JavaScript 6.0 SDK Beta. In the latest build, we've got some great additions to the feature set:

  • Overlay support, including CircleOverlay for quickly showing a radius
  • Routes can now be run without needing a map
  • Wrapper functions for easy access to the Directions Web Service RouteMatrix call

The big new feature this time is support for iPhone/Mobile Safari events such as pinchToZoom. When Mobile Safari is detected, the support module is automatically included, registering touch events.

In a few lines of code, you can also take advantage of the geolocation services in the device and default your map the the user's location.

navigator.geolocation.getCurrentPosition(
  function(position) {
    map.setCenter(
      {
        lat:  position.coords.latitude,
        lng:  position.coords.longitude
      }
    );
  }
);

More news and announcements coming soon. Stay tuned.

Big Beta Updates: Fun Globes, Colorful Stars, Zooming Mice, Chunked URLs and More

So we have a bonanza of beta and preview updates to share with you. We've been busy making a number of updates to the MapQuest Platform and we've been creating new Web Services and revising our client-side SDKs.

Here's what we've got to show you today:

AS3 SDK 6.0 - NEW!

We're happy to introduce the preview release of our AS3 SDKs, Version 6.0. This rewrite makes the SDK more modular, create smaller final .swfs, and add and improve a number of new features like:

  • POI Decluttering Refactored
  • globe view / ocean breeze controls screenOur popular Globe View has been refactored and made a separate component. We've even added a handy feature to let the globe reorient itself when you've turned your world upside-down.
  • New Control Component style (Ocean Breeze) to match the ones available on MapQuest.com
  • Raster images are now remotely loaded. So your application only pulls in what's needed
  • Overview map control added
  • Mouse-wheel zoom controls and keyboard controls added
  • We've added a vector-based POI star. It's scalable and color-customizable too.

vector stars

Download and check out samples from our Beta page.

JavaScript SDKs 6.0 - UPDATED!

In this update, we've added:

  • Route Options for tailoring your route
  • Toggle Route Dragging on and off
  • Basic mouse wheel support for zooming

Check out the updated documentation and samples here.

Long URL Web Service - NEW!

Today also marks the introduction of a new service which will allow you to manage large GET requests in Internet Explorer, which can't handle them. While we've put a lot of effort into making our URLs smaller and sane to the human eye, there are still scenarios where a complex request can get pretty beefy. Our new Long URL Web Service will automatically chunk-up the request and still be able to use a JSONP callback in the response.

Directions Web Service - UPDATED!

In our fourth feature release, we've now added draggable routes to the service. You now have the option of adding draggable routes through the Directions Web Service or our JavaScript SDK 6.0.

We've also added a Route Shape feature. This will allow you to return a route shape from a previous request without have to re-run the route.

Even more features and updates are in the works. Stay Tuned.

MapQuest Platform: JavaScript SDK 6.0 Preview Release with Draggable Routes

Today we've released a preview of our upcoming 6.0 version of the MapQuest Platform: JavaScript SDK. This version release is a complete overhaul of the code base and designed to be more modular, more lightweight, and easier-to-use code. We've also simplified our documentation, making it easier to follow and reference and complete with inline samples and source-code snippets.

One notable feature in this initial release is that Draggable Route functionality is included. This will allow developers to build applications that let their users dynamically edit their directions right from the map.

drag route screenshot

Find out more information on our Developer Network Beta Page, and we welcome your feedback.

AOL Tour Tracker

AOL Music just launched a great site called Tour Tracker. It allows you to see when and where your favorite bands are playing and shows coming to a town near you.

They also just happen to have some really cool interactive maps built on the same MapQuest Platform that you use, specifically the JavaScript API. How about that?

Go over and check it out while I get some tickets to go see the Foo Fighters.

MapQuest Platform 5.3 Released

We are pleased to announce the release of version 5.3 of the MapQuest Platform! This update focuses on enhancements to our 3 client-side APIs: JavaScript, AS3, and FUJAX.

Some of the big changes include:

  • Collections: Support for multiple and remote collections (KML and GeoRSS); easier handling of shape collections
  • Custom Tile Layer support
  • Add real-time traffic to your map
  • Globe view enhancements
  • All 3rd party JavaScript libraries removed (decreases JS footprint)

For the server-side APIs, .NET works with 2.0 and 3.5 on 32 and 64-bit; C++ now has been upgraded to support Visual Studio 2008 and 32 and 64-bit libraries are available.

Here's the full list of release notes:

Continue reading MapQuest Platform 5.3 Released

5.3rc5 Release for JavaScript and FUJAX APIs

As we get closer to the final release of version 5.3 of the MapQuest Platform, we've just added Release Candidate 5 of our JavaScript and FUJAX APIs to the Beta page.

The highlight in this release is the ability to define specific packages to be included in the code. With all of the new features we've been adding to the Platform, we recognized the need to optimize the size of your download with only the code necessary for your application.

From the RC5 notes:

If you want your application to have a traffic control, you can specify to include this package via the '&ipkg=controls1,traffic' URL name/value pair. However, if your application does not need the traffic control, simply use '&ipkg=controls1' and you'll save about 12k of download. This concept will be used going forward in order to optimize download sizes/speed.

NOTE: We have separated out the map controls as a modular package - if you are using our default controls (Zoom Control, View Control, etc), you will want '&ipkg=controls1' on the string. If you are using fully customized map controls, you can now eliminate ours from the script download.

The "ipkg" parameter

controls1 - will bring down all 4 controls (largezoom, zoom, pan, and view).
traffic - will bring down the traffic package. For example:

  • &ipkg=controls1 - will bring down just the controls package
  • &ipkg=traffic - will bring down just the traffic package
  • &ipkg=controls1,traffic - will bring down both the controls and traffic packages
  • &ipkg=controls1,traffic,package1,etc. - will bring down all packages listed by commas

Also a reminder: If your a Free Edition developer, you will also need to sign-up for a Developer License for developing with MapQuest Platform Beta code.

JavaScript, AS3, & FUJAX 5.3 RC4 APIs Released: Now With More Traffic!

As we get closer to the final 5.3 release, we just rolled-out Release Candidate 4 of our 5.3 JavaScript, AS3, and FUJAX APIs. The major update this time: the addition of more features for adding traffic information into your application. We've also added traffic documentation and code samples for those of you who like that sort of thing.

More details on the Developer Network Beta page, but here's a quick rundown of the updates:

  • You can now set minimum and maximum zoom levels on POIs. The POI would then only be visible on the map between the specified zoom levels.
  • You can now add traffic incident POIs to your map.
  • You can now add traffic flow to your map.
  • Retrieve item by key from collection or map: You can now get a shape back out of the map, or any collection, by using it's Key property.
  • Get reference to a Shape's parent collection: You can now ask a shape to tell you all the different ShapeCollections it is in

Happy trafficking!
Hrmm... that didn't come out quite the way I intended.

Map It! - Building a MapQuest Mac OS X Dashboard Widget - Part 7 - Address Book Integration

There's nothing that makes you so aware of the improvisation of human existence as a song unfinished. Or an old address book. - Carson McCullers

In Part 1 I showed you how to get started with the MapQuest Advantage API by getting a developer key. In Part 2 I put that key to use by providing access to a basic map in the Map It! widget. Part 3 showed you how to incorporate basic geocoding. In Part 4 I discussed more advanced geocoding topics - including handling multiple matches and specifying geocode search options. Part 5 discussed adding widget options including the default zoom level, specifying point of interest icons, and the default map type. Part 6 discussed how to add direction capabilities to the widget. In this final installment I'll talk about how easy it is to integrate address searching with the Mac OS X Address Book application.

Address Book Searching

The Mac OS X Address Book application is bundled with the OS X operating system, providing a way for users to organize their contacts and associated information including their addresses. Also included with Mac OS X is an Address Book widget, which provides access to the Address Book database from a widget. I've explored the Address Book widget code, and extracted the AddressBookPlugIn. Plug-ins are native code that can be used to access operating system levels features from a widget's JavaScript interface.

Continue reading Map It! - Building a MapQuest Mac OS X Dashboard Widget - Part 7 - Address Book Integration

Zoom Levels and Image Overlays

In this post I will continue my discussion of overlays in the MapQuest JavaScript API 5.2. My last two posts covered a couple of methods for adding rollover functionality to overlays. Over the next couple of posts I will discuss some of the options that are available when working with image overlays.

There are a few things that set image overlays apart from the other overlay types. The one that poses the biggest obstacle is image resolution. Since an image overlay is "pinned" to a map with Lat and Lng coordinates, there is a significant difference in resolution required to display an image properly at different zoom levels. If this becomes an issue for your application, one of the options that is available is the setImageOverlayLevels method provided by the API.

Continue reading Zoom Levels and Image Overlays

Create a Geo File

In my previous MapQuest posts I've mostly been demonstrating how to use MapQuest to display the the various types of geo-formats (KML, GeoRSS, etc). Building on the examples of map event interaction from my previous posts, we can also build an interactive map interface where users can build their own geo-format files. Here's an example where users can interactively click on the map to create a polyline.

Continue reading Create a Geo File

Adding Rollover Functionality to Overlays: Part 2

This method, although similar to the method I covered in my last post, uses the InfoWindow of the map rather than a rollover associated with a Point Of Interest (POI). The InfoWindow is populated with the title and content when the overlay is moused-over, and follows the cursor, similar to a tooltip.

The biggest disadvantage with this method comes from the need to step outside of the API to attach a mousemove event. This means that the solution needs to take browser differences into consideration. In order to simplify the code, and because I generally use ASP.NET for most of my work, you will notice that I have utilized a few shortcuts provided by the Microsoft AJAX Library.

Continue reading Adding Rollover Functionality to Overlays: Part 2

Map It! - Building a MapQuest Mac OS X Dashboard Widget - Part 5 - Enhancing Map It!

It is not down in any map; true places never are. - Herman Melville

In Part 1 I showed you how to get started with the MapQuest Platform by getting a developer key. In Part 2, I put that key to use by providing access to a basic map in the Map It! widget. Part 3 showed you how to incorporate basic geocoding. In Part 4 I discussed more advanced geocoding topics - including handling multiple matches and specifying geocode search options. In this installment I'll discuss adding some options to the widget. Specifically I'll discuss setting the default zoom level when adding an API, specifying point of interest icons, and the default map type.

Continue reading Map It! - Building a MapQuest Mac OS X Dashboard Widget - Part 5 - Enhancing Map It!

MapNews - A Map Based News Browser - Part 3 - AOL National News RSS Feed

"In theory, there is no difference between theory and practice. But, in practice, there is." - Jan L. A. van de Snepscheut

In theory, the project to place RSS news feeds on a map could be very easy. GeoRSS is standard for encoding geographic locations in RSS feeds. RSS feeds that have this encoding are the perfect data source for this project. But, in practice, the feeds I've been looking at do not have GeoRSS information. So, I'm going to start by seeing what I can get done without GeoRSS.

The source of news that I'm working with is the AOL national news RSS feed. The description element of each feed starts with a location. I extracted the location, geocoded each location with the MapQuest (MQ) geocoding service, and then placed point of interest (POI) markers on the map.

In my last post, I laid out my design for MapNews. In this post, I present the working application and code I've written based on the MQ client Javascript tool kit. The following screen shot of MapNews shows POI markers for cities that have news stories in an example feed. I've clicked on the POI marker for Salt Lake City to expose links to news stories in the information window.

Continue reading MapNews - A Map Based News Browser - Part 3 - AOL National News RSS Feed

MapNews - A Map Based News Browser - Part 2 - Initial Design

"If you don't know where you are going, any road will get you there." - Lewis Carroll

Like many developers I often start a project by jumping in and writing code. For this project I'm going try something a little different and create a road map for my mapping project.

My project is named MapNews. In my prior post, I covered the project concept: present a map with markers/information windows which show news headlines by location.

Doing the design up front is a bit of a jump off of a cliff for me. I've had only a light reading of the MapQuest Platform documentation and am going to proceed to layout the design. This should be interesting; as the project unfolds, I'll be able to look back and see my misconceptions exposed.

Continue reading MapNews - A Map Based News Browser - Part 2 - Initial Design

Map It! - Building a MapQuest Mac OS X Dashboard Widget - Part 3 - Adding Geocoding

Somewhere there is a map of how it can be done. - Ben Stein

In Part 1 I showed you how to get started with the MapQuest Advantage API by getting a developer key. In Part 2 I put that key to use by providing access to a basic map in the Map It! widget. In this installment I'll show you how to incorporate basic geocoding.

About Geocoding

Geocoding is the process of converting an address into latitude and longitude coordinates that uniquely identify a location, and you can use to plot on a map. Applications using the MapQuest Platform can calculate the latitude and longitude of:

  • Street addresses and intersections, the highest accuracy geocoding methods.
  • Street blocks, including the nearest block to an invalid house number.
  • Postal codes, including ZIP, ZIP+2, and ZIP+4 codes.
  • City centers.
  • US state and Canadian province centers.
  • Country centers.
  • Centers of other administrative areas that are used internationally.

The Map It! application will allow users to enter an address in one of the following forms:

  • street address, zip
  • street address, city, state
  • street address, city, state, zip
  • street address, city, state, zip, country

Continue reading Map It! - Building a MapQuest Mac OS X Dashboard Widget - Part 3 - Adding Geocoding

Next Page >