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

169
Visualizações
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 à 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