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

165
Vistas
Javascript: switch, case, styling

What do you think is wrong here?

I'm trying to apply different stylings according to the line of a Geojson in Leaflet.js

Error is: Uncaught SyntaxError: missing ) after formal parameters

// WFS TFL

var startatzoom_tfl = 10;
var featureLayer_tfl = new L.GeoJSON(
null, {
       switch (feature.properties.name){
       
       case 'Bakerloo' : style: function(){return { color: #B36305, weight: 13, opacity: 0.7 }}; 
       case 'Central' : style: function(){return { color: #E32017, weight: 13, opacity: 0.7 }}; 
       case 'Circle' : style: function(){return { color: #FFD300, weight: 13, opacity: 0.7 }}; 
       case 'District' : style: function(){return { color: #00782A, weight: 13, opacity: 0.7 }}; 
       case 'Elizabeth' : style: function(){return { color: #9364CD, weight: 13, opacity: 0.7 }}; 
       case 'Hammersmith & City' : style: function(){return { color: #F3A9BB, weight: 13, opacity: 0.7 }}; 
       case 'Jubilee' : style: function(){return { color: #A0A5A9, weight: 13, opacity: 0.7 }}; 
       case 'Metropolitan' : style: function(){return { color: #9B0056, weight: 13, opacity: 0.7 }}; 
       case 'Northern' : style: function(){return { color: #000000, weight: 13, opacity: 0.7 }}; 
       case 'Piccadilly' : style: function(){return { color: #003688, weight: 13, opacity: 0.7 }}; 
       case 'Victoria' : style: function(){return { color: #0098D4, weight: 13, opacity: 0.7 }}; 
       case 'Waterloo & City' : style: function(){return { color: #95CDBA, weight: 13, opacity: 0.7 }}; 
       case 'DLR' : style: function(){return { color: #00A4A7, weight: 13, opacity: 0.7 }}; 
       case 'London Overground' : style: function(){return { color: #EE7C0E, weight: 13, opacity: 0.7 }}; 
       case 'London Trams' : style: function(){return { color: #84B817, weight: 13, opacity: 0.7 }}; 
       case 'Emirates Cable Car' : style: function(){return { color: #E21836, weight: 13, opacity: 0.7 }}; 
                                                                      
                                                                      },

    onEachFeature:
         function popUpsome(feature, layer) {
             if (feature.properties && feature.properties.name) {
        layer.bindPopup('<h3>' + feature.properties.name + '</h3><br>' + feature.properties.name + '<br><i>' + feature.properties.name + '</i>', {maxWidth: 200}) ;
                        layer.bindTooltip(feature.properties.name);
             }
         }
});
about 4 years ago · Juan Pablo Isaza
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