I'm trying to show a Polygon
under Nutiteq in a properly Bounding Box
but I get something like this.
and what I want is
My code is the following
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!!!");
}
}
Could anyone say me, what I'm making wrong?
Thanks in advance.