Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

236
Visualizações
how to auto change map center to let all markers show in vue-leaflet

just in title,

code is below, i want to change this map center to show all markers,

and the markers will change,so the center is changing,how to calculate the center and zoom in map? thks for answer

<l-map :zoom="amapContext.map.zoom" :center="amapContext.map.center">
          <l-tile-layer
            :url="amapContext.map.url"
            :attribution="amapContext.map.attribution"
          ></l-tile-layer>
          <l-marker
            v-for="(marker, idx) in amapContext.data.markers"
            :key="idx"
            :lat-lng="marker.position"
            :icon="marker.iconShow"
          >
            <l-popup> 经纬度:{{ marker.position }} </l-popup>
          </l-marker>
          <!-- <l-marker :lat-lng="[39.996356, 116.480639]"></l-marker> -->
        </l-map>
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

ok, i got a method except it isn't the best solution,

set the map bounds ues two latLngBounds(ref to docs of leaflet) , one latLngBounds is the max lat lng,and the other is min lat lng in markers

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda