The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Hot answers tagged

3

You mixed a few things here. kml is XML object, not a Leaflet layer, so you cannot set opacity to it with setOpacity function or add it to the map. Leaflet layer that comes from kml and you are interested in is track. This is feature group layer for which you can set style with setStyle method. You have to declare it outside fetch, so it be available later ...


2

First, make sure that your PNG is in the same folder than your KML. Then, in QGIS, open the browser and open the KML file with the raster icon (drag and drop it on the map) or use Layer > Add Layer > Add Raster Layer and select the .kml file. Otherwise you will only open the geometry (meaning the boundaries of the image as a polygon in that case).


1

It looks like I found a decent solution to make it: First of all, the good code is provided by: https://github.com/shramov/leaflet-plugins where is the .kml section. You must copy the KML.js file into your repository Then in the front script code use: var track = new L.KML('Coventry.kml', {async: true}) .on('loaded', function (e) { map....


1

The procedure I normally use is to convert .shp to .Kml is below Right click on the layer, click on save as for qgis 2.8 and versions below, but for Qgis version 3.8.3, you have to go to export and click and Save Features As When the above pop up displays change the format from ESRI shapefile to Keyhole Markup Language (KML). Give the file name (File ...


Only top voted, non community-wiki answers of a minimum length are eligible