接入基础UI
This commit is contained in:
@@ -24,6 +24,7 @@ class MapStyleController {
|
||||
|
||||
private MapStyleController() {
|
||||
mVrAreaFilters.add( new ShunYiArea() );
|
||||
mVrAreaFilters.add( new OCHArea() );
|
||||
}
|
||||
|
||||
public static MapStyleController getInstance() {
|
||||
@@ -85,7 +86,21 @@ class MapStyleController {
|
||||
}
|
||||
|
||||
public interface VrAreaFilter {
|
||||
boolean isVrArea( MogoLocation location );
|
||||
default boolean isVrArea( MogoLocation location ) {
|
||||
if ( location == null ) {
|
||||
return false;
|
||||
}
|
||||
return location.getLat() > getLeftBottomLat() && location.getLon() > getLeftBottomLon()
|
||||
&& location.getLat() < getRightTopLat() && location.getLon() < getRightTopLon();
|
||||
}
|
||||
|
||||
double getLeftBottomLat();
|
||||
|
||||
double getLeftBottomLon();
|
||||
|
||||
double getRightTopLat();
|
||||
|
||||
double getRightTopLon();
|
||||
}
|
||||
|
||||
public static class ShunYiArea implements VrAreaFilter {
|
||||
@@ -97,12 +112,46 @@ class MapStyleController {
|
||||
private final double rightTopLon = 116.74804;
|
||||
|
||||
@Override
|
||||
public boolean isVrArea( MogoLocation location ) {
|
||||
if ( location == null ) {
|
||||
return false;
|
||||
}
|
||||
return location.getLat() > leftBottomLat && location.getLon() > leftBottomLon
|
||||
&& location.getLat() < rightTopLat && location.getLon() < rightTopLon;
|
||||
public double getLeftBottomLat() {
|
||||
return leftBottomLat;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getLeftBottomLon() {
|
||||
return leftBottomLon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getRightTopLat() {
|
||||
return rightTopLat;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getRightTopLon() {
|
||||
return rightTopLon;
|
||||
}
|
||||
}
|
||||
|
||||
public static class OCHArea implements VrAreaFilter {
|
||||
|
||||
@Override
|
||||
public double getLeftBottomLat() {
|
||||
return 39.97645;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getLeftBottomLon() {
|
||||
return 116.41673;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getRightTopLat() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getRightTopLon() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user