Skip to content

Commit

Permalink
fixed zoom bug
Browse files Browse the repository at this point in the history
  • Loading branch information
PGWelch committed Jan 13, 2015
1 parent cf69487 commit 535434f
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import java.util.List;
import java.util.Random;



import com.opendoorlogistics.api.geometry.LatLong;
import com.opendoorlogistics.api.tables.ODLDatastore;
import com.opendoorlogistics.api.tables.ODLDatastoreAlterable;
Expand All @@ -29,6 +31,7 @@
import com.opendoorlogistics.core.utils.Colours;
import com.opendoorlogistics.core.utils.Pair;
import com.opendoorlogistics.core.utils.strings.Strings;
import com.vividsolutions.jts.geom.Envelope;

final public class MapUtils {

Expand Down Expand Up @@ -70,7 +73,15 @@ public static LatLongBoundingBox getLatLongBoundingBox(Iterable<? extends Drawab
if(Strings.isEmpty(legendKeyFilter) || Strings.equalsStd(pnt.getLegendKey(), legendKeyFilter)){
if(pnt.getGeometry()==null){
ret.add(pnt);
}else if(pnt.getGeometry().getWGSCentroid()!=null){
}
else if(pnt.getGeometry().getWGSBounds()!=null){
Envelope env = pnt.getGeometry().getWGSBounds();
ret.add(env.getMinY(), env.getMinX());
ret.add(env.getMinY(), env.getMaxX());
ret.add(env.getMaxY(), env.getMinX());
ret.add(env.getMaxY(), env.getMaxX());
}
else if(pnt.getGeometry().getWGSCentroid()!=null){
ret.add(pnt.getGeometry().getWGSCentroid());
}
}
Expand Down

0 comments on commit 535434f

Please sign in to comment.