Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/31.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular Nativescript。地图盒。打字脚本+;角2_Angular_Typescript_Mapbox_Nativescript - Fatal编程技术网

Angular Nativescript。地图盒。打字脚本+;角2

Angular Nativescript。地图盒。打字脚本+;角2,angular,typescript,mapbox,nativescript,Angular,Typescript,Mapbox,Nativescript,我在应用程序中使用mapbox。当我在使用地图的页面上导航时,一切都很完美。之后,我点击其中一个标记,进入下一页。但是,当我单击backButton或在下一页调用routerExtensions.back()时,我会返回带有map的页面,但map会消失。我可以盲目地点击我的地图标记,我将在下一页导航,但我看不到地图 下面是带有map的类的代码: export class CarwashListComponent implements OnInit { ngOnInit() {

我在应用程序中使用mapbox。当我在使用地图的页面上导航时,一切都很完美。之后,我点击其中一个标记,进入下一页。但是,当我单击backButton或在下一页调用routerExtensions.back()时,我会返回带有map的页面,但map会消失。我可以盲目地点击我的地图标记,我将在下一页导航,但我看不到地图

下面是带有map的类的代码:

export class CarwashListComponent implements OnInit {

    ngOnInit() {
        this.initMap();
    }

    initMap() {
        var _this = this;
        this.mapbox.show({
            accessToken: "pk.eyJ1IjoiaWxqYWdyYWJhcjE0IiwiYSI6ImNpd25laGw2YTAwMTIyeW10ZXM0a3l6M2UifQ.CfGJKVjVzM-lRzko7cP37g",
            mapStyle: "light",
            center: { // optional without a default
                lat: this.cities[0]['coordinates'][1],
                lng: this.cities[0]['coordinates'][0]
              },
            markers: [
                {
                 lat: 52.3732160, 
                 lng: 4.8941680, 
                 title: 'Nice location', 
                 subtitle: 'Really really nice location', 
                 onCalloutTap: function () {
                                 _this.routerExtensions.navigate(["next_page"]))
               }
            ],
            zoomLevel:9.5,
            showUserLocation: "true"
      })
   }
}

我做错了什么?

您是否尝试过通过repo的问题部分联系nativescript mapbox开发人员:。看起来nativescript mapbox有一个内部异常,导致后台导航中断Angular 2组件或与mapbox相关的其他内容。