Thursday, 21 April 2011

Woop Woop!

I think I'm starting to get the hang of this now!
I've been trying to learn from the google API examples/recommended code while keeping it my own (obviously a lot of the rendering and direction finding code is largely google tutorial based though) and now it sort of works!
Need to finish the little bits of code that need doing, then I'm going to sit here with a smartphone next to me for an hour or two and try and get the formatting right so it looks nice and sexy!
Without further ado:
http://fruitfulcreations.co.uk/geoloc_2/AddDirections3.html

It now resolves your position, geocodes your typed destination and then renders the map - I placed the call for the route calculator function in the first part of the map rendering code because it seemed more logical than attaching it to another button.  Unfortunately two are required - if there is an issue with the geocoding or geolocation queries they may return slowly or not at all - if they returned slowly and everything was on one button the map/route calculator (which relies on variables populated with that data) would not fire and would possibly produce an error.
I will be linking up the second one so it will only display if the geolocator/geocode works if this turns out to be possible though! :)

Happy times!!

No comments:

Post a Comment