[英]how to get center of screen Coordinates in android Mapbox
我怎樣才能在android mapbox中獲得屏幕中心坐標
public void setMarker(double lat,double lng){
sourceLat = lat;
sourceLng = lng;
map.setSourcePin(lat , lng);
map.flyTo(lat, lng);
}
double mapLat = mapboxMap.getCameraPosition().target.getLatitude()
double mapLong = mapboxMap.getCameraPosition().target.getLongitude()
編輯:地圖的中心是target
。 MapboxMap
類具有getCameraPosition()
方法和CameraPosition
類中的Target
類。
LatLng mapLatLng = mapboxMap.getCameraPosition().target;
double mapLat = mapLatLng.getLatitude();
double mapLong = mapLatLng.getLongitude();
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.