00.ionic4:10.ionic4とcapacitorでgps取得
差分
このページの2つのバージョン間の差分を表示します。
| 両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン | ||
| 00.ionic4:10.ionic4とcapacitorでgps取得 [2019/08/28] – [(オプション)Add to HomeScreenボタンの追加] adash333 | 00.ionic4:10.ionic4とcapacitorでgps取得 [2019/09/01] (現在) – [tab1.page.tsの編集] adash333 | ||
|---|---|---|---|
| 行 1: | 行 1: | ||
| ====== 10.ionic4とcapacitorでgps取得 ====== | ====== 10.ionic4とcapacitorでgps取得 ====== | ||
| | | ||
| + | |||
| + | Vue.jsとOpenstreetMapを用いた方法を記載させて頂きました。 | ||
| + | →[[https:// | ||
| 以下のサイトを写経してみたいと思います。 | 以下のサイトを写経してみたいと思います。 | ||
| 行 61: | 行 64: | ||
| src/ | src/ | ||
| + | |||
| + | <code html> | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | </ | ||
| (変更前) | (変更前) | ||
| 行 71: | 行 87: | ||
| src/ | src/ | ||
| + | |||
| + | <code javascript> | ||
| + | import { Geolocation} from ' | ||
| + | |||
| + | // | ||
| + | |||
| + | export class Tab1Page { | ||
| + | latitude: number; | ||
| + | longitude: number; | ||
| + | |||
| + | constructor() { | ||
| + | this.getLocation(); | ||
| + | } | ||
| + | |||
| + | async getLocation() { | ||
| + | const position = await Geolocation.getCurrentPosition(); | ||
| + | this.latitude = position.coords.latitude; | ||
| + | this.longitude = position.coords.longitude; | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| (変更前) | (変更前) | ||
| 行 247: | 行 284: | ||
| http:// | http:// | ||
| - | src/ | + | [[https:// |
| < | < | ||
| // 一部省略 | // 一部省略 | ||
| 行 256: | 行 293: | ||
| {{: | {{: | ||
| - | src/ | + | [[https:// |
| < | < | ||
| // 一部省略 | // 一部省略 | ||
| 行 352: | 行 389: | ||
| ===== リンク ===== | ===== リンク ===== | ||
| + | 前:[[00.ionic4: | ||
| + | |||
| + | 次:[[00.ionic4: | ||
| + | |||
| [[00.ionic4: | [[00.ionic4: | ||
00.ionic4/10.ionic4とcapacitorでgps取得.1567004167.txt.gz · 最終更新: 2019/08/28 by adash333
