该问题是由于 Google Map API 对于某些地理要素类型的属性解析造成的,具体原因可能是 Google Map API 的版本不兼容或者 API 自身存在问题。
解决方法可以尝试更新 Google Map API 的版本,或者使用其他地图 API。
如果想继续使用 Google Map,可以尝试将 feature type road.local.trail 替换为其他支持的地理要素类型,例如 road,local road,或者其他可用的类型。
示例代码:
//创建地图对象 GoogleMap mMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();
//定义地理要素类型 String featureType = "road.local.trail";
//将 feature type 替换为其他支持的类型 featureType = "road";
//添加地理要素 mMap.addMarker(new MarkerOptions() .position(new LatLng(lat, lon)) .title("Marker") .icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_RED)));