android - 谷歌地图addMarker在小米MI A3中不起作用
问题描述
我正在尝试根据我从我的网络服务获得的经度和纬度移动一个标记,但问题是当我在 xiaomi mi a3 中尝试它时不起作用我得到了最后一个位置而没有任何更新我去应用程序中的其他一些地方,我回来了,我发现这个位置真的改变了。
if (marker != null) {
marker.setVisible(false);
}
marker = createMarker(SharedData.getDemandeEncours().getLatitude(),
SharedData.getDemandeEncours().getLongitude(),
SharedData.getDemandeEncours().getImmatriculation(), draw);
public Marker createMarker(double latitude, double longitude, String title, int iconResID) {
if (iconResID == 0) {
return googleMape.addMarker(new MarkerOptions()
.position(new LatLng(latitude, longitude))
.title(title));
} else {
return googleMape.addMarker(new MarkerOptions()
.position(new LatLng(latitude, longitude))
.title(title)
.icon(BitmapDescriptorFactory.fromResource(iconResID)));
}
}
解决方案
推荐阅读
- python - 我在那里做错了什么?错误“索引超出范围”试图用列表填充列表
- vue.js - bootstrap-vue 切换扩展表行
- node.js - 亚马逊上的 Alexa-Skill 订单产品
- java - 在 Java 中创建斜坡
- javascript - 使用多部分响应创建批处理 HTTP API
- java - PECS 用于非集合中的泛型
- java - Spring Boot - 多部分 - 不支持的媒体类型
- google-apps-script - Stackdriver Logging API 返回响应代码 200,但响应为空
- jhipster - Jhipster 如何生成 swagger 信息?
- mysql - SQL 打印在一行中