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

391
Visualizações
Los marcadores de MarkerCluster aún se muestran detrás del clúster

Estoy tratando de ocultar los marcadores detrás de mi grupo y solo mostrarlos cuando se hace clic en el marcador.

Así es como aparece:

Así es como aparece. Sin embargo, cuando hago clic en el clúster y salgo, vuelve a tener el aspecto que debería tener (segunda foto)

Sin embargo, cuando hago clic en el clúster y salgo, vuelve a tener el aspecto que debería tener (segunda foto)

Así es como quiero que se vea originalmente

(Así es como quiero que se vea originalmente)

Este es mi código:

 var markers = new L.MarkerClusterGroup(); markers.addLayer(L.marker([currentLatitude, currentLongitude], { icon: populationIcon }).addTo(mymap).bindPopup( `The population of ${thisCountry.countryName} is ${thisCountry.countryPopulation}.`)); markers.addLayer(capitalMarker = L.marker([currentLatitude, currentLongitude], { icon: cityIcon }).addTo(mymap).bindPopup( `The capital city of ${thisCountry.countryName} is ${thisCountry.countryCapital}.`)); markers.addLayer(carMarker = L.marker([currentLatitude, currentLongitude], { icon: carIcon }).addTo(mymap).bindPopup( `They drive on the ${thisCountry.carSide} of the road in ${thisCountry.countryName}.`)); //add cluster to map mymap.addLayer(markers);
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

También está agregando el marcador creado al mapa y esto es incorrecto ( icon: carIcon }).addTo(mymap).bindPopup( ).

Cambio

 markers.addLayer(carMarker = L.marker([currentLatitude, currentLongitude], { icon: carIcon }) .addTo(mymap) .bindPopup(`They drive on the ${thisCountry.carSide} of the road in ${thisCountry.countryName}.`));

a

 markers.addLayer(carMarker = L.marker([currentLatitude, currentLongitude], { icon: carIcon }) .bindPopup(`They drive on the ${thisCountry.carSide} of the road in ${thisCountry.countryName}.`));
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