|
@@ -250,10 +250,10 @@ Page({ |
|
@@ -250,10 +250,10 @@ Page({ |
|
250
|
this.mapCtx.getRegion({
|
250
|
this.mapCtx.getRegion({
|
|
251
|
success:(res)=>{
|
251
|
success:(res)=>{
|
|
252
|
console.log('onpos.getRegion',res)
|
252
|
console.log('onpos.getRegion',res)
|
|
253
|
- //if(res.southwest.latitude!=this.mapData.region.southwest.latitude) {
|
|
|
|
254
|
- this.mapData.region = res
|
|
|
|
255
|
- //this.getMarkers();
|
|
|
|
256
|
- //}
|
253
|
+ if(this.mapData.region.southwest.latitude) {
|
|
|
|
254
|
+ this.mapData.region = res
|
|
|
|
255
|
+ //this.getMarkers();
|
|
|
|
256
|
+ }
|
|
257
|
},
|
257
|
},
|
|
258
|
})
|
258
|
})
|
|
259
|
}
|
259
|
}
|
|
@@ -283,7 +283,9 @@ Page({ |
|
@@ -283,7 +283,9 @@ Page({ |
|
283
|
success:(res)=>{
|
283
|
success:(res)=>{
|
|
284
|
console.log('regionchange.getRegion',res.southwest.latitude,this.mapData.region.southwest.latitude,res)
|
284
|
console.log('regionchange.getRegion',res.southwest.latitude,this.mapData.region.southwest.latitude,res)
|
|
285
|
this.hasClickMoveToLocation=false
|
285
|
this.hasClickMoveToLocation=false
|
|
286
|
- this.mapData.region = res
|
286
|
+ if(res.southwest.latitude) {
|
|
|
|
287
|
+ this.mapData.region = res
|
|
|
|
288
|
+ };
|
|
287
|
this.timeoutGetMarkers();
|
289
|
this.timeoutGetMarkers();
|
|
288
|
},
|
290
|
},
|
|
289
|
})
|
291
|
})
|
|
@@ -296,7 +298,7 @@ Page({ |
|
@@ -296,7 +298,7 @@ Page({ |
|
296
|
}
|
298
|
}
|
|
297
|
this.setTimeoutGetMarkers=setTimeout(()=>{
|
299
|
this.setTimeoutGetMarkers=setTimeout(()=>{
|
|
298
|
this.getMarkers();
|
300
|
this.getMarkers();
|
|
299
|
- },500)
|
301
|
+ },300)
|
|
300
|
},
|
302
|
},
|
|
301
|
mapUpdated(e){
|
303
|
mapUpdated(e){
|
|
302
|
console.log('mapUpdated', e)
|
304
|
console.log('mapUpdated', e)
|
|
@@ -321,12 +323,10 @@ Page({ |
|
@@ -321,12 +323,10 @@ Page({ |
|
321
|
});
|
323
|
});
|
|
322
|
this.mapCtx.getRegion({
|
324
|
this.mapCtx.getRegion({
|
|
323
|
success:(res)=>{
|
325
|
success:(res)=>{
|
|
324
|
- console.log('mapUpdated.getRegion',res)
|
|
|
|
325
|
- //if(res.southwest.latitude!=this.mapData.region.southwest.latitude){
|
|
|
|
326
|
- this.mapData.region=res
|
|
|
|
327
|
- //this.getMarkers();
|
|
|
|
328
|
- //}
|
|
|
|
329
|
-
|
326
|
+ if(this.mapData.region.southwest.latitude=='' || !res.southwest.latitude) return;
|
|
|
|
327
|
+ console.log('mapUpdated.getRegion',[res.southwest.latitude,this.mapData.region.southwest.latitude])
|
|
|
|
328
|
+ this.mapData.region=res
|
|
|
|
329
|
+ //this.timeoutGetMarkers();
|
|
330
|
},
|
330
|
},
|
|
331
|
})
|
331
|
})
|
|
332
|
},
|
332
|
},
|
|
@@ -458,6 +458,10 @@ Page({ |
|
@@ -458,6 +458,10 @@ Page({ |
|
458
|
if(tags.length>0){
|
458
|
if(tags.length>0){
|
|
459
|
param.tags=tags;
|
459
|
param.tags=tags;
|
|
460
|
}
|
460
|
}
|
|
|
|
461
|
+ param.centre_pos=`${this.mapData.latitude},${this.mapData.longitude}`
|
|
|
|
462
|
+ if(this.data.hasSuggestion){
|
|
|
|
463
|
+ param.centre_pos=`${this.data.suggestion.latitude},${this.data.suggestion.longitude}`
|
|
|
|
464
|
+ }
|
|
461
|
this.selectComponent('#list').getList(param);
|
465
|
this.selectComponent('#list').getList(param);
|
|
462
|
this.param=param;
|
466
|
this.param=param;
|
|
463
|
let now_sid=[];
|
467
|
let now_sid=[];
|
|
@@ -701,25 +705,36 @@ Page({ |
|
@@ -701,25 +705,36 @@ Page({ |
|
701
|
ds.setA2LHeight(e.type=='hide'?0:40);
|
705
|
ds.setA2LHeight(e.type=='hide'?0:40);
|
|
702
|
},
|
706
|
},
|
|
703
|
setLocationMarker(markers){
|
707
|
setLocationMarker(markers){
|
|
|
|
708
|
+ let map = this.mapData;
|
|
704
|
let mks=[]
|
709
|
let mks=[]
|
|
|
|
710
|
+ let matchPosNum=1
|
|
705
|
if(markers.length>0){
|
711
|
if(markers.length>0){
|
|
706
|
markers.forEach(mk=>{
|
712
|
markers.forEach(mk=>{
|
|
707
|
- if(mk.id!='location'){
|
713
|
+ if(mk.id!='location'
|
|
|
|
714
|
+ && mk.latitude>map.region.southwest.latitude
|
|
|
|
715
|
+ && mk.longitude>map.region.southwest.longitude
|
|
|
|
716
|
+ && mk.latitude<map.region.northeast.latitude
|
|
|
|
717
|
+ && mk.longitude<map.region.northeast.longitude){
|
|
708
|
mks.push(mk);
|
718
|
mks.push(mk);
|
|
709
|
}
|
719
|
}
|
|
710
|
})
|
720
|
})
|
|
711
|
}
|
721
|
}
|
|
712
|
- //if(this.data.hasSuggestion){
|
|
|
|
713
|
- let map = this.data.map;
|
|
|
|
714
|
- mks.push({
|
|
|
|
715
|
- id: 'location',
|
|
|
|
716
|
- iconPath: "http://qn.colorcun.com/reserve/images/location.png"+cates_version,
|
|
|
|
717
|
- latitude: map.latitude,
|
|
|
|
718
|
- longitude: map.longitude,
|
|
|
|
719
|
- width: 20,
|
|
|
|
720
|
- height: 25,
|
|
|
|
721
|
- })
|
|
|
|
722
|
- //}
|
722
|
+ if(mks.length-markers.length<0){
|
|
|
|
723
|
+ this.timeoutGetMarkers()
|
|
|
|
724
|
+ return []
|
|
|
|
725
|
+ }
|
|
|
|
726
|
+
|
|
|
|
727
|
+ if(this.data.hasSuggestion){
|
|
|
|
728
|
+ map=this.data.suggestion
|
|
|
|
729
|
+ }
|
|
|
|
730
|
+ mks.push({
|
|
|
|
731
|
+ id: 'location',
|
|
|
|
732
|
+ iconPath: "http://qn.colorcun.com/reserve/images/location.png"+cates_version,
|
|
|
|
733
|
+ latitude: map.latitude,
|
|
|
|
734
|
+ longitude: map.longitude,
|
|
|
|
735
|
+ width: 20,
|
|
|
|
736
|
+ height: 25,
|
|
|
|
737
|
+ })
|
|
723
|
return mks;
|
738
|
return mks;
|
|
724
|
},
|
739
|
},
|
|
725
|
tagsChange(e){
|
740
|
tagsChange(e){
|
|
@@ -786,6 +801,7 @@ Page({ |
|
@@ -786,6 +801,7 @@ Page({ |
|
786
|
map:this.param.map,
|
801
|
map:this.param.map,
|
|
787
|
multiIndex:this.data.multiIndex,
|
802
|
multiIndex:this.data.multiIndex,
|
|
788
|
tags:this.param.tags,
|
803
|
tags:this.param.tags,
|
|
|
|
804
|
+ centre_pos:this.param.centre_pos,
|
|
789
|
},'./indexList')
|
805
|
},'./indexList')
|
|
790
|
});
|
806
|
});
|
|
791
|
},
|
807
|
},
|