Map: add getBoundingBox

This commit is contained in:
Hannes Janetzek 2014-10-20 20:55:11 +02:00
parent 231d596b69
commit 1ea26e576e

View File

@ -16,6 +16,8 @@
*/
package org.oscim.map;
import org.oscim.core.BoundingBox;
import org.oscim.core.Box;
import org.oscim.core.MapPosition;
import org.oscim.event.Event;
import org.oscim.event.EventDispatcher;
@ -287,6 +289,13 @@ public abstract class Map implements TaskQueue {
return pos;
}
public BoundingBox getBoundingBox(int expand) {
Box box = new Box();
mViewport.getBBox(box, expand);
box.map2mercator();
return new BoundingBox(box.ymin, box.xmin, box.ymax, box.xmax);
}
/**
* @return Viewport instance
*/