Browser's geolocation services:版間の差分

提供: fukudat
移動: 案内検索
 
1行: 1行:
Modern browsers on mobile PCs and smart phone are equipped with '''Geolocation Services'''.  This page lists links to documents for configuring your browser to use it.
+
Modern browsers on mobile PCs and smart phones are equipped with '''Geolocation Services'''.  This page lists links to documents for configuring your browser to use it.
  
 
== How to Allow Your Browsers to Use Geolocation Services ==
 
== How to Allow Your Browsers to Use Geolocation Services ==

2018年6月24日 (日) 17:35時点における最新版

Modern browsers on mobile PCs and smart phones are equipped with Geolocation Services. This page lists links to documents for configuring your browser to use it.

目次

[編集] How to Allow Your Browsers to Use Geolocation Services

Smart Phones (Android/iPhone/iPad)
https://buddypunch.freshdesk.com/support/solutions/articles/4000063036-how-do-i-enable-location-services-on-my-mobile-device-or-browser-
Firefox
https://support.mozilla.org/en-US/questions/988163
Google Chrome
https://yandex.com/support/common/browsers-settings/geo-chrome.html (PC/Mac)
https://support.google.com/chrome/answer/142065?co=GENIE.Platform%3DAndroid&hl=en (Android)
Safari
https://support.apple.com/en-us/HT204690 (Mac)

[編集] Google先生に聞く

[編集] 日本語

[編集] 英語

[編集] How to Get Geolocation Information in a Javascript/Typescript Program

Javascript snippet:

var options = {
  enableHighAccuracy: true,
  timeout: 5000,
  maximumAge: 0
};

function success(pos) {
  var crd = pos.coords;

  console.log('Your current position is:');
  console.log('Latitude : ' + crd.latitude);
  console.log('Longitude: ' + crd.longitude);
  console.log('More or less ' + crd.accuracy + ' meters.');
};

function error(err) {
  console.warn('ERROR(' + err.code + '): ' + err.message);
};

navigator.geolocation.getCurrentPosition(success, error, options);

Typescript snippet:

navigator.geolocation.getCurrentPosition(pos => {
  const lat = pos.coords.latitude.toFixed(6);  // latitude in degree
  const lng = pos.coords.longitude.toFixed(6); // longitude in degree
  ...
}, err => {
  console.warn('ERROR(' + err.code + '): ' + err.message);
}, {
  enableHighAccuracy: true,
  timeout: 5000,
  maximumAge: 0
});
個人用ツール
名前空間

変種
操作
案内
ツールボックス