Posts with tag flex

We Love L.A.! Meet Us at Adobe Max!

In addition to auditioning for sitcoms at the studios, MapQuest will be at the Adobe Max conference in Los Angeles, October 4th-7th. We'll be talking to developers, showing demos of our MapQuest Platform using the current 5.3 AS3 SDK and our upcoming 6.0 SDK (currently in Beta). My colleague Ant will also be demonstrating his ability to cry on cue for any casting directors in attendance.

We've also partnered with Adobe to power an Interactive Map of the area. The MapQuest-built Adobe Max Locator application will show conference goers nearby restaurants, hotels, conference shuttle locations, and other hot spots near the Los Angeles Convention Center, home to this year's event.

Adobe Max Locator

If you're heading to Adobe Max, stop by and say "Hi!" We'll be in Community Pavilion Booth #843, sitting next to you in the Sessions, or in line to audition for the parts of "Guys in Background" for an upcoming episode of "How I Met Your Mother."

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.

Dump Your Garmin

Dump your Garmin! No, I don't mean getting rid of your Garmin, so don't go chucking it out the window just yet. I'm referring to dumping the data from the .gpx file your Garmin device utilizes to store location and route information.

A co-worker of mine recently asked me to write an app that reads a Garmin's .gpx file and displays the waypoints and the route on a map. Never having seen a .gpx file (I'm a TomTom boy, myself) I was pretty sure it would include all the basics - lat/lng, name, etc, etc. I found what I was expecting in the file, not much to it, it's fairly simple.

garmin gpx screen

You can view the sample app here. Viewsource is enabled on the sample so you can see the code involved in it. To sum it up, I used an HTTPService to read the file, array collections (I know they're heavy and slow, but they're easy), and looped through the collections displaying the waypoints and route on the map. If you're at all familiar with placing POIs and routes on MapQuest's maps, the whole process is fairly simple.

One other thing: On MapQuest.com, by using the Garmin Communicator Plug-in, you can output map and directions info into a .gpx format using the "Send to GPS" option in the "Send To" menu.

Hope this helps some one! If you threw your Garmin out the window in the first paragraph, neither MapQuest nor I are responsible.

Got Flash 10?

One of the challenges all web developers face is future versions of platforms your application runs on. When a new browser or in this case version 10 of the Adobe Flash Player is on the horizon, it's good to run your application against it to see if any changes will need to be made before the new version goes to production and screens across the Web light up with messages of "An upgrade is available."

We've recently launched an unsupported version of our AS3 API for those of you working with Flash 10. Some developers have found that our 5.3 release and it's version checking of the Flash Player would cause errors to be thrown. This unsupported release (5.3.1_U) fixes that.

For the curious, it's an unsupported build because the Flash 10 player is still in development. This update will however allow you to run and test your applications on Flash 10 using the MapQuest AS3 API.

Oh, one other note: 5.3.1_U also was built for Adobe Flex 3 and AIR.

We also have unsupported versions of our C++ API for Mac OSX 10.5 (Intel) and a PHP API. You can download them on our Unsupported Tools page.

Do You Shazou?

Shazou (Japanese for "mapping") is a great Firefox plug-in developed by Seisan to map and geolocate any web site currently being viewed. It's another helpful tool against phishing scams.

Shazou is powered by the MapQuest Platform: Free Edition AS3 API. Download it from the Shazou page on the Official Mozilla Firefox Add Ons site.

Using Map Overlays with Flex and the Mapquest 5.2 APIs

