[map]修改城市id不存在时,返回下载失败
This commit is contained in:
@@ -1107,14 +1107,17 @@ class RoadHelper private constructor() {
|
||||
private var mIsExecute: AtomicBoolean = AtomicBoolean(true)
|
||||
private var cacheList = CopyOnWriteArrayList<Int>()
|
||||
fun cacheHDDataByCity(id: Int, listener: OnHdDataDownByCityListener){
|
||||
addHdDataDownListener(id,listener)
|
||||
if(id == 0) {
|
||||
dispatchHdDataDownStateListener(id, 0)
|
||||
removeHdDataDownListener(id)
|
||||
return
|
||||
}
|
||||
// 检查特定城市是否已经有一个缓存操作正在进行
|
||||
if(cacheList.contains(id)){
|
||||
return
|
||||
}
|
||||
addHdDataDownListener(id,listener)
|
||||
|
||||
|
||||
cancelCacheHDData()
|
||||
cacheList.add(id)
|
||||
@@ -1166,11 +1169,17 @@ class RoadHelper private constructor() {
|
||||
|
||||
fun cacheHDDataByCityLonLat(lon: Double, lat: Double, listener: OnHdDataDownByCityListener){
|
||||
if (TransformUtils.outOfChina(lat, lon)) {
|
||||
addHdDataDownListener(0,listener)
|
||||
dispatchHdDataDownStateListener(0, 0)
|
||||
removeHdDataDownListener(0)
|
||||
return
|
||||
}
|
||||
getCityCode(lon, lat, object : IResult<Int> {
|
||||
override fun result(code: Int, result: Int?) {
|
||||
if (result == 0) {
|
||||
addHdDataDownListener(0,listener)
|
||||
dispatchHdDataDownStateListener(0, 0)
|
||||
removeHdDataDownListener(0)
|
||||
return
|
||||
}
|
||||
if (CompileConfig.DEBUG) {
|
||||
|
||||
Reference in New Issue
Block a user