我正在将此代码添加到我的文件中,此代码无法正常工作,并且未定义错误“ 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);