我正在尝试正确显示Polygon
Nutieq 下的内容,Bounding Box
但我得到了这样的结果。
我想要的是
我的代码如下
private void setClipBounds(Intent intent, MapView mapView) {
ArrayList<ArrayList<String>> limits = null;
if (intent.hasExtra(Constants._LIMITS)) {
limits = (ArrayList<ArrayList<String>>) intent.getSerializableExtra(Constants._LIMITS);
ArrayList<String> downLeft = limits.get(0);
ArrayList<String> upRight = limits.get(1);
double left = Double.parseDouble((String)(downLeft.get(0)));
double top = Double.parseDouble((String)(upRight.get(1)));
double right = Double.parseDouble((String)(upRight.get(0)));
double bottom = Double.parseDouble((String)(downLeft.get(1)));
MapPos downLeftPos = mapView.worldToScreen(left, bottom, 0);
MapPos rightUpPos = mapView.worldToScreen(right, top, 0);
Rect rect = new Rect(Math.round((float)downLeftPos.x), Math.round((float)rightUpPos.y), Math.round((float)rightUpPos.x), Math.round((float)downLeftPos.y));
Bounds bounds = new Bounds(left, top, right, bottom);
mapView.setBoundingBox(bounds, rect, false, false, false, 1000);
//mapView.setBoundingBox(bounds, false);
} else {
Log.i("TAG", "WmsMapActivity::setClipBounds:: NO limits!!!");
}
}
谁能告诉我,我做错了什么?
提前致谢。