safecheck-client 4.0.2-75 → 4.0.2-76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/android/PhoneUpUserinfo.vue +1249 -1249
- package/src/components/android/SafeRightTree.vue +218 -218
- package/src/components/android/SafecheckDevices.vue +1340 -1340
- package/src/components/android/week/CheckResultSimple.vue +258 -258
- package/src/components/android/week/FirstWeekCheck.vue +303 -303
- package/src/components/android/week/StepHeaderBar.vue +477 -477
- package/src/components/android/week/WeekCheck.vue +267 -267
- package/src/components/android/week/WeekCheckPaper.vue +274 -274
- package/src/components/android/week/WeekCheckPlan.vue +145 -145
- package/src/components/android/week/WeekCheckUserInfo.vue +99 -99
- package/src/components/pc/CheckBookArea.vue +146 -146
- package/src/components/pc/CheckBookCompany.vue +144 -144
- package/src/components/pc/CheckBookDetails.vue +161 -161
- package/src/components/pc/CheckBookEntry.vue +60 -60
- package/src/components/pc/CheckBookSearchArea.vue +560 -560
- package/src/components/pc/CheckBookSearchUnit.vue +229 -229
- package/src/components/pc/CheckBookSearchUserList.vue +674 -674
- package/src/filiale/meihekou/android/CheckPlanList.vue +198 -198
- package/src/filiale/meihekou/android/CheckPlanListArea.vue +190 -190
- package/src/filiale/meihekou/android/SafecheckDevices.vue +1343 -1343
- package/src/filiale/meihekou/android.js +22 -22
- package/src/filiale/yunchengminsheng/android/SafecheckOrderV.vue +2 -2
- package/src/filiale/yunchengminsheng/android/SafecheckUserInfo.vue +4 -0
- package/src/safecheck-android.js +330 -332
- package/src/assets/marker-default.png +0 -0
- package/src/assets/myLocationIcon.png +0 -0
- package/src/components/android/AppMapLocation.vue +0 -829
- package/src/components/android/AppMapPaper.vue +0 -83
|
@@ -1,829 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="flex main-div">
|
|
3
|
-
<div class="auto">
|
|
4
|
-
<div class="row" style="z-index: 1;margin-top: 1px" v-if="isshowsearch">
|
|
5
|
-
<div class="form-group has-feedback">
|
|
6
|
-
<input type="search" placeholder="输入关键字选取地点" v-model="searchModel"
|
|
7
|
-
autocomplete="off"
|
|
8
|
-
id="pickerInput"
|
|
9
|
-
class="form-control">
|
|
10
|
-
<svg t="1628961488010" class="icon form-control-feedback"
|
|
11
|
-
viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6775" width="48" height="48"><path d="M854.3 887.3c-9.3 0-18.1-3.6-24.8-10.3L628 675.5l-3.5 2.7c-21 16.5-44.1 30.1-68.8 40.6-37.4 15.8-77.1 23.8-118 23.8-40.9 0-80.6-8-118-23.8-36.1-15.3-68.5-37.1-96.3-64.9-27.8-27.8-49.7-60.2-64.9-96.3-15.8-37.4-23.8-77.1-23.8-118s8-80.6 23.8-118c15.3-36.1 37.1-68.5 64.9-96.3 27.8-27.8 60.2-49.7 96.3-64.9 37.4-15.8 77.1-23.8 118-23.8 40.9 0 80.6 8 118 23.8 36.1 15.3 68.5 37.1 96.3 64.9 27.8 27.8 49.7 60.2 64.9 96.3 15.8 37.4 23.8 77.1 23.8 118s-8 80.6-23.8 118c-9.7 23-22.2 44.7-37.2 64.5l-2.6 3.5 202 202c6.6 6.6 10.3 15.4 10.3 24.7 0 9.4-3.6 18.1-10.3 24.7-6.7 6.7-15.5 10.3-24.8 10.3zM437.7 206.7c-62.2 0-120.7 24.2-164.8 68.2-44 44-68.2 102.5-68.2 164.8 0 62.2 24.2 120.7 68.2 164.8 44 44 102.5 68.2 164.8 68.2 62.2 0 120.7-24.2 164.8-68.2 44-44 68.2-102.5 68.2-164.8S646.5 319 602.5 274.9c-44-44-102.5-68.2-164.8-68.2z" p-id="6776" fill="#707070"></path></svg>
|
|
12
|
-
</div>
|
|
13
|
-
</div>
|
|
14
|
-
<!--搜索联想 结果框-->
|
|
15
|
-
<!--<div class="row col-sm-12" v-if="isshowsearch" style="z-index: 1;" :style="{display:isShowSearchToTs}">
|
|
16
|
-
<div id="pickerOut" class="col-sm-12" @click="isShowSearchToTs='none'"></div>
|
|
17
|
-
</div>-->
|
|
18
|
-
</div>
|
|
19
|
-
<div class="table_sy" style="position:relative;">
|
|
20
|
-
<div :id="dom" class="row" style="flexGrow: 1" tabindex="0">
|
|
21
|
-
<!--地图绘制区域-->
|
|
22
|
-
</div>
|
|
23
|
-
</div>
|
|
24
|
-
<div class="auto">
|
|
25
|
-
<div class="row auto" v-if="isshowmapmodel">
|
|
26
|
-
<radio-group :value.sync="mapmodel" >
|
|
27
|
-
<radio value="dragMarker">地图拖拽</radio>
|
|
28
|
-
<radio value="dragMap">拖拽选点</radio>
|
|
29
|
-
</radio-group>
|
|
30
|
-
</div>
|
|
31
|
-
<div class="row auto " v-if="mylocationinfo">
|
|
32
|
-
<table class="table table-bordered table-hover">
|
|
33
|
-
<tr>
|
|
34
|
-
<td class="font_normal_body text-nowrap">经纬度 </td>
|
|
35
|
-
<td >经度:{{myLocation.position.lng}} 纬度:{{myLocation.position.lat}}</td>
|
|
36
|
-
</tr>
|
|
37
|
-
<tr>
|
|
38
|
-
<td class="font_normal_body text-nowrap">定位类型</td>
|
|
39
|
-
<td >{{myLocation.location_type}}</td>
|
|
40
|
-
</tr>
|
|
41
|
-
<tr>
|
|
42
|
-
<td class="font_normal_body text-nowrap">地址信息</td>
|
|
43
|
-
<td >{{myLocation.formattedAddress}}</td>
|
|
44
|
-
</tr>
|
|
45
|
-
</table>
|
|
46
|
-
</div>
|
|
47
|
-
</div>
|
|
48
|
-
</div>
|
|
49
|
-
</template>
|
|
50
|
-
|
|
51
|
-
<script>
|
|
52
|
-
const markerDefaultIcon = require('../../assets/marker-default.png')
|
|
53
|
-
const myico = require('../../assets/myLocationIcon.png')
|
|
54
|
-
import RadioGroup from 'vue-client/src/vue-strap/src/radioGroup'
|
|
55
|
-
import Radio from 'vue-client/src/vue-strap/src/radioBtn'
|
|
56
|
-
import {getSW, getNE} from 'vue-client/src/components/AMapComponents/AmapUtil.js'
|
|
57
|
-
|
|
58
|
-
export default {
|
|
59
|
-
title: '高德地图POI搜索拖拽选址组件,海量点显示组件',
|
|
60
|
-
components: {
|
|
61
|
-
RadioGroup,
|
|
62
|
-
Radio
|
|
63
|
-
},
|
|
64
|
-
props: {
|
|
65
|
-
// 定位成功后将定位到的位置作为地图中心点
|
|
66
|
-
locationzoomcenter: {
|
|
67
|
-
type: Boolean,
|
|
68
|
-
default:true
|
|
69
|
-
},
|
|
70
|
-
// 设置当前地图的视图位置 格式 {grade:15,lng:经度,lat:纬度} grade:取值范围1~15 代表不同等级的缩放比例
|
|
71
|
-
zoomcenter: {
|
|
72
|
-
type:Object,
|
|
73
|
-
default: null
|
|
74
|
-
},
|
|
75
|
-
//是否使用AndroidSDK进行定位 (手机端请设置为true否则会定位失败)
|
|
76
|
-
usenative:{
|
|
77
|
-
type:Boolean,
|
|
78
|
-
default: false
|
|
79
|
-
},
|
|
80
|
-
// 定位成功后是否打开当前位置详细信息框
|
|
81
|
-
locationwindow: {
|
|
82
|
-
type: Boolean,
|
|
83
|
-
default: true
|
|
84
|
-
},
|
|
85
|
-
// 海量点手机端 松开长按后是否关闭弹出框
|
|
86
|
-
massivemarkerphonepressclose:{
|
|
87
|
-
type: Boolean,
|
|
88
|
-
default: false
|
|
89
|
-
},
|
|
90
|
-
//地图组件ID 命名规则与JavaScript ID一致
|
|
91
|
-
dom:{
|
|
92
|
-
type: String,
|
|
93
|
-
default: ''
|
|
94
|
-
},
|
|
95
|
-
// 是否显示搜索框
|
|
96
|
-
isshowsearch: {
|
|
97
|
-
type: Boolean,
|
|
98
|
-
default: true
|
|
99
|
-
},
|
|
100
|
-
// 是否显示当前位置信息内容(div中)
|
|
101
|
-
mylocationinfo: {
|
|
102
|
-
type: Boolean,
|
|
103
|
-
default: true
|
|
104
|
-
},
|
|
105
|
-
// 定位当前位置成功后是否清楚页面的点
|
|
106
|
-
islocationclearmark:{
|
|
107
|
-
type: Boolean,
|
|
108
|
-
default: true
|
|
109
|
-
},
|
|
110
|
-
// 是否显示选择地图模式
|
|
111
|
-
isshowmapmodel: {
|
|
112
|
-
type: Boolean,
|
|
113
|
-
default: true
|
|
114
|
-
},
|
|
115
|
-
// 是否自动获取当前位置信息
|
|
116
|
-
islocation: {
|
|
117
|
-
type: Boolean,
|
|
118
|
-
default: true
|
|
119
|
-
},
|
|
120
|
-
// 搜索框的值
|
|
121
|
-
pickerinput: {
|
|
122
|
-
type: String,
|
|
123
|
-
default: ""
|
|
124
|
-
},
|
|
125
|
-
// 地图模式 (拖拽模式地图 dragMarker 和 拖拽选点模式 dragMap)
|
|
126
|
-
mapmodel: {
|
|
127
|
-
type: String,
|
|
128
|
-
default: 'dragMarker'
|
|
129
|
-
},
|
|
130
|
-
// 自定义结果回显的id
|
|
131
|
-
searchpoiresult: {
|
|
132
|
-
type: String,
|
|
133
|
-
default: ""
|
|
134
|
-
},
|
|
135
|
-
// 传递来的海量点集 (点集模式 会自动将 地图模式为设置为 拖拽地图模式dragMarker)
|
|
136
|
-
/**
|
|
137
|
-
*
|
|
138
|
-
*[
|
|
139
|
-
* {
|
|
140
|
-
* "lnglat": [116.258446, 37.686622], (点位置)
|
|
141
|
-
* "content": "显示的内容可以是html标签", (显示的内容)
|
|
142
|
-
* "item": { 任意值(点击点后携带出去)
|
|
143
|
-
* "name": "用户名",
|
|
144
|
-
* "userinfoid": "用户id",
|
|
145
|
-
* }
|
|
146
|
-
* }
|
|
147
|
-
*]
|
|
148
|
-
*/
|
|
149
|
-
/*inputmarksarray: {
|
|
150
|
-
type: Array,
|
|
151
|
-
default: []
|
|
152
|
-
},*/
|
|
153
|
-
inputmarksarray: {
|
|
154
|
-
type: Array,
|
|
155
|
-
default: ()=>[]
|
|
156
|
-
},
|
|
157
|
-
// 海量点显示样式
|
|
158
|
-
markstyle: {
|
|
159
|
-
type: Array,
|
|
160
|
-
default: ()=>[{
|
|
161
|
-
url: 'https://a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png', //图标URL
|
|
162
|
-
anchor: new AMap.Pixel(6, 6), // 图标偏移位置
|
|
163
|
-
size: new AMap.Size(20, 30) //图标大小
|
|
164
|
-
}]
|
|
165
|
-
},
|
|
166
|
-
// {
|
|
167
|
-
// data: {data:'随意内容1',label:'label标题',content:'鼠标放上去显示的内容信息框'}, // 必填
|
|
168
|
-
// position:[233.111,39.333], //经纬度 必填
|
|
169
|
-
// --------------------------------------------以下信息是非必填的选填--------------------------------------------------------
|
|
170
|
-
// ismoseOpen:true,//是否通过鼠标滑过打开信息框 true ,false
|
|
171
|
-
// isclearmarker:false,//是否重新渲染新点时就清除页面所有点 true false 也可以手动去调用 this.map.clearMap(); 该方法属于map地图对象
|
|
172
|
-
// ismobiletouchendclear:true 手机端长按点后是否松开后关闭弹出的信息框 (ismoseOpen为true并且ismobiletouchendclear为true移动端才会在松开后关闭信息框,当你不想在松开后关闭信息框时请将ismobiletouchendclear设置为false)
|
|
173
|
-
// islabel:true, //是否渲染label标注(标注与信息框不同,信息框全局只有唯一一个)
|
|
174
|
-
// //icon:'' //点位置处显示的图标 可以是url
|
|
175
|
-
// }
|
|
176
|
-
//渲染带label的简单点集(多点勿用-多点请使用海量点)
|
|
177
|
-
labelmarksarray:{
|
|
178
|
-
type:Array,
|
|
179
|
-
default:()=>[]
|
|
180
|
-
},
|
|
181
|
-
|
|
182
|
-
},
|
|
183
|
-
data() {
|
|
184
|
-
return {
|
|
185
|
-
map: null, // 显示地图实例
|
|
186
|
-
searchModel: this.pickerinput, //输入框搜索的值
|
|
187
|
-
myLocation: {
|
|
188
|
-
position: { //经纬度信息
|
|
189
|
-
lng: 0, //经度
|
|
190
|
-
lat: 0 //纬度
|
|
191
|
-
},
|
|
192
|
-
location_type: '', //定位类型
|
|
193
|
-
formattedAddress: '' //地址信息
|
|
194
|
-
},
|
|
195
|
-
isShowSearchToTs: "none", //是否显示搜索联想
|
|
196
|
-
toolbar: null,
|
|
197
|
-
positionPickerDrag: null, //拖拽选址poi对象
|
|
198
|
-
markerList: [], //点标记集合
|
|
199
|
-
myMarker: null, //当前位置的标记点
|
|
200
|
-
massMarks: null, //海量点对象
|
|
201
|
-
poiPicker: null, //POI搜索对象
|
|
202
|
-
}
|
|
203
|
-
},
|
|
204
|
-
methods: {
|
|
205
|
-
// 初始化地图相关
|
|
206
|
-
initAmap() {
|
|
207
|
-
var thas = this
|
|
208
|
-
// 初始化地图组件
|
|
209
|
-
this.map = new AMap.Map(thas.dom, {
|
|
210
|
-
zoom: 12,
|
|
211
|
-
resizeEnable: true, // 如果center属性缺省,地图默认定位到用户所在城市的中心
|
|
212
|
-
viewMode: '2D', //设置地图模式
|
|
213
|
-
lang: 'zh_cn', //设置地图语言类型
|
|
214
|
-
zindex: 99999
|
|
215
|
-
});
|
|
216
|
-
AMap.Event.addListener(this.map, "complete",this.mapInitSuccess());
|
|
217
|
-
window.map = this.map
|
|
218
|
-
// 异步加载地图插件
|
|
219
|
-
AMap.plugin(
|
|
220
|
-
['AMap.ToolBar','AMap.Driving','AMap.Geolocation','AMap.PlaceSearch'], () => {
|
|
221
|
-
//异步加载插件
|
|
222
|
-
if (thas.islocation) {
|
|
223
|
-
// 自动定位插件
|
|
224
|
-
var geolocation = new AMap.Geolocation({
|
|
225
|
-
// 是否使用高精度定位,默认:true
|
|
226
|
-
enableHighAccuracy: true,
|
|
227
|
-
//控制按钮的显示
|
|
228
|
-
showbutton: true,
|
|
229
|
-
// 设置定位超时时间,默认:无穷大 1000
|
|
230
|
-
timeout: 1000,
|
|
231
|
-
// 定位按钮的停靠位置的偏移量,默认:Pixel(10, 20)
|
|
232
|
-
buttonOffset: new AMap.Pixel(20, 30),
|
|
233
|
-
zoomToAccuracy: false, //定位成功后调整地图视野范围使定位位置及精度范围视野内可见,默认:false
|
|
234
|
-
buttonPosition: 'RB', // 定位按钮的排放位置, RB表示右下
|
|
235
|
-
showMarker: false, //定位成功后在定位到的位置显示点标记,默认:true
|
|
236
|
-
showCircle: true, //定位成功后用圆圈表示定位精度范围,默认:true
|
|
237
|
-
panToLocation: false, //定位成功后将定位到的位置作为地图中心点,默认:true
|
|
238
|
-
/*markerOptions:{//自定义定位点样式,同Marker的Options
|
|
239
|
-
'offset': new AMap.Pixel(-10, -15),
|
|
240
|
-
'content':'<img src="'+myico+'"/>'
|
|
241
|
-
},*/
|
|
242
|
-
useNative: thas.usenative, //是否使用安卓定位sdk用来进行定位,默认:false
|
|
243
|
-
})
|
|
244
|
-
thas.map.addControl(geolocation)
|
|
245
|
-
geolocation.getCurrentPosition();
|
|
246
|
-
AMap.Event.addListener(geolocation, "complete", thas.onComplete);
|
|
247
|
-
AMap.Event.addListener(geolocation, "error", thas.onError);
|
|
248
|
-
}
|
|
249
|
-
})
|
|
250
|
-
},
|
|
251
|
-
mapInitSuccess(){
|
|
252
|
-
//地图加载成功回调
|
|
253
|
-
console.log("地图加载成功回调")
|
|
254
|
-
this.$emit('initamapsuc')
|
|
255
|
-
},
|
|
256
|
-
// 定位成功回调
|
|
257
|
-
onComplete(res) {
|
|
258
|
-
let thas = this
|
|
259
|
-
if (thas.positionPickerDrag == null) {
|
|
260
|
-
thas.poiPickerDropReady()
|
|
261
|
-
thas.positionPickerDrag.setMode(thas.mapmodel) //设置地图模式到拖拽选址组件
|
|
262
|
-
}else {
|
|
263
|
-
thas.positionPickerDrag.setMode(thas.mapmodel) //设置地图模式到拖拽选址组件
|
|
264
|
-
}
|
|
265
|
-
console.log(`定位成功` + JSON.stringify(res))
|
|
266
|
-
let content = ''
|
|
267
|
-
content += `<div style="padding:0px 0px 0px 4px"><b>我的位置</b></div>`
|
|
268
|
-
content += `地址:${res.formattedAddress}`
|
|
269
|
-
thas.showMarkInfoWindow(content, res.position) //显示窗口信息
|
|
270
|
-
// 是否回到当前位置
|
|
271
|
-
if (this.locationzoomcenter) {
|
|
272
|
-
console.log("定位成功,将地图中心点设置为当前位置")
|
|
273
|
-
thas.setZommAndCenterView(15,res.position.lng,res.position.lat)
|
|
274
|
-
}
|
|
275
|
-
if (this.islocationclearmark) {
|
|
276
|
-
console.log("回到当前位置,清理当前地图所有覆盖物")
|
|
277
|
-
thas.map.clearMap(); // 清除地图覆盖物
|
|
278
|
-
}
|
|
279
|
-
if (thas.myMarker) {
|
|
280
|
-
thas.map.remove(thas.myMarker)
|
|
281
|
-
thas.myMarker = null
|
|
282
|
-
}
|
|
283
|
-
// 为当前位置添加标记
|
|
284
|
-
var marker = new AMap.Marker({
|
|
285
|
-
position: res.position, // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9]
|
|
286
|
-
offset: new AMap.Pixel(-15, -35),
|
|
287
|
-
icon: myico, // 添加 Icon 图标 URL
|
|
288
|
-
});
|
|
289
|
-
|
|
290
|
-
thas.map.add(marker);
|
|
291
|
-
// 设置点标记的动画效果,此处为弹跳效果
|
|
292
|
-
// marker.setAnimation('AMAP_ANIMATION_BOUNCE');
|
|
293
|
-
this.myMarker = marker
|
|
294
|
-
// 对marker绑定点击时事件
|
|
295
|
-
AMap.Event.addListener(marker, 'click', mkOnclick);
|
|
296
|
-
|
|
297
|
-
function mkOnclick(result) {
|
|
298
|
-
console.log("事件触发")
|
|
299
|
-
thas.showMarkInfoWindow( content, res.position)
|
|
300
|
-
}
|
|
301
|
-
// 回写当前位置数据
|
|
302
|
-
thas.myLocation = {
|
|
303
|
-
position: { //经纬度信息
|
|
304
|
-
lng: res.position.lng, //经度
|
|
305
|
-
lat: res.position.lat //纬度
|
|
306
|
-
},
|
|
307
|
-
location_type: res.location_type, //定位类型
|
|
308
|
-
formattedAddress: res.formattedAddress, //地址信息
|
|
309
|
-
city: res.addressComponent //城市信息
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
//定位成功
|
|
313
|
-
thas.$emit('locationsuccess',thas.myLocation)
|
|
314
|
-
},
|
|
315
|
-
//定位失败回调
|
|
316
|
-
onError(res) {
|
|
317
|
-
console.log(`定位失败` + JSON.stringify(res))
|
|
318
|
-
AMap.plugin("AMap.CitySearch", function () {
|
|
319
|
-
var citySearch = new AMap.CitySearch();
|
|
320
|
-
citySearch.getLocalCity(function (status, result) {
|
|
321
|
-
if (status === "complete" && result.info === "OK") {
|
|
322
|
-
// 查询成功,result即为当前所在城市信息
|
|
323
|
-
console.log(result);
|
|
324
|
-
AMap.plugin("AMap.Geocoder", function () {
|
|
325
|
-
var geocoder = new AMap.Geocoder({
|
|
326
|
-
// city 指定进行编码查询的城市,支持传入城市名、adcode 和 citycode
|
|
327
|
-
city: result.adcode,
|
|
328
|
-
});
|
|
329
|
-
var lnglat = result.rectangle.split(";")[0].split(",");
|
|
330
|
-
geocoder.getAddress(lnglat, function (status, data) {
|
|
331
|
-
if (status === "complete" && data.info === "OK") {
|
|
332
|
-
// result为对应的地理位置详细信息
|
|
333
|
-
console.log(data);
|
|
334
|
-
}
|
|
335
|
-
});
|
|
336
|
-
});
|
|
337
|
-
}
|
|
338
|
-
});
|
|
339
|
-
});
|
|
340
|
-
// this.$showMessage("定位失败,请检查权限信息后重试")
|
|
341
|
-
},
|
|
342
|
-
// 初始化poi搜索
|
|
343
|
-
poiPickerReady() {
|
|
344
|
-
console.log("===========开始判断设备类型=")
|
|
345
|
-
var _than = this
|
|
346
|
-
AMapUI.loadUI(['misc/PoiPicker'], (PoiPicker) => {
|
|
347
|
-
_than.poiPicker = new PoiPicker({
|
|
348
|
-
//city:'北京',
|
|
349
|
-
input: 'pickerInput',
|
|
350
|
-
// suggestContainer: 'pickerOut' // 结果展示的id
|
|
351
|
-
});
|
|
352
|
-
if (!_than.poiPicker) {
|
|
353
|
-
_than.poiPickerReady()
|
|
354
|
-
}
|
|
355
|
-
let marker = new AMap.Marker(); //点标记
|
|
356
|
-
//选取了某个POI
|
|
357
|
-
_than.poiPicker.on('poiPicked', (poiResult) => {
|
|
358
|
-
var source = poiResult.source,
|
|
359
|
-
poi = poiResult.item;
|
|
360
|
-
console.log("当前poi定位信息"+JSON.stringify(poiResult))
|
|
361
|
-
_than.myLocation = {
|
|
362
|
-
position: { //经纬度信息
|
|
363
|
-
lng: poi.location.lng, //经度
|
|
364
|
-
lat: poi.location.lat //纬度
|
|
365
|
-
},
|
|
366
|
-
location_type: 'poi', //定位类型
|
|
367
|
-
formattedAddress: `${poi.district!==undefined ?poi.district:""}${poi.address!==undefined?poi.address:""}${poi.name!==undefined?poi.name:""}`
|
|
368
|
-
}
|
|
369
|
-
_than.map.clearMap(); //清楚地图上所有的marks (清楚点标记)
|
|
370
|
-
marker.setMap(_than.map); //设置点标记的地图对象
|
|
371
|
-
marker.setPosition(poi.location);
|
|
372
|
-
_than.searchModel = "" // 将poi返回的地址赋值给搜索地址栏
|
|
373
|
-
_than.map.setCenter(poi.location);
|
|
374
|
-
});
|
|
375
|
-
window.poiPicker = _than.poiPicker;
|
|
376
|
-
/*poiPicker.onCityReady(() => {
|
|
377
|
-
poiPicker.suggest('小区');
|
|
378
|
-
});*/
|
|
379
|
-
});
|
|
380
|
-
|
|
381
|
-
},
|
|
382
|
-
// PC端中可用 地图中鼠标右键
|
|
383
|
-
contextRightKeyMenu() {
|
|
384
|
-
//创建右键菜单
|
|
385
|
-
var contextMenu = new AMap.ContextMenu();
|
|
386
|
-
//右键放大
|
|
387
|
-
contextMenu.addItem("放大一级", () => {
|
|
388
|
-
this.map.zoomIn();
|
|
389
|
-
}, 0);
|
|
390
|
-
//右键缩小
|
|
391
|
-
contextMenu.addItem("缩小一级", () => {
|
|
392
|
-
this.map.zoomOut();
|
|
393
|
-
}, 1);
|
|
394
|
-
//右键显示全国范围
|
|
395
|
-
contextMenu.addItem("缩放至全国范围", (e) => {
|
|
396
|
-
this.map.setZoomAndCenter(4, [108.946609, 34.262324]);
|
|
397
|
-
}, 2);
|
|
398
|
-
//右键添加Marker标记
|
|
399
|
-
contextMenu.addItem("添加标记", (e) => {
|
|
400
|
-
var marker = new AMap.Marker({
|
|
401
|
-
map: this.map,
|
|
402
|
-
position: contextMenu.contextMenuPositon || this.map.getCenter()
|
|
403
|
-
});
|
|
404
|
-
this.markerList.push(marker)
|
|
405
|
-
}, 3);
|
|
406
|
-
//地图绑定鼠标右击事件——弹出右键菜单
|
|
407
|
-
this.map.on('rightclick', (e) => {
|
|
408
|
-
contextMenu.contextMenuPositon = e.lnglat; //右键菜单位置
|
|
409
|
-
contextMenu.open(this.map, e.lnglat);
|
|
410
|
-
});
|
|
411
|
-
},
|
|
412
|
-
// 拖拽选址
|
|
413
|
-
poiPickerDropReady() {
|
|
414
|
-
let _than = this;
|
|
415
|
-
//加载PositionPicker,loadUI的路径参数为模块名中 'ui/' 之后的部分
|
|
416
|
-
AMapUI.loadUI(['misc/PositionPicker'], (PositionPicker) => {
|
|
417
|
-
_than.positionPickerDrag = new PositionPicker({
|
|
418
|
-
mode: _than.mapmodel,//设定为拖拽地图模式,可选'dragMap'、'dragMarker',默认为'dragMarker'
|
|
419
|
-
map: _than.map//依赖地图对象
|
|
420
|
-
});
|
|
421
|
-
_than.positionPickerDrag.on('success', (positionResult) => {
|
|
422
|
-
_than.dragMapSuccessSuces(positionResult)
|
|
423
|
-
});
|
|
424
|
-
_than.positionPickerDrag.on('fail', (positionResult) => {
|
|
425
|
-
_than.dragMapSuccessFul(positionResult)
|
|
426
|
-
});
|
|
427
|
-
// 地图模式 (拖拽模式地图 dragMarker 和 拖拽选点模式 dragMap)
|
|
428
|
-
if (_than.mapmodel === 'dragMap'){
|
|
429
|
-
_than.openDragMap() //开启拖拽选点
|
|
430
|
-
}else {
|
|
431
|
-
_than.closeDragMap() // 关闭拖拽选点
|
|
432
|
-
}
|
|
433
|
-
});
|
|
434
|
-
},
|
|
435
|
-
// 拖拽选址成功事件
|
|
436
|
-
dragMapSuccessSuces(res) {
|
|
437
|
-
// console.log("==拖拽选址==" + JSON.stringify(res))
|
|
438
|
-
// 回写当前位置数据
|
|
439
|
-
this.myLocation = {
|
|
440
|
-
position: { //经纬度信息
|
|
441
|
-
lng: res.position.lng, //经度
|
|
442
|
-
lat: res.position.lat //纬度
|
|
443
|
-
},
|
|
444
|
-
location_type: "拖拽选点", //定位类型
|
|
445
|
-
formattedAddress: res.address //地址信息
|
|
446
|
-
}
|
|
447
|
-
this.$emit("dragsuccess",this.myLocation)
|
|
448
|
-
},
|
|
449
|
-
// 拖拽选址失败事件
|
|
450
|
-
dragMapSuccessFul(res) {
|
|
451
|
-
console.log("飞天了!");
|
|
452
|
-
this.myLocation = {
|
|
453
|
-
position: { //经纬度信息
|
|
454
|
-
lng: 0, //经度
|
|
455
|
-
lat: 0 //纬度
|
|
456
|
-
},
|
|
457
|
-
location_type: '', //定位类型
|
|
458
|
-
formattedAddress: '' //地址信息
|
|
459
|
-
}
|
|
460
|
-
this.$emit("dragerror",this.myLocation)
|
|
461
|
-
},
|
|
462
|
-
// 关闭拖拽选址
|
|
463
|
-
closeDragMap() {
|
|
464
|
-
console.log("关闭拖拽选址")
|
|
465
|
-
this.positionPickerDrag.stop()
|
|
466
|
-
},
|
|
467
|
-
// 打开拖拽选址
|
|
468
|
-
openDragMap() {
|
|
469
|
-
console.log("打开拖拽选址")
|
|
470
|
-
this.positionPickerDrag.start()
|
|
471
|
-
},
|
|
472
|
-
/**
|
|
473
|
-
* 简单信息框窗体
|
|
474
|
-
* @param _content 显示的内容 可以为html 页面
|
|
475
|
-
* @param _position 点位置信息 AMap.LngLat(lng:Number,lat:Number)
|
|
476
|
-
* @param _offset 位置偏移 格式 new AMap.Pixel(0, -20)
|
|
477
|
-
*/
|
|
478
|
-
showMarkInfoWindow(_content, _position, _offset = new AMap.Pixel(1, -45)) {
|
|
479
|
-
// 信息窗体的内容
|
|
480
|
-
// 创建 infoWindow 实例
|
|
481
|
-
var infoWindow = new AMap.InfoWindow({
|
|
482
|
-
content: _content,
|
|
483
|
-
offset: _offset
|
|
484
|
-
});
|
|
485
|
-
if (this.locationwindow) {
|
|
486
|
-
// 打开信息窗体
|
|
487
|
-
infoWindow.open(this.map, _position);
|
|
488
|
-
}
|
|
489
|
-
},
|
|
490
|
-
/**
|
|
491
|
-
* 关闭信息窗体
|
|
492
|
-
*/
|
|
493
|
-
closeInfoWindow() {
|
|
494
|
-
this.map.clearInfoWindow();
|
|
495
|
-
},
|
|
496
|
-
/**
|
|
497
|
-
* 自定义点标记 在那个地图 什么图片 在哪标记
|
|
498
|
-
* @param _img 点标记图片
|
|
499
|
-
* @param _position 点标记位置
|
|
500
|
-
*/
|
|
501
|
-
showMarkerSpot(_img = markerDefaultIcon, _position) {
|
|
502
|
-
var marker = new AMap.Marker({
|
|
503
|
-
position: _position,
|
|
504
|
-
icon: _img,
|
|
505
|
-
offset: new AMap.Pixel(-13, -30)
|
|
506
|
-
});
|
|
507
|
-
|
|
508
|
-
this.markerList.push(marker)
|
|
509
|
-
marker.setMap(this.map);
|
|
510
|
-
},
|
|
511
|
-
|
|
512
|
-
/**
|
|
513
|
-
*自定义点标记与简单信息框和标注
|
|
514
|
-
* @param _data 传入内容 {"data":"随意内容","label":"标注显示的值可以为html标签","content":"信息框显示的内容可以为html标签"}
|
|
515
|
-
* @param _position 点标记位置 格式 [经度,纬度]
|
|
516
|
-
* @param _ismoseOpen 是否通过鼠标滑过打开信息框 true false
|
|
517
|
-
* @param _isclearmarker 是否重新渲染新点时就清除页面所有点 true false 也可以手动去调用 this.map.clearMap(); 该方法属于map地图对象
|
|
518
|
-
* @param _ismobiletouchendclear 手机端长按点后是否松开后关闭弹出的信息框 (_ismoseOpen为true并且_ismobiletouchendclear为true移动端才会在松开后关闭信息框,当你不想在松开后关闭信息框时请将_ismobiletouchendclear设置为false)
|
|
519
|
-
* @param _islabel 是否渲染label 标注(标注与信息框不同,信息框全局只有唯一一个)
|
|
520
|
-
* @param _icon 点位置处显示的图标 可以是url,也可以使用require 引入图片
|
|
521
|
-
* @param _contextOffset 信息框内容位置偏移 格式 new AMap.Pixel(0, -20)
|
|
522
|
-
* @param _laberOffset lable 内容偏移 格式 new AMap.Pixel(0, -20)
|
|
523
|
-
*/
|
|
524
|
-
showWindowInfoAndSpot
|
|
525
|
-
(_data,_position,_ismoseOpen=true,_isclearmarker=true,_ismobiletouchendclear=true,
|
|
526
|
-
_islabel=true,
|
|
527
|
-
_icon=markerDefaultIcon,
|
|
528
|
-
_contextOffset=new AMap.Pixel(0, -30),
|
|
529
|
-
_laberOffset=new AMap.Pixel(-5, -3))
|
|
530
|
-
{
|
|
531
|
-
if (_isclearmarker) {
|
|
532
|
-
this.map.clearMap();
|
|
533
|
-
}
|
|
534
|
-
var marker = new AMap.Marker({
|
|
535
|
-
position: _position,
|
|
536
|
-
icon: _icon,
|
|
537
|
-
map: this.map
|
|
538
|
-
});
|
|
539
|
-
if (_islabel){
|
|
540
|
-
marker.setLabel({
|
|
541
|
-
content: '<div class="tooltips-amp-diy">'+_data.label+'</div>', //设置文本标注内容
|
|
542
|
-
direction: 'top', //设置文本标注方位
|
|
543
|
-
offset: _laberOffset, //设置文本标注偏移量
|
|
544
|
-
});
|
|
545
|
-
}
|
|
546
|
-
this.markerList.push(marker)
|
|
547
|
-
var infoWindow = new AMap.InfoWindow({
|
|
548
|
-
offset: _contextOffset
|
|
549
|
-
});
|
|
550
|
-
if (!/(iPhone|iPad|iPod|iOS|Android)/i.test(navigator.userAgent)) {
|
|
551
|
-
// 鼠标移动到点触发
|
|
552
|
-
AMap.Event.addListener(marker, 'mouseover', (row) => {
|
|
553
|
-
// 打开信息窗体
|
|
554
|
-
if (_ismoseOpen) {
|
|
555
|
-
infoWindow.setContent(_data.content)
|
|
556
|
-
infoWindow.open(this.map, _position);
|
|
557
|
-
}
|
|
558
|
-
console.log("触发鼠标选中事件" + _data.data)
|
|
559
|
-
this.$emit("diyspotmouseover", _data.data)
|
|
560
|
-
})
|
|
561
|
-
// 鼠标离开改点触发
|
|
562
|
-
AMap.Event.addListener(marker, 'mouseout', (row) => {
|
|
563
|
-
// 关闭信息窗体
|
|
564
|
-
if (_ismoseOpen) {
|
|
565
|
-
infoWindow.close();
|
|
566
|
-
}
|
|
567
|
-
console.log("触发鼠标离开事件" + _data.data)
|
|
568
|
-
this.$emit("diyspotmouseout", _data.data)
|
|
569
|
-
})
|
|
570
|
-
|
|
571
|
-
} else {
|
|
572
|
-
// 触摸开始时触发事件,仅适用移动设备
|
|
573
|
-
AMap.Event.addListener(marker, 'touchstart', (row) => {
|
|
574
|
-
// 打开信息窗体
|
|
575
|
-
if (_ismoseOpen) {
|
|
576
|
-
infoWindow.setContent(_data.content)
|
|
577
|
-
infoWindow.open(this.map, _position);
|
|
578
|
-
}
|
|
579
|
-
console.log("触摸开始时触发事件" + _data.data)
|
|
580
|
-
this.$emit("diyspottouchstart", _data.data)
|
|
581
|
-
})
|
|
582
|
-
// 触摸结束触发
|
|
583
|
-
AMap.Event.addListener(marker, 'touchend', (row) => {
|
|
584
|
-
|
|
585
|
-
// 关闭信息窗体 (移动端长按时间离开后触发)
|
|
586
|
-
if (_ismoseOpen) {
|
|
587
|
-
if(_ismobiletouchendclear) {
|
|
588
|
-
infoWindow.close();
|
|
589
|
-
}
|
|
590
|
-
}else
|
|
591
|
-
console.log("触摸结束时触发事件," + _data.data)
|
|
592
|
-
this.$emit("diyspottouchover", _data.data)
|
|
593
|
-
})
|
|
594
|
-
}
|
|
595
|
-
// 鼠标点击触发
|
|
596
|
-
AMap.Event.addListener(marker, 'click', (row) => {
|
|
597
|
-
this.$emit("diyspotmouseclick", _data.data)
|
|
598
|
-
})
|
|
599
|
-
this.map.setFitView();
|
|
600
|
-
},
|
|
601
|
-
|
|
602
|
-
/**
|
|
603
|
-
* 将海量点集显示在地图上,海量点设计使用在PC端,如要显示少量点,请使用showMarkInfoWindow
|
|
604
|
-
*/
|
|
605
|
-
showMarkerList() {
|
|
606
|
-
this.clearMarkerList()
|
|
607
|
-
this.map.clearMap(); //清楚地图上所有的marks (清楚点标记)
|
|
608
|
-
this.massMarks = new AMap.MassMarks(this.inputmarksarray, {
|
|
609
|
-
opacity: 0.8, // 图层的透明度,取值范围[0,1],1代表完全不透明,0代表完全透明
|
|
610
|
-
zIndex: 111, //图层叠加的顺序值,0表示最底层。默认zIndex:5
|
|
611
|
-
cursor: 'pointer', //指定鼠标悬停时的鼠标样式,自定义cursor,IE仅支持cur/ani/ico格式,Opera不支持自定义cursor
|
|
612
|
-
style: this.markstyle
|
|
613
|
-
});
|
|
614
|
-
|
|
615
|
-
// 信息窗体的内容
|
|
616
|
-
// 创建 infoWindow 实例
|
|
617
|
-
var infoWindow = new AMap.InfoWindow({
|
|
618
|
-
content: " ",
|
|
619
|
-
offset: new AMap.Pixel(1, -20)
|
|
620
|
-
});
|
|
621
|
-
if (!/(iPhone|iPad|iPod|iOS|Android)/i.test(navigator.userAgent)) {
|
|
622
|
-
// 鼠标移动上去的事件
|
|
623
|
-
this.massMarks.on('mouseover', (e)=>{
|
|
624
|
-
console.log("鼠标移动上去"+JSON.stringify(e.data.lnglat))
|
|
625
|
-
infoWindow.setContent(e.data.content)
|
|
626
|
-
infoWindow.open(this.map, e.data.lnglat);
|
|
627
|
-
this.$emit('inputmarkarraymouseover',e.data) //海量点鼠标入
|
|
628
|
-
});
|
|
629
|
-
// 鼠标移出
|
|
630
|
-
this.massMarks.on('mouseout', (e)=>{
|
|
631
|
-
console.log("鼠标离开"+JSON.stringify(e.data.lnglat))
|
|
632
|
-
infoWindow.close()
|
|
633
|
-
this.$emit('inputmarkarraymouseout',e.data) //海量点鼠标出
|
|
634
|
-
});
|
|
635
|
-
}else {
|
|
636
|
-
// 触摸开始时触发事件,仅适用移动设备,
|
|
637
|
-
this.massMarks.on('touchstart', (e)=>{
|
|
638
|
-
console.log("触摸开始时触发事件"+JSON.stringify(e.data.lnglat))
|
|
639
|
-
infoWindow.setContent(e.data.content)
|
|
640
|
-
infoWindow.open(this.map, e.data.lnglat);
|
|
641
|
-
this.$emit('inputmarkarraytouchstart',e.data) //海量点触摸
|
|
642
|
-
});
|
|
643
|
-
// 触摸结束时触发事件,仅适用移动设备,
|
|
644
|
-
this.massMarks.on('touchend', (e)=>{
|
|
645
|
-
console.log("触摸结束时触发事件"+JSON.stringify(e.data.lnglat))
|
|
646
|
-
if (this.simplemarkerphonepressclose) {
|
|
647
|
-
infoWindow.close()
|
|
648
|
-
}
|
|
649
|
-
this.$emit('inputmarkarraytouchend',e.data) //海量点结束触摸
|
|
650
|
-
});
|
|
651
|
-
}
|
|
652
|
-
/**
|
|
653
|
-
* 海量点的点击事件 当渲染出海量点后点击某个点触发此方法 回调
|
|
654
|
-
*/
|
|
655
|
-
this.massMarks.on("click", (e) => {
|
|
656
|
-
console.log("当前点的信息"+JSON.stringify(e.data))
|
|
657
|
-
this.$emit("rowmarkerclick",e.data)
|
|
658
|
-
});
|
|
659
|
-
|
|
660
|
-
this.massMarks.setMap(this.map);
|
|
661
|
-
const sw = getSW(this.inputmarksarray) // 循环所有的点标记,返回最西南的一个经纬度
|
|
662
|
-
const ne = getNE(this.inputmarksarray) // 循环所有的点标记,返回最东北的一个经纬度
|
|
663
|
-
console.log('GET BOUNDS', sw, ne) // [xxx,xxx], [xxx,xxx]
|
|
664
|
-
let mybounds = new AMap.Bounds(sw, ne)
|
|
665
|
-
this.map.setBounds(mybounds)
|
|
666
|
-
},
|
|
667
|
-
/**
|
|
668
|
-
* 清楚海量点
|
|
669
|
-
*/
|
|
670
|
-
clearMarkerList(){
|
|
671
|
-
if (this.massMarks != null){
|
|
672
|
-
this.massMarks.clear()
|
|
673
|
-
}else {
|
|
674
|
-
console.log("当前未初始化海量点")
|
|
675
|
-
}
|
|
676
|
-
},
|
|
677
|
-
/***
|
|
678
|
-
* 渲染多个点标记与简单信息卡和标注
|
|
679
|
-
*/
|
|
680
|
-
showLabelMarksArray(){
|
|
681
|
-
if (this.labelmarksarray){
|
|
682
|
-
let _date_ = {}
|
|
683
|
-
for (let labelitem of this.labelmarksarray) {
|
|
684
|
-
let labelconfig = ["data","position","ismoseOpen","isclearmarker","ismobiletouchendclear","islabel","icon"]
|
|
685
|
-
for (let labelconfigKey of labelconfig) {
|
|
686
|
-
if(labelitem.hasOwnProperty(labelconfigKey)){
|
|
687
|
-
_date_[labelconfigKey] = labelitem[labelconfigKey]
|
|
688
|
-
}
|
|
689
|
-
}
|
|
690
|
-
this.showWindowInfoAndSpot(_date_.data,_date_.position,_date_.ismoseOpen,_date_.isclearmarker,_date_.ismobiletouchendclear,_date_.islabel,_date_.icon)
|
|
691
|
-
}
|
|
692
|
-
}
|
|
693
|
-
},
|
|
694
|
-
/**
|
|
695
|
-
* 让地图中心位置视图转移 显示在某个经纬度
|
|
696
|
-
*_grade:等级1~15 缩放等级 全国~街道
|
|
697
|
-
*/
|
|
698
|
-
setZommAndCenterView (_grade,_lng,_lat) {
|
|
699
|
-
this.map.setZoomAndCenter(_grade,[_lng, _lat])
|
|
700
|
-
this.map.getCenter();
|
|
701
|
-
},
|
|
702
|
-
|
|
703
|
-
},
|
|
704
|
-
watch: {
|
|
705
|
-
// 当传入的中心地图位置变化
|
|
706
|
-
|
|
707
|
-
zoomcenter: {
|
|
708
|
-
handler:function(newV,oldV){
|
|
709
|
-
if (newV) {
|
|
710
|
-
this.$nextTick(()=>{
|
|
711
|
-
this.setZommAndCenterView(this.zoomcenter.grade,this.zoomcenter.lng,this.zoomcenter.lat)
|
|
712
|
-
})
|
|
713
|
-
}
|
|
714
|
-
},
|
|
715
|
-
deep:true
|
|
716
|
-
},
|
|
717
|
-
pickerinput: function () {
|
|
718
|
-
console.log("搜索关键字变化")
|
|
719
|
-
this.searchModel = this.pickerinput
|
|
720
|
-
},
|
|
721
|
-
searchModel: function () {
|
|
722
|
-
if (this.searchModel != undefined && this.searchModel.trim() != "") {
|
|
723
|
-
this.isShowSearchToTs = "block"
|
|
724
|
-
} else {
|
|
725
|
-
this.isShowSearchToTs = "none"
|
|
726
|
-
}
|
|
727
|
-
},
|
|
728
|
-
mapmodel: function () { // (拖拽模式地图 dragMarker 和 拖拽选点模式 dragMap)
|
|
729
|
-
this.map.clearMap(); //清楚地图上所有的marks (清楚点标记)
|
|
730
|
-
if (this.mapmodel === 'dragMap') {
|
|
731
|
-
console.log("当前地图模式为dragMap(拖拽选点)打开拖拽选单功能")
|
|
732
|
-
this.openDragMap(); //开启拖拽选点
|
|
733
|
-
this.clearMarkerList();//清楚海量点
|
|
734
|
-
} else if (this.mapmodel === 'dragMarker') {
|
|
735
|
-
console.log("当前地图模式为dragMarker(地图拖拽)关闭拖拽选点功能")
|
|
736
|
-
this.closeDragMap(); //关闭拖拽选点
|
|
737
|
-
this.clearMarkerList();//清楚海量点
|
|
738
|
-
this.map.clearMap(); //清楚地图上所有的marks (清楚点标记)
|
|
739
|
-
}
|
|
740
|
-
// 当页面中地图模式变化,就将地图模式设置到poi对象中
|
|
741
|
-
if (this.mapmodel !== '' && this.mapmodel !== null) {
|
|
742
|
-
this.positionPickerDrag.setMode(this.mapmodel)
|
|
743
|
-
}
|
|
744
|
-
},
|
|
745
|
-
myLocation: function () {
|
|
746
|
-
console.log("当前位置信息",this.myLocation)
|
|
747
|
-
// 对外抛出当前位置信息
|
|
748
|
-
this.$emit("getmylocation", this.myLocation);
|
|
749
|
-
},
|
|
750
|
-
inputmarksarray: function () {
|
|
751
|
-
if (this.inputmarksarray !== null && this.inputmarksarray!==[] && this.inputmarksarray!=="[]"){
|
|
752
|
-
this.showMarkerList(); //渲染海量点
|
|
753
|
-
}else {
|
|
754
|
-
this.clearMarkerList();//清楚海量点
|
|
755
|
-
}
|
|
756
|
-
},
|
|
757
|
-
labelmarksarray: function (){
|
|
758
|
-
this.map.clearMap(); //清楚地图上所有的marks (清楚点标记)
|
|
759
|
-
if (this.labelmarksarray !== null && this.labelmarksarray!==[] && this.labelmarksarray!=="[]"){
|
|
760
|
-
this.showLabelMarksArray()
|
|
761
|
-
}
|
|
762
|
-
}
|
|
763
|
-
},
|
|
764
|
-
ready() {
|
|
765
|
-
this.$nextTick(()=>{
|
|
766
|
-
/*判断机型
|
|
767
|
-
手机端有:地图,poi搜索选址,poi拖拽选址
|
|
768
|
-
PC端有:地图 右键菜单初始化
|
|
769
|
-
*/
|
|
770
|
-
this.initAmap(); //地图初始化
|
|
771
|
-
if (this.pickerInput) {
|
|
772
|
-
this.poiPickerReady(); // poi选址初始化
|
|
773
|
-
}
|
|
774
|
-
this.poiPickerDropReady(); // poi拖拽选址初始化
|
|
775
|
-
if (!/(iPhone|iPad|iPod|iOS|Android)/i.test(navigator.userAgent)) {
|
|
776
|
-
// PC端
|
|
777
|
-
console.log("当前设备不是 iPhone|iPad|iPod|iOS|Android 当前设备是" + navigator.userAgent)
|
|
778
|
-
this.contextRightKeyMenu(); // 右键菜单初始化
|
|
779
|
-
let toolBar = new AMap.ToolBar(); // 高德插件工具栏 (地图查看等级放大缩小)
|
|
780
|
-
this.map.addControl(toolBar);
|
|
781
|
-
} else {
|
|
782
|
-
// 移动端
|
|
783
|
-
AMapUI.loadUI(['control/BasicControl'], (BasicControl) => {
|
|
784
|
-
//添加一个缩放控件
|
|
785
|
-
this.map.addControl(new BasicControl.Zoom({
|
|
786
|
-
position: 'lt'
|
|
787
|
-
}));
|
|
788
|
-
});
|
|
789
|
-
}
|
|
790
|
-
if (this.zoomcenter!=null) {
|
|
791
|
-
this.setZommAndCenterView(this.zoomcenter.grade,this.zoomcenter.lng,this.zoomcenter.lat)
|
|
792
|
-
}
|
|
793
|
-
if (this.inputmarksarray.length>0) {
|
|
794
|
-
this.showMarkerList(); //渲染海量点
|
|
795
|
-
}
|
|
796
|
-
if (this.labelmarksarray.length>0) {
|
|
797
|
-
this.showLabelMarksArray()
|
|
798
|
-
}
|
|
799
|
-
})
|
|
800
|
-
},
|
|
801
|
-
created(){
|
|
802
|
-
if (this.dom==='') {
|
|
803
|
-
this.dom = "amapId"+Math.round(Math.random()*10)+Math.round(Math.random()*10)
|
|
804
|
-
}
|
|
805
|
-
},
|
|
806
|
-
computed() {
|
|
807
|
-
}
|
|
808
|
-
}
|
|
809
|
-
</script>
|
|
810
|
-
|
|
811
|
-
<style scoped>
|
|
812
|
-
#pickerOut {
|
|
813
|
-
overflow: auto;
|
|
814
|
-
min-height: 200px;
|
|
815
|
-
min-width: 100px;
|
|
816
|
-
position: absolute;
|
|
817
|
-
background-color: #fff;
|
|
818
|
-
z-index: 3;
|
|
819
|
-
margin: 0 auto;
|
|
820
|
-
border: 1px solid #e8e8e8;
|
|
821
|
-
border-radius: 5px;
|
|
822
|
-
}
|
|
823
|
-
|
|
824
|
-
.tooltips-amp-diy {
|
|
825
|
-
position: relative;
|
|
826
|
-
border: 1px solid #A5C4EC;
|
|
827
|
-
border-radius: 4px;
|
|
828
|
-
}
|
|
829
|
-
</style>
|