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

115
Vistas
How to add the KML layer for Openlayers switcher?

how can i add a KML layer to the switcher by ol-ext Viglino?

When I add:

var vectorSource = new ol.layer.Vector({
  source: new ol.source.Vector({
  url: "IG1.kml",
  format: new ol.format.KML()
})

The layer does not appear on the map.

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

To appear in the layer switcher the layer must have a title property

var vectorSource = new ol.layer.Vector({
  title: "KML Layer",
  source: new ol.source.Vector({
    url: "IG1.kml",
    format: new ol.format.KML()
  })
})

If the layer is not appearing on the map check that .kml extension is enabled in your server MIME types.

about 4 years ago · Juan Pablo Isaza Denunciar

0

Try :

import KML from 'ol/format/KML';
import VectorSource from 'ol/source/Vector';
import {Vector as VectorLayer} from 'ol/layer';

const vector = new VectorLayer({
  source: new VectorSource({
    url: 'IG1.kml',
    format: new KML(),
  }),
});
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