ElemeFE / vue-amap

🌍 基于 Vue 2.x 和高德地图的地图组件
https://elemefe.github.io/vue-amap/
MIT License
3.35k stars 586 forks source link

> > 我放弃了template,用别的方式做了 @chenmychou @670248996 #651

Open QWKk opened 3 years ago

QWKk commented 3 years ago

我放弃了template,用别的方式做了 @chenmychou @670248996

请问用什么方式解决呢?

用amap-marker的插槽,然后内容写好相对定位就可以了

    <el-col>
      <el-amap
        ref="amap"
        :zoomEnable="amap.zoomEnable"
        :plugin="amap.plugin"
        :events="amap.events"
        :class="$style.amap"
      >
        <el-amap-marker
          :bubble="true"
          v-for="(item, index) in bridgeList"
          :key="index"
          :zIndex="item.zIndex"
          :position="item.position"
        >
          <div :class="[$style.marker, item.hover && $style['marker-hover']]">
            <div :class="$style['marker-content']">
              <div
                v-if="item.bridgeMapPic"
                :class="$style['marker-thumb']"
                @mouseenter="mouseenter(item)"
                @mouseleave="mouseleave(item)"
                @click="go(item)"
              >
                <img :src="item.bridgeMapPic | convertUrl">
                <div>{{item.bridgeName}}</div>
              </div>
              <span
                @mouseenter="mouseenter(item)"
                @mouseleave="mouseleave(item)"
                @click="go(item)"
              >{{item.bridgeName}}</span>
            </div>
            <i
              class="el-icon-location"
              :class="[$style['marker-icon'], item.status && $style.danger]"
              @mouseenter="mouseenter(item)"
              @mouseleave="mouseleave(item)"
              @click="go(item)"
            ></i>
          </div>
        </el-amap-marker>
      </el-amap>
    </el-col>

Originally posted by @realmx in https://github.com/ElemeFE/vue-amap/issues/515#issuecomment-497903427

QWKk commented 3 years ago

请问,是否有源代码,我在el-amap-marker里面写好内容后,地图的坐标图标消失了。

realmx commented 3 years ago

请问,是否有源代码,我在el-amap-marker里面写好内容后,地图的坐标图标消失了。

两年前的事情,不记得啦

QWKk commented 3 years ago

=.=