diff --git a/uni_modules/d-form/components/d-form/d-form.vue b/uni_modules/d-form/components/d-form/d-form.vue index c9e4cb1..4ee6c5e 100644 --- a/uni_modules/d-form/components/d-form/d-form.vue +++ b/uni_modules/d-form/components/d-form/d-form.vue @@ -277,6 +277,11 @@ import {computeArea} from '@/common/utils' } return [] } + /* #ifdef APP-PLUS */ + var polyline=new plus.maps.Polyline([]) + polyline.setLineWidth(8) + polyline.setStrokeColor("#10C176") + /* #endif */ export default{ props:{ @@ -353,6 +358,17 @@ import {computeArea} from '@/common/utils' }) } }, + showMap(n){ + if(!n){ + if(this.value.length<=0){ + this.markerList=this.$defineArray([]) + this.temp_markerList=this.$defineArray([]) + this.areaPolygon=null + polyline.setPath([]) + this.maps.clearOverlays() + } + } + } }, computed:{ date(){ @@ -445,14 +461,10 @@ import {computeArea} from '@/common/utils' this.maps.setMapType(plus.maps.MapType.MAPTYPE_SATELLITE) this.maps.centerAndZoom(new plus.maps.Point(102.712251,25.040609),10) - var polyline=new plus.maps.Polyline([]) - polyline.setLineWidth(8) - polyline.setStrokeColor("#10C176") - if(this.value.length>0){ var bound=computeArea(this.value) for(var i=0;i=2 && polyline.setPath(this.markerList.map(({value})=>{ @@ -490,7 +502,7 @@ import {computeArea} from '@/common/utils' marker.value.onclick= this.onClick }) }, - addMarker({longitude,latitude},polyline){ + addMarker({longitude,latitude}){ var marker=new plus.maps.Marker(new plus.maps.Point(longitude, latitude)); marker.setIcon("/static/map_point_3.png"); marker.bringToTop() @@ -549,9 +561,10 @@ import {computeArea} from '@/common/utils' this.reComputArea() }else{ - this.markerList=[] - this.temp_markerList=[] + this.markerList=this.$defineArray([]) + this.temp_markerList=this.$defineArray([]) this.areaPolygon=null + polyline.setPath([]) this.maps.clearOverlays() }