This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div class="home"></div> | |
</template> | |
<script> | |
// @ is an alias to /src | |
import "leaflet/dist/leaflet.css"; | |
import L from "leaflet"; | |
// Leafletアイコン表示用 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ion-header> | |
<ion-toolbar> | |
<ion-title> | |
GPS | |
</ion-title> | |
</ion-toolbar> | |
</ion-header> | |
<ion-content> | |
<ion-card class="welcome-card"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Ll]ibrary/ | |
[Tt]emp/ | |
[Oo]bj/ | |
[Bb]uild/ | |
[Bb]uilds/ | |
Assets/AssetStoreTools* | |
# Visual Studio cache directory | |
.vs/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.UI; | |
public class UpdateGPSText : MonoBehaviour | |
{ | |
public Text coordinates; | |
private void Update() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class GPS : MonoBehaviour | |
{ | |
public static GPS Instance { set; get; } | |
public float latitude; | |
public float longitude; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.UI; | |
public class LonLatToUI : MonoBehaviour | |
{ | |
// テキストテンプレート | |
private const string LonLatInfoTemplate = "緯度: {0}\n経度: {1}\n住所: {2}"; | |
// 表示用テキストUIオブジェクト | |
private Text lonLatInfo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using MiniJSON; | |
// https://gist.github.com/darktable/1411710 から | |
// MiniJSON.csをダウンロードしてProjectタブ > Plugins フォルダに入れる必要あり | |
using UnityEngine; | |
public class LonLatToAddr : MonoBehaviour | |
{ | |
// APIのパラメータテンプレートつきURL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using UnityEngine; | |
// 緯度経度取得クラス | |
public class LonLatGetter : MonoBehaviour | |
{ | |
// 緯度経度取得間隔(秒) | |
private const float IntervalSeconds = 1.0f; | |
// ロケーションサービスのステータス |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- index.htmlのhead タグで囲まれた部分に以下を追加します --> | |
<!-- manifest.jsonを呼び出しています --> | |
<link rel="manifest" href="./manifest.json"> | |
<script> | |
// service workerが有効なら、service-worker.js を登録します | |
if ('serviceWorker' in navigator) { | |
navigator.serviceWorker.register('./service-worker.js').then(function() { console.log('Service Worker Registered'); }); | |
} | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// service-worker.js | |
// original code from https://qiita.com/umamichi/items/0e2b4b1c578e7335ba20 | |
self.addEventListener('install', function(e) { | |
console.log('[ServiceWorker] Install'); | |
}); | |
self.addEventListener('activate', function(e) { | |
console.log('[ServiceWorker] Activate'); | |
}); |