00.ionic4:11.ionicとleafletで地図表示
差分
このページの2つのバージョン間の差分を表示します。
| 両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン | ||
| 00.ionic4:11.ionicとleafletで地図表示 [2019/09/01] – [地図の表示(tab1.page.html)] adash333 | 00.ionic4:11.ionicとleafletで地図表示 [2019/09/03] (現在) – [リンク] adash333 | ||
|---|---|---|---|
| 行 148: | 行 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で地図表示.1567297479.txt.gz · 最終更新: 2019/09/01 by adash333
