Tuesday, December 9, 2008

Google Maps vs Virtual Earth

I started looking at the details of Google Maps (GM) and noticed that they ignore everything after the 6th decimal. Normally, I'd say that's good enough, but in the case of GPS locations, that is very limiting. I then looked at Virtual Earth (VE) and noticed they didn't have that limitation. The other advantage of VE vs GM is that there's a higher threshold for requests per day and no need to register to receive a special key.

So I set out to test the flexibility of this Virtual Earth and quickly notice that it's using HTML and JavaScript inside a browser. This might be troublesome later when I try to stick this on the Window Mobile 6 (WM6) platform, but I'll deal with that later. For now, I just want to see if I can do what I want in a quick prototype fashion.

I start looking at the Virtual Earth SDK (http://msdn.microsoft.com/en-us/library/aa905677.aspx) and looking at the live demo (http://dev.live.com/virtualearth/sdk/) I see all I could possibly want for this project: type of map (Road, Satellite, hybrid), I can add pushpins (which are Shapes in VE) and I can grab coordinates by responding to mouse events.

After a few hours of testing and messing around with the different possibilities and permutations, I came up with a finished product that quickly demos the ability of VE for this project. You can get the code for this example at the bottom of this entry.

For the purpose of this prototype, I went back again to my good old blue hole #1 at NAS Jacksonville. I first set the "center" of the hole to get the appropriate map. I then set tentative 100, 150 & 200 yds markers and I set another one to simulate where I'd be on the tee box. I add event handlers for the mouse clicks. I set different functionality for both left click and right click. Left Click gets the coordinates of where I clicked on the map both in pixels & in latitude and longitude. It also tells me the distance (yds & ft) from where I clicked to where I'm currently at. Right Click sets my new current location, which would be handled by the GPS data normally. I also added two buttons, a plus and a minus to assist with zooming in and out (if you don't have a scroll button on your mouse). You can see below a screen shot of what it looks like in IE6.

All and all, I'm very happy with this prototype. The next step will be to figure out how to stick this inside the WM6 environment.

Until next time,

Sebastien Limoges

No comments:

Post a Comment