Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

228
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda