Ich habe das folgende Problem in meinem Webbrowser beim Versuch, ionic 2 und MapBox GL JS zu verwenden (Ich habe eine einfache ionische dienen):Mapbox GL JS und Ionic 2 RC3 Ausgabe: mapbox-gl js util util.js Unerwartetes Token
Error: Module parse failed: C:\Workspace\mapBox\node_modules\mapbox-gl\js\util\util.js Unexpected token (15:35)
You may need an appropriate loader to handle this file type.
| * @private
| */
| exports.easeCubicInOut = function(t: number): number {
| if (t <= 0) return 0;
| if (t >= 1) return 1;
at eval (\C:\Workspace\mapBox\node_modules\mapbox-gl\js\util\util.js:1:7)
at Object.<anonymous> (http:// localhost:8100/build/main.js:99:1)
at __webpack_require__ (http:// localhost:8100/build/main.js:20:30)
at eval (\C:\Workspace\mapBox\node_modules\mapbox-gl\js\ui\map.js:3:14)
at Object.<anonymous> (http:// localhost:8100/build/main.js:5412:1)
at __webpack_require__ (http:// localhost:8100/build/main.js:20:30)
at eval (\C:\Workspace\mapBox\node_modules\mapbox-gl\js\mapbox-gl.js:11:16)
at Object.<anonymous> (http:// localhost:8100/build/main.js:3644:1)
at __webpack_require__ (http:// localhost:8100/build/main.js:20:30)
at eval (\C:\Workspace\mapBox\src\pages\home\home.ts:2:68)
das sind die Schritte, die ich gefolgt:
ich begann
ein neues ionischen 2 leeres Projekt// Installation app-Skripte
npm install @ionic/[email protected] --save-dev
// Installation MapBox Plugin und Typisierungen
npm install --save-dev mapbox-gl
typings install --save --global dt~geojson
typings install --save --global dt~mapbox-gl
ist mein Code ganz einfach, und ich habe kein Problem Typoskript
import { Component } from '@angular/core';
import mapboxgl from 'mapbox-gl';
import { NavController } from 'ionic-angular';
@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
constructor(public navCtrl: NavController) {
mapboxgl.accessToken = 'pk.eyJ1Ijoib2xpdmllcnBvdW0iLCJhIjoiY2l3OGJ5eDl0MDAyaDJvcDV1bWhrdWRsYSJ9.FxIRs2au2Rd5OR1pQlZi8A';
var map = new mapboxgl.Map({
container: 'map',
style: 'mapbox://styles/mapbox/streets-v9'
});
}
}
Ich sehe nicht, welche Art von Datei wird der Fehler Referenzierung über .
Vielen Dank für Ihre Hilfe
nicht teilen, dass ein öffentlicher Zugriffstoken ist, zu teilen, es ist in Ordnung. –