接入基础UI

This commit is contained in:
wangcongtao
2021-01-21 16:44:04 +08:00
parent 5e1961eb33
commit c40126aaf2
6 changed files with 138 additions and 47 deletions

View File

@@ -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;
}
}
}