Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixing geolocation detect. see also https://github.com/Modernizr/Mode…

  • Loading branch information...
commit 8e731f560b642f3fe55bf3204131e6d778bde427 1 parent 10fd9c9
@paulirish paulirish authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 detect.html
View
6 detect.html
@@ -375,10 +375,10 @@ <h2 id=geolocation>Geolocation</h2>
</div>
</div>
-<p>Checking for geolocation support uses <a href=#techniques>detection technique #1</a>. If your browser supports the geolocation <abbr>API</abbr>, there will be a <code>geolocation</code> property on the global <code>navigator</code> object. If your browser doesn&#8217;t support the geolocation <abbr>API</abbr>, the <code>geolocation</code> property will be undefined. Here&#8217;s how to check for geolocation support:
+<p>Checking for geolocation support uses <a href=#techniques>detection technique #1</a>. If your browser supports the geolocation <abbr>API</abbr>, there will be a <code>geolocation</code> property on the global <code>navigator</code> object. If your browser doesn&#8217;t support the geolocation <abbr>API</abbr>, the <code>geolocation</code> property will not be present inside of <code>navigator</code>. Here&#8217;s how to check for geolocation support:
<pre><code>function supports_geolocation() {
- return !!navigator.geolocation;
+ return 'geolocation' in navigator;
}</code></pre>
<p>Instead of writing this function yourself, you can use <a href=#modernizr>Modernizr</a> to detect support for the geolocation <abbr>API</abbr>.
@@ -623,7 +623,7 @@ <h2 id=further-reading>Further Reading</h2>
function show_map(loc) {
$("#geo-wrapper").css({'width':'320px','height':'350px'});
var map = new google.maps.Map(document.getElementById("geo-wrapper"), {zoom: 14, mapTypeControl:true, zoomControl: true, mapTypeId: google.maps.MapTypeId.ROADMAP});
- var center = new google.maps.LatLng(loc.coords.latitude,loc.coords.longitude);
+ var center = new google.maps.LatLng(loc.coords.latitude,loc.coords.longitude);
map.setCenter(center);
var marker = new google.maps.Marker({map: map, position: center, draggable: false, title: "You are here (more or less)"});
}
Please sign in to comment.
Something went wrong with that request. Please try again.