过滤部分无效的地理编码和逆地理编码
This commit is contained in:
@@ -2,6 +2,7 @@ package com.mogo.map.search.geo.query;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.text.TextUtils;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -29,6 +30,12 @@ public class MogoGeocodeQuery implements Parcelable {
|
||||
this.city = city;
|
||||
}
|
||||
|
||||
public boolean check(){
|
||||
if ( TextUtils.isEmpty( locationName ) ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
|
||||
@@ -50,6 +50,18 @@ public class MogoRegeocodeQuery implements Parcelable {
|
||||
this.poiType = poiType;
|
||||
}
|
||||
|
||||
public boolean check() {
|
||||
if ( point == null ) {
|
||||
return false;
|
||||
}
|
||||
if ( point.lat < 1 && point.lon < 1 ) {
|
||||
return false;
|
||||
}
|
||||
if ( radius < 0 ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
|
||||
Reference in New Issue
Block a user