Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

117
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!