Adam Howitt's Blog

May 06
2006

British pedometer - WalkJogRun

Okay, WalkJogRun has long been available for the UK but now it has it's own URL WalkJogRun.co.uk which starts you on a view of Europe, features better resolution satellite maps, detailed European maps and imagery (looks like a Dan Brown movie) and a postcode lookup feature. Oh, and it also includes Japan but at present those maps are all in Japanese so I'm unable to make head nor tail of the place names.

I have to admit that the imaging improvements are all Google's idea but it doesn't come free.  Google has an upgrade document for it's mapping API users to help you move your code from v1 to v2.  The move took about 3 hours for my site but it wasn't as easy as the upgrade document made out "The quickest way to upgrade is to update your Maps API <script> URL to refer to 'v=2' instead of 'v=1.'" Hmm. No dice.  The way I proceeded was to start with the function I call to initialize my map and eliminate any subsequent map based code and gradually add it back in, digging into the APIv2 Class reference.

One of the biggest changes for me was the move from GPoint to GLatLng objects which means little until you realize that the old method of passing points has changed and the order you pass in longitude and latitude coordinates is now opposite.  One trick someone suggested was a simple function which takes the old format and returns the flipped values but I figured it was easier just to straighten them out manually. 

Another such flip was the zoom scales which used to run 0 to 17 with 17 being the most coarse view and 0 allowing you to see up someone's nose.  GMap2 now goes the opposite direction with 0 being the most distant and 17 the closest you can get at this point; presumably this allows them to get closer yet at some point in the future without having to get into negative numbers.  This means most of the code you have will need to be rewritten with the substitution 17-oldnum to get the correct new value.  Or just stand on your head.  

This all coincides with my move to hosting the site on my own server happily running BlueDragon 6.2.1 on Linux with MySQL and Apache.  I have a nice dev environment to play with now instead of playing chicken with large code changes and an easy way to migrate them between environments.

If you have any Google Map related questions and need a hand working out where something is breaking, I will follow up if you have any questions.

Enjoy the rest of your weekend and maybe even plot out a nice run or bike ride. 

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
[Add Comment] [Subscribe to Comments]
  1. Weird. I last used WalkJogRun about 10-12 months ago and remembered it was a pretty cool app. (I seem to remember it using Yahoo maps at that time, is that correct?) Anyway, I recently relocated to the Philadelphia area and just last night I was thinking I should check it out again to plan some jogs in my new neighborhood. Well, I wake up this morning planning to go to your blog and track down the URL and there is WalkJogRun on fullasagoog... Now do you have any idea what I want for breakfast :)

    Seriously though, great work.

[Add Comment]