00.ionic4:11.ionicとleafletで地図表示
差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン | ||
00.ionic4:11.ionicとleafletで地図表示 [2019/09/01] – [11.IonicとLeafletで地図表示] adash333 | 00.ionic4:11.ionicとleafletで地図表示 [2019/09/03] (現在) – [リンク] adash333 | ||
---|---|---|---|
行 130: | 行 130: | ||
この時点でのソースコード | この時点でのソースコード | ||
https:// | https:// | ||
+ | |||
+ | ===== @types/ | ||
+ | なぜかアイコンが表示されないので、https:// | ||
+ | |||
+ | |||
+ | < | ||
+ | npm install @types/ | ||
+ | </ | ||
+ | {{: | ||
+ | |||
+ | angular.jsonの設定(参考:[[https:// | ||
+ | |||
+ | |||
===== CapacitorのGeolocationを用いて現在地を表示 ===== | ===== CapacitorのGeolocationを用いて現在地を表示 ===== | ||
行 135: | 行 148: | ||
+ | https:// | ||
+ | |||
+ | https:// | ||
+ | |||
+ | https:// | ||
+ | |||
+ | https:// | ||
+ | |||
+ | を見ながらいろいろやったのですが、うまくアイコンを表示することができなかったので、結局、以下の方法で行いました。 | ||
+ | |||
+ | {{: | ||
+ | |||
+ | -"" | ||
+ | -"" | ||
+ | -C: | ||
+ | -angular.jsonを編集(assets と styles) | ||
+ | -tab1.page.tsからは以下のように呼び出す | ||
+ | |||
+ | < | ||
+ | import { Component } from ' | ||
+ | import * as L from ' | ||
+ | |||
+ | @Component({ | ||
+ | selector: ' | ||
+ | templateUrl: | ||
+ | styleUrls: [' | ||
+ | }) | ||
+ | export class Tab1Page { | ||
+ | map: any; | ||
+ | |||
+ | ionViewDidEnter() { | ||
+ | // 地図表示 | ||
+ | this.map = L.map(' | ||
+ | L.tileLayer(' | ||
+ | attribution: | ||
+ | }).addTo(this.map); | ||
+ | L.marker([35.685988, | ||
+ | icon: L.icon({ | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | }) | ||
+ | | ||
+ | } | ||
+ | |||
+ | /** Remove map when we have multiple map object */ | ||
+ | ionViewWillLeave() { | ||
+ | this.map.remove(); | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | {{: | ||
===== リンク ===== | ===== リンク ===== | ||
前:[[00.ionic4: | 前:[[00.ionic4: | ||
- | 次: | + | 次:[[00.ionic4: |
目次:[[00.ionic4: | 目次:[[00.ionic4: |
00.ionic4/11.ionicとleafletで地図表示.1567297197.txt.gz · 最終更新: 2019/09/01 by adash333