close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Directions based upon user mobile location

Thread began 7/22/2013 11:38 pm by HHar21498653 | Last modified 9/22/2014 1:39 am by HHar21498653 | 3573 views | 21 replies

CraigRBeta Tester

Thanks Jason, - i couldn't get the demo to work, but I got the idea.

I used the url you provided - so I can retrieve a json file using co-ordinates, and from the array, i can recover a postcode.

One issue i came across is that the array generated from the json does not always seem to have the same number of elements,, is there a way to always be able to select a postcode ?

eg, in this code snippet

$geoCodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=".$lat.",%20".$long."&sensor=true"; 
$result = json_decode(file_get_contents($geoCodeURL), true);
@session_start();
$_SESSION['retrievedpostcode'] = ($result['results'][0]['address_components'][4]['long_name']);



gives me the postcode, for a particular UK address, but this array value (4) is not a postcode on the url you provided

Other than this, i have a working example, just needs a bit of tidying

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...