よくわかんないけど以下の手順で解決。
1.一回エラーになってるところを削除してビルド
2.ビルドが通ったらソースを戻すとあら不思議エラーが消えちゃう
なおModelの定義は、最初のPageタグ内の属性で定義する。
xmlns:Model="using:Namespage"
xmlns:Model="using:Namespage"
ionic start MyIonicProject tutorial
"@types/leaflet": "1.2.3",
"@asymmetrik/ngx-leaflet": "2.5.3",
"leaflet": "1.2.0",
"leaflet-bing-layer": "3.2.0"
"config": {
"ionic_copy": "./config/copy.config.js"
}
module.exports = {
copyAnimateCss: {
src: './node_modules/leaflet/dist/leaflet.css',
dest: '{{BUILD}}'
}
}
<link href="build/leaflet.css" rel="stylesheet">
<ion-content padding>
<div id="map" style="width:100%; height:100%;"></div>
</ion-content>import { Component, ViewChild, ElementRef } from '@angular/core';
import NGX from '@asymmetrik/ngx-leaflet';
import L from 'leaflet';
import 'leaflet-bing-layer';
@Component({
selector: 'page-hello-ionic',
templateUrl: 'hello-ionic.html'
})
export class HelloIonicPage {
map: any;
constructor() {
}
ionViewDidEnter() {
this.loadmap();
}
loadmap() {
this.map = L.map("map").setView([35.658581, 139.745433], 16);
L.tileLayer.bing('BingMasのキー', {
maxZoom: 18
}).addTo(this.map);
}
}ionic serve