Showing
1 changed file
with
17 additions
and
9 deletions
| @@ -189,7 +189,7 @@ Page({ | @@ -189,7 +189,7 @@ Page({ | ||
| 189 | if(this.mapCtx){ | 189 | if(this.mapCtx){ |
| 190 | this.mapCtx.getRegion({ | 190 | this.mapCtx.getRegion({ |
| 191 | success:(res)=>{ | 191 | success:(res)=>{ |
| 192 | - console.log('regionchange.getRegion',res) | 192 | + console.log('regionchange.getRegion.onpos',res) |
| 193 | //if(res.southwest.latitude!=this.mapData.region.southwest.latitude) { | 193 | //if(res.southwest.latitude!=this.mapData.region.southwest.latitude) { |
| 194 | this.mapData.region = res | 194 | this.mapData.region = res |
| 195 | //this.getMarkers(); | 195 | //this.getMarkers(); |
| @@ -224,7 +224,11 @@ Page({ | @@ -224,7 +224,11 @@ Page({ | ||
| 224 | console.log('regionchange.getRegion',res) | 224 | console.log('regionchange.getRegion',res) |
| 225 | if(res.southwest.latitude!=this.mapData.region.southwest.latitude) { | 225 | if(res.southwest.latitude!=this.mapData.region.southwest.latitude) { |
| 226 | this.mapData.region = res | 226 | this.mapData.region = res |
| 227 | - this.timeoutGetMarkers(); | 227 | + if(this.data.hasSuggestion){ |
| 228 | + this.getMarkers(); | ||
| 229 | + }else{ | ||
| 230 | + this.timeoutGetMarkers(); | ||
| 231 | + } | ||
| 228 | } | 232 | } |
| 229 | }, | 233 | }, |
| 230 | }) | 234 | }) |
| @@ -334,10 +338,10 @@ Page({ | @@ -334,10 +338,10 @@ Page({ | ||
| 334 | if(!this.user.latitude) return false;//用户无定位 | 338 | if(!this.user.latitude) return false;//用户无定位 |
| 335 | if(this.user.latitude==23.099994 && this.user.longitude==113.324520) return false;//默认位置 | 339 | if(this.user.latitude==23.099994 && this.user.longitude==113.324520) return false;//默认位置 |
| 336 | ///判断定位 首次 进入视野 | 340 | ///判断定位 首次 进入视野 |
| 337 | - if(this.user.latitude>map.region.southwest.latitude | 341 | + if((this.user.latitude>map.region.southwest.latitude |
| 338 | && this.user.longitude>map.region.southwest.longitude | 342 | && this.user.longitude>map.region.southwest.longitude |
| 339 | && this.user.latitude<map.region.northeast.latitude | 343 | && this.user.latitude<map.region.northeast.latitude |
| 340 | - && this.user.longitude<map.region.northeast.longitude){ | 344 | + && this.user.longitude<map.region.northeast.longitude) || this.data.hasSuggestion){ |
| 341 | this.hasInRegionFlag=true; | 345 | this.hasInRegionFlag=true; |
| 342 | return true; | 346 | return true; |
| 343 | }else{ | 347 | }else{ |
| @@ -584,13 +588,17 @@ Page({ | @@ -584,13 +588,17 @@ Page({ | ||
| 584 | ds.setA2LHeight(e.type=='hide'?0:40); | 588 | ds.setA2LHeight(e.type=='hide'?0:40); |
| 585 | }, | 589 | }, |
| 586 | setLocationMarker(markers){ | 590 | setLocationMarker(markers){ |
| 587 | - let lm=markers[markers.length-1]; | ||
| 588 | - if(lm && lm.id=='location'){ | ||
| 589 | - markers=markers.pop(); | 591 | + let mks=[] |
| 592 | + if(markers.length>0){ | ||
| 593 | + markers.forEach(mk=>{ | ||
| 594 | + if(mk.id!='location'){ | ||
| 595 | + mks.push(mk); | ||
| 596 | + } | ||
| 597 | + }) | ||
| 590 | } | 598 | } |
| 591 | if(this.data.hasSuggestion){ | 599 | if(this.data.hasSuggestion){ |
| 592 | let map = this.data.map; | 600 | let map = this.data.map; |
| 593 | - markers.push({ | 601 | + mks.push({ |
| 594 | id: 'location', | 602 | id: 'location', |
| 595 | iconPath: "http://qn.colorcun.com/reserve/images/location.png"+cates_version, | 603 | iconPath: "http://qn.colorcun.com/reserve/images/location.png"+cates_version, |
| 596 | latitude: map.latitude, | 604 | latitude: map.latitude, |
| @@ -599,6 +607,6 @@ Page({ | @@ -599,6 +607,6 @@ Page({ | ||
| 599 | height: 25, | 607 | height: 25, |
| 600 | }) | 608 | }) |
| 601 | } | 609 | } |
| 602 | - return markers; | 610 | + return mks; |
| 603 | }, | 611 | }, |
| 604 | }) | 612 | }) |
-
Please register or login to post a comment