TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Geo.js, Building location-aware mobile websites with Javascript

29 pointsby akaaliasalmost 16 years ago

4 comments

eapenalmost 16 years ago
Google Maps v3 (in beta) already utilizes the sensor variable - so I dont see how this is advantageous for a mobile website. As for desktop apps - Google also has an API function to determine your location based on your IP. But I dont think it utilizes Firefox's geo-location ability.<p>&#60;em&#62;What is the benefit of this API compared to whats already available?&#60;/em&#62;
评论 #698088 未加载
philfreoalmost 16 years ago
For those of you interested in a similar wrapper for offline storage (via Google Gears or HTML5 databases), here is the wrapper Google suggests you use: <a href="http://code.google.com/p/webstorageportabilitylayer/" rel="nofollow">http://code.google.com/p/webstorageportabilitylayer/</a>
a2techalmost 16 years ago
Very cool-looks like this is the same code that is used in Google Maps for location awareness in Firefox. It doesn't seem to like Opera (or it could be my connection not being found) but it seems to be cross browser compatible.
评论 #697739 未加载
TweedHeadsalmost 16 years ago
This snippet uses the new navigator.geolocation.getCurrentPosition() feature in Firefox 3.5<p>You will be redirected to Google Maps if you click the folowing link:<p>(You must click "share location" when prompted by the browser, you know, privacy concerns)<p><pre><code> javascript:navigator.geolocation.getCurrentPosition(function(position){window.location.href="http://maps.google.com/?ll="+position.coords.latitude+","+position.coords.longitude;}); </code></pre> Drop it in your bookmarks toolbar and presto!<p>Or get it from here <a href="http://mylittlehacks.appspot.com/geolocation" rel="nofollow">http://mylittlehacks.appspot.com/geolocation</a>
评论 #698123 未加载