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

267
Visualizações
How to add an empty layer to my layerSwitcher in Openlayers

i am trying to add a couple of layers to my map, but these layers must be empty. I mean when i activate this layer it must return an alert or something similar saying "Coming soon".

    map = new ol.Map({
        layers: [
            new ol.layer.Group({
                'title': 'Mapas de base',
                layers: [grisOSM, mapaOSM]
            }),
            /* new ol.layer.Group({
                title: 'Capas de información',
                layers: [ ]
            }) */

        ],
        target: 'map',
        controls: ol.control.defaults({
            zoom: true,
            attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
                collapsible: false
            })
        }).extend([
            scaleLineControl
        ]),
        view: vista,
        interactions: new ol.interaction.defaults({
            altShiftDragRotate: false
        }),

    });

    const layerSwitcher = new ol.control.LayerSwitcher({
        tipLabel: 'Leyenda'
    });
    map.addControl(layerSwitcher);

This is my layerSwitcher where i want to add these layers:

preview

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

0

An empty vector layer will show in a layer switcher and can also be used display attributions

new ol.layer.Vector({
  title: 'Empty layer',
  source: new ol.source.Vector({
    attributions: '© No data'
  })
})
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