Sunday, February 28, 2016

w7d5 - google maps, and javascript!

My location page actually works now! It can:


  1. allow a user to choose automatic detection of location from their current device or to enter street address
  2. find a user's location using the html5 location methods
  3. display that location on an embedded google map
  4. accept a standard google text search (i.e. anything you'd normally use on google maps, like a zip code, or a street address, or a city name)
  5. show the street address location on a map
  6. allow users to drag the icon to a desired location
  7. capture the latitude and longitude of the marker and build a redirect url using javascript
  8. capture data passed in to the location page via url api and include that in the redirect url after the location has been captured.

So, yes, most of the js was actually written by google in their documentation.  I had to adapt several examples, though, to do my more complex implementation (to give users a choice of methods based on mouse events).

That was Friday.  The weekend gets its own post this time.  Cheers!

on page load:

on selecting Address:
on entering an address:

Stuff appears and disappears like magic!

Now I just have to make it look less shitty...

1 comment: