修改废弃的字段调用

Signed-off-by: 董宏宇 <martindhy@gmail.com>
This commit is contained in:
董宏宇
2021-09-17 17:50:37 +08:00
parent 4556727d23
commit 65cc40d6c3
7 changed files with 16 additions and 31 deletions

View File

@@ -436,7 +436,7 @@ public class AMapViewWrapper implements IMogoMapView,
@Override
public void moveToCenter(MogoLatLng latLng, boolean animate) {
Logger.d(TAG, "move to center %s", latLng);
if (latLng == null || latLng.lat == 0.0d || latLng.lng == 0.0d) {
if (latLng == null || latLng.lat == 0.0d || latLng.lon == 0.0d) {
Logger.e(TAG, "latlng = null or is illegal");
return;
}

View File

@@ -53,24 +53,24 @@ public class MogoMapUtils {
if ( latLngBounds.getNortheast() == null ) {
dLat = Math.abs( carPosition.lat - latLngBounds.getSouthwest().getLatitude() );
dLon = Math.abs( carPosition.lng - latLngBounds.getSouthwest().getLongitude() );
dLon = Math.abs( carPosition.lon - latLngBounds.getSouthwest().getLongitude() );
} else if ( latLngBounds.getSouthwest() == null ) {
dLat = Math.abs( carPosition.lat - latLngBounds.getNortheast().getLatitude() );
dLon = Math.abs( carPosition.lng - latLngBounds.getNortheast().getLongitude() );
dLon = Math.abs( carPosition.lon - latLngBounds.getNortheast().getLongitude() );
} else {
final double dLat1 = Math.abs( carPosition.lat - latLngBounds.getSouthwest().getLatitude() );
final double dLon1 = Math.abs( carPosition.lng - latLngBounds.getSouthwest().getLongitude() );
final double dLon1 = Math.abs( carPosition.lon - latLngBounds.getSouthwest().getLongitude() );
final double dLat2 = Math.abs( carPosition.lat - latLngBounds.getNortheast().getLatitude() );
final double dLon2 = Math.abs( carPosition.lng - latLngBounds.getNortheast().getLongitude() );
final double dLon2 = Math.abs( carPosition.lon - latLngBounds.getNortheast().getLongitude() );
dLat = dLat1 > dLat2 ? dLat1 : dLat2;
dLon = dLon1 > dLon2 ? dLon1 : dLon2;
}
west = carPosition.lat - dLat;
south = carPosition.lng + dLon;
south = carPosition.lon + dLon;
east = carPosition.lat + dLat;
north = carPosition.lng - dLon;
north = carPosition.lon - dLon;
if ( south == 0.0 || west == 0.0 || east == 0.0 || north == 0.0 ) {
return null;