Ok, I was driving (very carefully, mind you) on a very sunny afternoon to the airport, and I got a call from my very bright and brilliant niece who recently enrolled into Michigan State University (MSU if you're a Michigan native). During the midpoint of the conversation, all I heard was "cell phone silence", for lack of a better term, and within a few more seconds the call was dropped -- argh!

Obviously, I'm not the only person in the world who gets aggravated when a mobile call gets dropped. Of course, my wireless carrier has to go unnamed here in order to protect the guilty... er, uh... innocent.

So, after I called my niece to finish our conversation, I started to think. "Shouldn't there a way to show folks where the various dead spots are for the wireless carriers?" As you will see shortly, the MapQuest 5.2 APIs actually come in quite handy for solving this sort of problem. If you read my previous blog post and tried out the example code that I provided, then you should be familiar with the concept of creating a POI (point of interest) on a map and displaying it. Today, we're going to use overlays to highlight a region of interest. Take a look at the image below to see my "dead spot" awareness system:

Continue reading Using Map Overlays with Flex and the Mapquest 5.2 APIs

Ribbit, Kayak, and MapQuest Mashup is a Winner

Earlier this month we told you about a "Great Mashup using APIs from Ribbit, Kayak, and MapQuest" by Andrew Powell, shamelessly plugging it to help him win a Wii.

Well, not only did Andrew win the 306|Flex API Contest and the Wii, he also won some help restyling the UI.

Check out the restyled and award-winning Ribbit, Kayak, MapQuest Hotel Search Mashup. Congrats Andy!

Great Mashup using APIs from Ribbit, Kayak, and MapQuest

"Ribbit / MapQuest / Kayak Mashup" is the title of a post by Andrew Powell from Universal Mind, introducing a great hotel search app he built using APIs from (big surprise!) Kayak, Ribbit, and our very own AS3 API.

Give it a read and check out Andrew's hotel search app. We also support shameless promotion, so help Andrew win a Wii by voting for his application on the 360|Flex Contest Page.

screenshot of hotel search mashup

Creating Points of Interest with Flex and the MapQuest 5.2 APIs

So, if you read my previous blog post and tried out the example code that I provided, then you should be pretty comfortable using Flex and ActionScript with the MapQuest 5.2 APIs. I'm truly amazed that the MapQuest development team made it so easy for developers to create location-based applications for Flex applications. And for that matter, just in case you didn't know, the MapQuest APIs are available for other languages like Java, .NET, C++, and JavaScript, but since I'm really enthusiastic about using Flex, so I'm going to focus on the Flex side of things.

So, let's say that there's a couple of "points"on the map that you're "interested" in observing. And let's also say that you want to see the "points of interest" (hence the name) together on the map at the same time. Well, today, I'll show you how to display points of interest (conveniently called POIs) within your mapping application. In the example code provided today, we're going to examine one of the many use cases where using POIs is very useful, meaningful, and convenient: real estate. So, let's say that I'm looking to buy a new home, and my agent wants to give me a customized website with all the homes that match my profile. The image below is the complete running application, from a fictional real estate company named, "The Real Estate Connection", displaying the homes that matched my profile.

So, as you can see, there are two homes that matched my profile, according to the image shown above. Here's the ActionScript function that plotted the two POIs that you see above:

public function main(): void{
   
  var zoomControl:ZoomControl = new ZoomControl();
  tilemap.addControl(zoomControl);
 
  // now let's set the points of interest
  var house1_coordinates:PointLL = new PointLL(40.720409,-73.994637);
  var house1_Poi:Poi = new Poi(house1_coordinates);
  house1_Poi.setInfoTitle("18044 Oak Lane");
  house1_Poi.setInfoContent("This a stunning 2 bed, 2 bath condo - $1.2M");
  var house2_coordinates:PointLL = new PointLL(40.720409,-76.994637);
  var house2_Poi:Poi = new Poi(house2_coordinates);
  house2_Poi.setInfoTitle("22365 Miller");
  house2_Poi.setInfoContent("This a great 2 bed, 2 bath condo - $400k");
   
  house1_Poi.setKey("A1");
  house2_Poi.setKey("B1");
  tilemap.addPoi(house1_Poi);
  tilemap.addPoi(house2_Poi);
  
  tilemap.setCenter(house1_coordinates,3);

}

So as you can see, I'm providing the coordinates of the locations that I want to show up on the map as a POI. Additionally, I can also provide a title and description (called the InfoContent) of the POI. You don't need to provide a key for your POI, unless you want to reference them later on. On the last line of the function shown above, I center the map on the first house's coordinates, and then I set the zoom level to 3. Obviously, this stuff is not hard, so take a look full source code below:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:ns1="com.mapquest.tilemap.*" creationComplete="main();">
<mx:Canvas x="36" y="10" width="600" height="341" backgroundColor="#ffffff">
<ns1:TilemapComponent x="138" y="39" width="452" height="302" id="tilemap" key="mjtd%7Clu6y29u2n0%2C7s%3Do5-0ura9"/>
<mx:Text x="10" y="39" text="Dear Bruce, welcome to your personalized real estate website. Take a look at the properties that I have identified for you. Feel free to contact us if you have any questions." width="120" height="172"/>
<mx:Label x="183.5" y="10" text="The Real Estate Connection" fontSize="16"/>
<mx:Image x="10" y="176" source="user-home.png"/>
</mx:Canvas>

<mx:Script>
<![CDATA[
import com.mapquest.tilemap.pois.*;
import com.mapquest.PointLL;
import com.mapquest.tilemap.controls.ZoomControl;


public function main(): void{

var zoomControl:ZoomControl = new ZoomControl();
tilemap.addControl(zoomControl);

// now let's set the points of interest
var house1_coordinates:PointLL = new PointLL(40.720409,-73.994637);
var house1_Poi:Poi = new Poi(house1_coordinates);
house1_Poi.setInfoTitle("18044 Oak Lane");
house1_Poi.setInfoContent("This a stunning 2 bed, 2 bath condo - $1.2M");

var house2_coordinates:PointLL = new PointLL(40.720409,-76.994637);
var house2_Poi:Poi = new Poi(house2_coordinates);
house2_Poi.setInfoTitle("22365 Miller");
house2_Poi.setInfoContent("This a great 2 bed, 2 bath condo - $400k");

house1_Poi.setKey("A1");
house2_Poi.setKey("B1");

tilemap.addPoi(house1_Poi);
tilemap.addPoi(house2_Poi);

tilemap.setCenter(house1_coordinates,3);


}

]]>
</mx:Script>
</mx:Application>

First Post! - Getting started with Flex and the MapQuest 5.2 APIs

Back in the day, there was always some glory about getting the first post on a popular topic on Slashdot. The first-poster got the opportunity to lead the discussion (or flame war) on the current topic that was on the site. Well, this is my first post on the AOL developer site, so let me introduce myself. I'm Bruce Hopkins, the author of the book, "Bluetooth for Java" by Apress, and I have have recently fallen in love with Flex and ActionScript programming. I've used Java for over 10 years (way back with JDK 1.0a) and it's great for server-side application development, but lacks in certain areas for client-side applications. Well, unless you've been in a cave for the last 2 years, you probably already know that Flex works extermely well for client-side applications, and plays nicely with integrating with Java EE, .NET, SOAP, and REST backends.

So, today, I'm going to introduce you to Flex application development, and we'll get our hands dirty with the MapQuest 5.2 APIs. I'm really excited that MapQuest has decided to make the latest version of their API free for developers, and since their mapping APIs support Flex 2 / Flex 3 it's the best choice for Flex developers for mapping APIs. Take a look at the code snippet below:

<mx:Canvas x="36" y="29" width="571" height="322" 
  backgroundColor="#ffffff">
  <mx:Label x="19" y="10" text="Select Map Type:" width="126"/> 
  <mx:ComboBox id="mapTypeComboBox" x="19" y="29" width="148"
    dataProvider="{mapTypeComboData}" 
    change="changeMapType();"></mx:ComboBox> 
  <ns1:TilemapComponent x="175" y="10" width="376" height="302" 
  id="tilemap" key="123456754322434"/>
</mx:Canvas>

It's only 5 lines of XML that allow you to define all the visual layout for a simple application. So, as you can see in the code above, I have a Label, ComboBox, and TilemapComponent wrapped in a Canvas. All the components are a part of the Flex SDK, except for the Map, which is a part of the MapQuest 5.2 APIs. When you signup for a developer account, you'll get a key where you'll insert into the "key" attribute of TilemapComponent. Now, take a look at the rest of the code:

<mx:Script>
  <![CDATA[ 
 
  [Bindable]
  public var mapTypeComboData: Array = [ {label:"Map View", data:"map"}, 
        {label:"Satellite View", data:"sat"}, 
        {label:"Hybrid View", data:"hyb"} ];
 
  public function changeMapType(): void{
    tilemap.mapType = 
    mapTypeComboData[mapTypeComboBox.selectedIndex].data;
 	}
 	]]>
 </mx:Script>

As you can see, I populated a simple Array with the data that feeds the ComboBox, and I defined a function to be called when the ComboBox is changed. And that's it! The image below shows a screenshot of our application:

So, as you can see, it's pretty easy to use Flex to create mapping applications with the MapQuest 5.2 APIs. Below is the full source code for you to copy.

<?xml version="1.0" encoding="utf-8"?>
   <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" 
   layout="absolute" xmlns:ns1="com.mapquest.tilemap.*">
 <mx:Canvas x="36" y="29" width="571" height="322" backgroundColor="#ffffff">
 <mx:Label x="19" y="10" text="Select Map Type:" width="126"/> 
 <mx:ComboBox id="mapTypeComboBox" x="19" y="29" width="148" 
 dataProvider="{mapTypeComboData}" change="changeMapType();"></mx:ComboBox> 
 <ns1:TilemapComponent x="175" y="10" width="376" height="302" id="tilemap"
 key="mjtd%7Clu6y29u2n0%2C7s%3Do5-0ura9"/>
 </mx:Canvas>
 
 <mx:Script>
 <![CDATA[ 
 
 [Bindable]
 public var mapTypeComboData: Array = [ {label:"Map View", data:"map"}, 
 {label:"Satellite View", data:"sat"}, 
 {label:"Hybrid View", data:"hyb"} ];
 
 public function changeMapType(): void{
 tilemap.mapType = mapTypeComboData[mapTypeComboBox.selectedIndex].data;
 }
 
 ]]>
 </mx:Script>
 </mx:Application>