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

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

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 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