Entries Tagged as MapQuest
September 22, 2010 · 3 Comments
Inspiration comes from all places. Sitting in Ryan Stewart's presentation at 360Flex this week, I got hit with the geolocation bug again. I saw some of the demos that Ryan was doing and figured that I can take some of those a bit further. This gave me a chance to do some work with HTML 5 and AIR for Android as well.
Seeing Ryan's presentation, I took the initiative and updated one of my old samples around Yahoo! Local Search and Adobe Spry. The old version actually asked you to provide a city state pair to do the local search. After taking a look at how Serge Jespers was using an ExternalInterface call to get HTML5 geolocation data into Flash, I took the same approach to grab the latitude and longitude from the HTML5 geolocation API and pass it into the ColdFusion service that I'm using to abstract the Yahoo! API. The end result, which works in any HTML5 enabled browser looks like this:
Migrating this example to HTML5 was cool, but I felt like there was still something missing. I banged out the HTML5 version pretty quickly because I was migrating existing code. I needed a real challenge. Ryan's examples had all been based in AIR for Android. I had been signed up for the prerelease for a while, but hadn't been able to think of a compelling app to build. I decided to take the HTML5 app that I had just created and build an AIR for Android version, so I fired up IntelliJ IDEA and went for it. I figured a listing of the elements wouldn't be a good showing of what AIR for Android can do, so I decided to sexy it up a bit. I added in some nifty native geolocation functionality and some of the new uri based functionality to trigger the phone system, i.e. tel:4045551212. Since it was a Flex 4 application, I decided to use my Flex framework of choice, Swiz, to help me build the application quickly and keep my code organized. I picked up a beer from the 360Flex party on Tuesday night and then headed to my hotel room to crank out some code. The result isn't pretty, but it is pretty darn cool.
When the application starts up, it will check for the current location and center the map on that latitude and longitude. When you do a search, it will call the same ColdFusion service that the HTML5/AJAX version is using to get the local search results. It then leverages the MapQuest 6 API to plot the data. I added a double-click handler on the POIs to trigger phone calls to a given location.
Download the APK here. Warning, it's still just a POC quality, so you may need to force quit the application to keep it from eating all of your battery.
Tags:
Adobe · AIR · AJAX · Android · ColdFusion · Conferences · Flex · MapQuest · Speaking · Spry · Swiz · Universal Mind · User Experience · XML
This month's issue of ComputerWorld contains a cover story titled: "Can Web 2.0 Save BI?". SpatialKey is featured on the cover of the issue as part of the article! The article goes into depth about how the Ogden Police Department is using Web 2.0 (SpatialKey Law Enforcement, in particular) to analyze data in seconds, rather than days. Doug and Ben go into this article in a bit more detail if you want to learn more about it.
Anyway, here is the cover:

