Results 1 to 5 of 5

Thread: HTML5 Geolocation

  1. #1
    Senior Member andymoore's Avatar
    Join Date
    Aug 2008
    Posts
    1,612

    Default HTML5 Geolocation

    I just realised this section of the forum existed!

    Location Detection = free code download to geolocate visitors to your mobile (or html5) site, then reverse geocode the lat and long to return usable data like street, house number, town, city and so on.

    I know I've linked to it here already but it seems relevant under newly developed and the LBS section.

    Andy Moore
    i don't do tech / mobi anymore - why do something that annoys and stresses lol

    New: Most Minty Tooth Oil - GMO and fluoride free toothpaste alternative

    100% natural botanical extracts to whiten teeth, freshen breath and strengthen gums
    Used, recommended and sold by Harley Street private dentists

    My other websites:

    http://sellyoursongs.info/ - Sell Your Songs using Mobile Payments
    http://detectmobilebrowsers.mobi/ - Detect Mobile Browsers
    http://andymoore.info/m-commerce-php/ - M-Commerce PHP (sell stuff on the mobile web)
    http://locationdetection.mobi/ - Detect a mobile browser's latitude & longitude
    http://andymoore.info/mysql-lyrics-database/ - Half a million lyrics


  2. #2
    Senior Member ChinaMobi's Avatar
    Join Date
    May 2010
    Posts
    1,593

    Default

    I know Andy is taking a leave. Can someone help me with this.

    I have a project that I can make use of geo location info. What I need is to be able to detect the city of the visitor and then display a page named after the city. All my contents are in static html pages. For example if the visitor is in London, I want to display/redirect the first page as/to london.html. How can it be done?

    I downloaded and then studied the php and html files but could not figure how to do it. I have almost no knowledge of php though I understand programming.

    Thanks.

  3. #3
    Senior Member noonoo1's Avatar
    Join Date
    Jul 2007
    Location
    Wales, UK
    Posts
    3,260

    Default

    It can be done.

    You have to use php and js, this information is valuable and very rarely released openly.

    You will also need to integrate with google api I suspect or create a database with cities and their lat long details.

    Good luck with this.

  4. #4
    Senior Member ChinaMobi's Avatar
    Join Date
    May 2010
    Posts
    1,593

    Default

    Do you have an example that I can follow? The zipped file contains: geo.php, geo.js, and geo.html.

    1. Should I rename geo.php to index.php so that it will execute when a visitor arrives at my site?
    2. How do I modify the PHP code so it can display london.html if the location is London?

    Thanks.

    ps: Yes, you may be right. It looks like I need to obtain a key so that I can use Google's API. But, I just don't know where to start. Please help.

  5. #5
    New Member
    Join Date
    Dec 2011
    Posts
    5

    Thumbs up

    Quote Originally Posted by ChinaMobi View Post
    Do you have an example that I can follow? The zipped file contains: geo.php, geo.js, and geo.html.

    1. Should I rename geo.php to index.php so that it will execute when a visitor arrives at my site?
    2. How do I modify the PHP code so it can display london.html if the location is London?

    Thanks.

    ps: Yes, you may be right. It looks like I need to obtain a key so that I can use Google's API. But, I just don't know where to start. Please help.
    Break it down, I see you have few things you want to accomplish

    - First step it to familiarize yourself with url-redirection i.e. when you have site.com/london it should redirect you to cities.php?key=london etc. This can be done by re-writing URL, plenty of example on web.

    - next you need to resolve where the request is coming from. Do you want to use IP address to figure out city (ip2country.net/ip2country/README-IP-COUNTRY-REGION-CITY.html) -- OR -- is there some other way your user would be supplying the location??

    -- You can certainly use google to reverse geocode, but as far as I'm aware you need geo coordinates i.e. latitude/longitude or city name itself or an addresses (if you want reverse geocode). Not sure what your requirement is from the post.

    -- Now you create another PHP which acts as a dispatches on top of all this.

    Good luck.

Similar Threads

  1. Will HTML5 be the demise of apps?
    By noonoo1 in forum General Discussion
    Replies: 8
    Last Post: 07-18-2010, 11:38 PM
  2. HTML5 Mobile Video Whitepaper
    By coast in forum Mobile Web Design
    Replies: 1
    Last Post: 06-07-2010, 12:15 AM
  3. Replies: 0
    Last Post: 03-03-2010, 11:48 AM
  4. Flash, HTML5, and Mobile Apps - The Industry Standard
    By Scavenger in forum Mobile Industry News
    Replies: 0
    Last Post: 02-07-2010, 03:51 PM
  5. New GeoLocation and Radius article...
    By akc in forum Mobile Web Design
    Replies: 0
    Last Post: 09-26-2008, 07:28 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
A Yup.mobi Mobile Site
Mobile Dating