Mapbox无法正常工作并显示错误,因此请告诉我它如何工作并显示以下错误

时间:2019-09-20 05:38:46

标签: nativescript mapbox

我正在将此代码添加到我的文件中,此代码无法正常工作,并且未定义错误“ mapboxsdk”,并且未在预览应用程序上添加nativescript-mapbox,这也是黄色警告。因此,现在我可以使用添加了令牌的mapbox插件了,但是它不起作用。

  

TypeError:无法读取未定义的属性“ mapboxsdk”

HTML:

<ContentView height="100%" width="100%">
    <Mapbox
        accessToken="your_token"
        mapStyle="traffic_day"
        latitude="50.467735"
        longitude="13.427718"
        hideCompass="true"
        zoomLevel="18"
        showUserLocation="false"
        disableZoom="false"
        disableRotation="false"
        disableScroll="false"
        disableTilt="false"
        (mapReady)="onMapReady($event)">
    </Mapbox>
  </ContentView>

component.ts:

import { registerElement } from "nativescript-angular/element-registry";
registerElement("Mapbox", () => require("nativescript-mapbox").MapboxView);

0 个答案:

没有答案