Tags:
Adobe · AIR · BlazeDS · Cairngorm · ColdFusion · Flex · General · Hibernate · Java · MapQuest · Spring · Universal Mind
So, my co-worked Adam Flater started up the Merapi Project a while back and asked me to contribute. Up until now, the only thing I've had time to contribute was the name. Well, after seeing the cool stuff that he and Jordan were doing at 360|Flex, I decided it was time to step up to the plate, get my shit together, and produce my own kick-ass Merapi demo.
Anyone who has been following the blogs knows that we at UM are real big into GIS and data visualization. Don't believe me? Take a look at SpatialKey to see what we can do with it.
I recorded a screencast where I walk you through the setups and the code of the application:
Java Code:
package com.universalmind.merapi;
import gnu.io.CommPort;
import gnu.io.CommPortIdentifier;
import gnu.io.NoSuchPortException;
import gnu.io.PortInUseException;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.IOException;
import com.diddlebits.gpslib4j.GPS;
import com.diddlebits.gpslib4j.IDate;
import com.diddlebits.gpslib4j.IGPSlistener;
import com.diddlebits.gpslib4j.IPosition;
import com.diddlebits.gpslib4j.ITime;
import com.diddlebits.gpslib4j.Position;
import com.diddlebits.gpslib4j.PositionRadians;
import com.diddlebits.gpslib4j.Garmin.GarminGPS;
import merapi.Bridge;
import merapi.MerapiObject;
import merapi.messages.Message;
public class GPSReader extends MerapiObject implements IGPSlistener{
GPS gps;
Position position = null;
IPosition current = null;
BufferedInputStream input;
BufferedOutputStream output;
public Bridge bridge;
public static void main( String[] args )
{
new GPSReader();
}
public GPSReader()
{
super();
bridge = Bridge.getInstance();
CommPort port;
try {
port = CommPortIdentifier.getPortIdentifier("/dev/tty.USA19H1d1P1.1").open("GPSReader", 3000);
} catch (NoSuchPortException e) {
System.out.println("/dev/tty.USA19H1d1P1.1 not found!");
return;
} catch (PortInUseException e) {
System.out.println("Port already in use by " + e.currentOwner);
return;
}
try {
input = new BufferedInputStream(port.getInputStream());
output = new BufferedOutputStream(port.getOutputStream());
} catch (IOException e) {
System.out.println("Error opening /dev/tty.USA19H1d1P1.1");
return;
}
gps = new GarminGPS(input, output);
gps.setAutoTransmit(true);
gps.addGPSlistener(this);
}
public double getLat() {return __lat;}
public void setLat(double lat) {
this.__lat = lat;
}
public double getLon() {return __lon;}
public void setLon(double lon) {
this.__lon = lon;
}
public String getTime() {return __time;}
public void setTime(String time) {
this.__time = time;
}
public String getDate() {return __date;}
public void setDate(String date) {
this.__date = date;
}
public void dateReceived(IDate d) {
String dateString = d.getMonth() + "/" + d.getDay() + "/" + d.getYear();
System.out.println(dateString);
this.setDate(dateString);
}
public void positionReceived(IPosition pos) {
current = pos;
this.setLat(toDecimalDegrees(current.getLatitude()));
this.setLon(toDecimalDegrees(current.getLongitude()));
Message message = new Message();
GPSPoint point = new GPSPoint();
point.lat = this.getLat();
point.lon = this.getLon();
point.date = this.getDate();
point.time = this.getTime();
message.setData(point);
try {
bridge.sendMessage(message);
} catch (Exception e) {
System.out.println(e.getMessage());
}
}
public void timeReceived(ITime t) {
String timeString = t.getHours() + ":" + t.getMinutes() + ":" + t.getSeconds();
this.setTime(timeString);
System.out.println(timeString);
}
private double toDecimalDegrees(PositionRadians rads){
return Math.toDegrees(rads.getRadians());
}
private double __lat = 0;
private double __lon = 0;
private String __time = "";
private String __date = "";
}
Tags:
Adobe · AIR · Flex · General · Java · MapMyPix · MapQuest · Merapi · Universal Mind
Download GeoTwitter(AIR Application - 417KB)
I had been messing around with building a geocoding Twitter app for a while, but had neglected the code for a while. The release of Twittearth made me get off my butt and get something done with this project.
I finally put together something I could call an alpha release that I can put out there to show where it's going. At its heart, GeoTwitter is a mashup of the Twitter, MapQuest, and Yahoo Maps APIs. Eventually, I would like to turn this into a full-blown Twitter client, but this is the first step.
You may ask "Why use both the MapQuest and Yahoo Maps APIs?" Well, the answer is simple: geocoding. I love the way the the MapQuest TileMap Component works. I'm not such a big fan of Yahoo's map component. On the other hand, I think Yahoo's geocoding far exceeds MapQuest's. Any geocoding service gives you back latitude/longitude in some format, you just have to get the values out of the response. Those values are used to plot a point on the map, any map. In this case, the MapQuest TileMap Component. So, there is a bit of method to the madness. You could just as easily use any other geocoding service to get your lat/lon pair. You could also flip the tables and use Yahoo's map and MapQuest's geocoding, if you wanted to, to achieve the same result.
Go download the app, play with it, break it, and let me know about any bugs or features you want to see.
UPDATE: You can view the source and tweak it yourself at GeoTwitter's Google Code Site
Download GeoTwitter(AIR Application - 417KB)
Tags:
Flex · General · MapQuest · Universal Mind
I talked to John & Tom over at 360 Conferences asking what the outcome of the API Contest was.... They told me I didn't win. Well damn, I had pimped the hell out of my entry. Oh well. I went on with my day, a bit disappointed and resolved to the staking out of Target to buy a Wii.... If they're ever in stock.
Well, fast forward to today when Ben Clinkinbeard IMs me and asks me if my name is Tony Fendall. I was puzzled, to say the least, so he gave me a link to the contest winners.
Looks like my app, but not my name. So I think I won the contest for the Ribbit category. Stay tuned to see what really happened.
P.S. I don't know who you are Tony, but I'm sure you're a nice guy and a damn fine developer too.
[UPDATE] It was a typo, and I did, indeed, win the Wii.
Tags:
Adobe · ColdFusion · Conferences · Flex · General · KayakAPI · MapQuest · Universal Mind
So, as you all know by now, I have absolutely no problem with shameless self-promotion.
I got some great
love from MapQuest on their developer blog. Click the link, go look at the post, and then go vote for me in the
360|Flex API Contest.
Tags:
Adobe · Flex · General · KayakAPI · MapQuest · Universal Mind