Wednesday, April 23, 2014

Android Baidu map developers how to get the upper right corner and the lower left corner of the map coordinates


The coordinates are as scrolling map zoom changes how do I ask?
GeoPoint centerPoint = mMapView.getMapCenter () ;/ / map coordinates of the center point
int tpSpan = mMapView.getLatitudeSpan () ;/ / current weft span (from the top edge to the bottom edge of the map) int lrSpan = mMapView.getLongitudeSpan (); / / current span of longitude (from the left edge of the map to the right edge)
GeoPoint point = new GeoPoint (centerPoint.getLatitudeE6 () - tpSpan / 2, centerPoint.getLongitudeE6 () + lrSpan / 2) ;/ / right corner
GeoPoint point2 = new GeoPoint (centerPoint.getLatitudeE6 () + tpSpan / 2, centerPoint.getLongitudeE6 () - lrSpan / 2) ;/ / bottom left corner

This can, however, said the online int tpSpan = mMapView.getLatitudeSpan () ;/ / this sentence will be reported null pointer exception
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
should be a bug Baidu sdk's
Reply:
http://my.eoe.cn/imesong/archive/21390.html
Reply:
/ / Get the upper right corner and the lower left corner of the screen latitude and longitude
GeoPoint pointLeft = mapView.getProjection (). FromPixels (0,
mapView.getHeight ());

GeoPoint pointRight = mapView.getProjection (). FromPixels (
mapView.getWidth (), 0);

No comments:

Post a Comment