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

229
Visualizações
leaflet polylines and bringtofront on overlapping lines

I have:

var lines = volLines[name];

where name is the name for a group of polylines, each 'lines' has a marker with "name" displayed where i do this:

.addTo(mymap).on('click', changeMapLineColour);

When I click on a marker that is associated for the group of polylines the lines all change colour. The problem I have is there are many other groups of polylines so sometimes the lines that I have change the colour of are under other groups of polylines so I cannot see all the lines. How do I bring the lines associated with "name" to the front when the lines overlap?

function changeMapLineColour()
{ //other stuff in here, just given basics for this problem.
   lines[i].setStyle({
                            color: "white",
                            weight: 4
                        }) 
}

I found this but I am unsure of how to use it and where to put in cshtml?

actions: {
  bringToFront(e) {
    e.target.bringToFront();
  }
}
{{polyline-layer ... onAdd=(action "bringToFront")}}

Or is there a better way?

Thank you!

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

created a layer (from an array of lines) like this to then be able to bringToFront()

var layer = lines[i].setStyle({
                    color: "white",
                    weight: 4
                })
                layer.bringToFront();

woohoo!

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