Vue2Leaflet(基于vue的leafLet)封装的图片打点功能 移动端与pc端同样适用【自用】

本文介绍了如何使用Vue2Leaflet库在移动端和PC端进行图片打点功能的封装,详细讲解了从安装leaflet和vue2-leaflet到在main.js中引入的步骤。
摘要由CSDN通过智能技术生成

 安装leaflet

cnpm i leaflet -S

安装vue2-leaflet

cnpm i vue2-leaflet -S 

main.js中引入

Vue.config.productionTip = false

import 'leaflet/dist/leaflet.css';

<comment>
  平面图标记 
  传参说明 见props
</comment>
<template>
  <div id="leafLet">
    <l-map
      ref="map"
      :zoom="zoom"
      :min-zoom="minZoom"
      :max-zoom="maxZoom"
      :center="center"
      :crs="crs"
      :options="{zoomControl: false,zoomAnimationThreshold:20}"
      :max-bounds="bounds"
      style="width:100%;height:600px"
      @update:center="centerUpdate"
      @update:zoom="zoomUpdate"
    >
      <!-- 图片的图层 -->
      <template>
        <l-image-overlay
          :url="url"
          :bounds="bounds"
          :options="{interactive:true}"
          @click="addPoint"
        />
      </template>
      <!-- 标记图层 -->
      <template>
        <l-marker
          v-for="(point,index) in points"
          :key="index"
          :lat-lng="point"
          :visible="showPoint"
          :options="{permanent: true}"
        >
          <!-- <l-icon :icon-url="!point.old&&type=='edit'?warningIcon:primaryIcon" /> -->
          <l-to
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值