{"id":13906211,"url":"https://github.com/windycom/leaflet-kml","last_synced_at":"2025-07-18T04:30:32.192Z","repository":{"id":44937736,"uuid":"189347663","full_name":"windycom/leaflet-kml","owner":"windycom","description":"🌎Leaflet KML layer plugin","archived":false,"fork":false,"pushed_at":"2022-11-08T22:43:22.000Z","size":397,"stargazers_count":159,"open_issues_count":10,"forks_count":73,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-04-23T14:42:20.128Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/windycom.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-30T04:52:41.000Z","updated_at":"2024-04-16T19:29:38.000Z","dependencies_parsed_at":"2023-01-21T07:46:58.103Z","dependency_job_id":null,"html_url":"https://github.com/windycom/leaflet-kml","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/windycom%2Fleaflet-kml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/windycom%2Fleaflet-kml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/windycom%2Fleaflet-kml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/windycom%2Fleaflet-kml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/windycom","download_url":"https://codeload.github.com/windycom/leaflet-kml/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226344586,"owners_count":17610171,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-06T23:01:31.294Z","updated_at":"2024-11-25T14:31:09.418Z","avatar_url":"https://github.com/windycom.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Leaflet KML layer plugin\n\n![Example](assets/screenshot.jpg)\n\nDemo: https://www.windy.com/uploader\n\nThis plugin was extracted from Pavel Shramov's Leaflet Plugins [repository](https://github.com/shramov/leaflet-plugins) in order to maintain this code more frequently and separate KML layer from other plugins.\n\nSo far we have fixed few issues.\n\nProbably will work on Leaflet 1+, tested on Leaflet 1.4.\n\n## How to use\n\n```html\n\u003chtml\u003e\n    \u003chead\u003e\n        \u003clink rel=\"stylesheet\" href=\"http://unpkg.com/leaflet@1.4.0/dist/leaflet.css\" /\u003e\n        \u003cscript src=\"http://unpkg.com/leaflet@1.4.0/dist/leaflet.js\"\u003e\u003c/script\u003e\n        \u003cscript src=\"./L.KML.js\"\u003e\u003c/script\u003e\n    \u003c/head\u003e\n    \u003cbody\u003e\n        \u003cdiv style=\"width: 100vw; height: 100vh\" id=\"map\"\u003e\u003c/div\u003e\n        \u003cscript type=\"text/javascript\"\u003e\n            // Make basemap\n            const map = new L.Map('map', { center: new L.LatLng(58.4, 43.0), zoom: 11 });\n            const osm = new L.TileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png');\n\n            map.addLayer(osm);\n\n            // Load kml file\n            fetch('assets/example1.kml')\n                .then(res =\u003e res.text())\n                .then(kmltext =\u003e {\n                    // Create new kml overlay\n                    const parser = new DOMParser();\n                    const kml = parser.parseFromString(kmltext, 'text/xml');\n                    const track = new L.KML(kml);\n                    map.addLayer(track);\n\n                    // Adjust map to show the kml\n                    const bounds = track.getBounds();\n                    map.fitBounds(bounds);\n                });\n        \u003c/script\u003e\n    \u003c/body\u003e\n\u003c/html\u003e\n\n```\n\n## Licence\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwindycom%2Fleaflet-kml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwindycom%2Fleaflet-kml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwindycom%2Fleaflet-kml/lists"}