How can I always get the current map's south-west MapPos and north-east MapPos when I zoom in/zoom out the map or drag the map? I want to create a dynamic bounding box for Carto Map.

1 Answer 1


You should use mapView.screenToMap method with screen corner locations. Here is Java sample, C# is practically same:

ScreenPos sp1 = new ScreenPos(0, mapView.getHeight() / 2);
ScreenPos sp2 = new ScreenPos(mapView.getWidth(), mapView.getHeight() / 2);
MapPos mp1 = mapView.screenToMap(sp1);
MapPos mp2 = mapView.screenToMap(sp2);
MapPos pos1Wgs = mapView.getOptions().getBaseProjection().toWgs84(mp1);
MapPos pos2Wgs = mapView.getOptions().getBaseProjection().toWgs84(mp2);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.