Browse Source

no message

V1.0
dai 3 years ago
parent
commit
6f89fbd1a1
  1. 26
      src/views/modules/visual/command/cpts/map.vue

26
src/views/modules/visual/command/cpts/map.vue

@ -1,6 +1,7 @@
<template> <template>
<div class="m-map" :class="{ 'z-td': mapType == 'td' }"> <div class="m-map" :class="{ 'z-td': mapType == 'td' }">
<div id="map"></div> <div id="map"></div>
<div id="searchMap"></div>
<div <div
class="btn" class="btn"
v-if="mapStyleType == 'light'" v-if="mapStyleType == 'light'"
@ -59,6 +60,7 @@ let countTextLayer;
let countTextBgLayer; let countTextBgLayer;
let searchMarker; let searchMarker;
let searchBgLayer; let searchBgLayer;
let tdtSearchMap;
function reversePix(pixelsTemp) { function reversePix(pixelsTemp) {
// //
@ -900,9 +902,24 @@ export default {
}, },
searchPos(name) { searchPos(name) {
console.log("=----------------------=searchPos", name);
return new Promise(async (reslove) => { return new Promise(async (reslove) => {
if (mapType == "td") { if (mapType == "td") {
let center = scene.getCenter();
console.log("=----------------------=searchPos", name);
if (!tdtSearchMap) {
tdtSearchMap = new T.Map(document.getElementById("searchMap"), {
center,
});
await nextTick(1000);
console.log("=----------------------=searchPos2", center);
}
tdtSearchMap.panTo(center);
await nextTick(100);
const { msg, data } = await searchNearby(tdtSearchMap, name);
console.log("=----------------------=searchPos3", data);
if (msg == "success") {
reslove(data.resultList);
}
reslove([]); reslove([]);
} else { } else {
window.AMap.plugin("AMap.PlaceSearch", () => { window.AMap.plugin("AMap.PlaceSearch", () => {
@ -966,6 +983,13 @@ export default {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
#searchMap {
position: absolute;
width: 200px;
height: 200px;
visibility: hidden;
pointer-events: none;
}
.btn { .btn {
position: absolute; position: absolute;
bottom: 0; bottom: 0;

Loading…
Cancel
Save