0

We normally need to check for browser support when we want to use a feature, such as navigator.GeoLocation object.

But exactly where and how do they exist? A physical dll file or completely saved in memory when the browsrr is running? Thanks

Fady Sadek
1,1601 gold badge13 silver badges23 bronze badges
asked Feb 2, 2017 at 19:30

1 Answer 1

1

You can use following packages

Here : https://modernizr.com/docs/#what-is-feature-detection

But want with GeoLocation use this type of code

// Try HTML5 geolocation
 if(navigator.geolocation) {
 navigator.geolocation.getCurrentPosition(function(position) {
 var pos = new google.maps.LatLng(position.coords.latitude,
 position.coords.longitude);
 var infowindow = new google.maps.InfoWindow({
 map: map,
 position: pos,
 content: 'Location found using HTML5.'
 });
 map.setCenter(pos);
 }, function() {
 handleNoGeolocation(true);
 });
 } else {
 // Browser doesn't support Geolocation
 handleNoGeolocation(false);
 }
answered Feb 3, 2017 at 4:42
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.