我在android模拟器中遇到问题,我的svg / icon图层显示为黑色。有时这会影响高速公路/道路标记以及我的地图标记。该插件当前正在使用默认标记,但是我也提供了自己的png文件,它们都遇到了这个问题。
有时放大会修复它(如下面图片中的一个标记所示)
我尚未在任何其他设备上对此进行测试,并且仅使用了来自android studio的android模拟器。
一些额外的细节
我正在使用Angular(和TS)运行nativescript,我已经注释掉了添加标记等的任何无关代码,但仍然在高速公路数字标记上存在问题(下面的示例)。这是我的模板:
<StackLayout class="page">
<ContentView height="100%" width="100%">
<Mapbox
accessToken="token"
mapStyle="streets"
[latitude]=defaultLocation.latitude
[longitude]=defaultLocation.longitude
hideCompass="true"
zoomLevel="8"
showUserLocation="false"
disableZoom="false"
disableRotation="false"
disableScroll="false"
disableTilt="false"
(mapReady)="onMapReady($event)">
</Mapbox>
</ContentView>
</StackLayout>
Run Code Online (Sandbox Code Playgroud)
看来我可以使用以下代码调用removeMarkers和addMarkers来触发此操作:
updateUserMarker(loc) {
console.log("updating user location marker with loc: ", loc)
this.map.removeMarkers([this.userMarker.id]);
this.userMarker.lat = loc.latitude;
this.userMarker.lng = loc.longitude;
this.map.addMarkers([this.userMarker]);
}
Run Code Online (Sandbox Code Playgroud) 我正在创建一个像这样的observable:
return new Observable(sub => {
const {next, complete, error} = sub;
this.AuthHttp.get(`http://192.168.1.100:3000/api/users/${id}`)
.subscribe(res => {
let user = res.json();
next(user);
complete();
}, e => {
error(e.json());
});
})
Run Code Online (Sandbox Code Playgroud)
然而,当next()预期被召唤时,我的前端没有任何事情发生.如果我对代码进行微小的更改以便sub.next()调用,那么一切都按预期工作.这表明底层代码没有缺陷,只是我参考的方式next.
我之前看过这种与Observer类一起使用的解构形式(在线示例中),所以我在这里做错了什么?