Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing folder infos #40

Closed
jayantpaliwal opened this issue Apr 4, 2024 · 1 comment
Closed

missing folder infos #40

jayantpaliwal opened this issue Apr 4, 2024 · 1 comment

Comments

@jayantpaliwal
Copy link

jayantpaliwal commented Apr 4, 2024

While converting xml to geoJson using @tmcw/togeojson@4.1.0/dist/togeojson.umd.js is missing the folder infos.

_parseKML: function(data, props) {
		var xml = _.toXML(data, props);
		var geojson = _.toGeoJSON(xml, props);
		var layer = (this.options.geometryToLayer || this._geometryToLayer).call(this, geojson, xml);
		this.addLayer(layer);
		this.fire('load', { layer: layer, name: geojson.properties.name });
	},

it merged all the folder layers
image

I need to present the layers like google earth.

Folders-> Sub layers of folders

image

@Raruto
Copy link
Owner

Raruto commented Apr 4, 2024

Hi @jayantpaliwal,

Javascript dependencies are lazy loaded only when not found on the page,

ie. a previous <script src="@tmcw/togeojson@4.1.0/dist/togeojson.umd.js"></script>:

leaflet-kmz/src/KMZLayer.js

Lines 140 to 152 in ed43fe9

_requiredJSModules: function() {
var urls = [];
var host = 'https://unpkg.com/';
if (typeof window.JSZip !== 'function') {
urls.push(host + 'jszip@3.5.0/dist/jszip.min.js');
}
if (typeof window.toGeoJSON !== 'object') {
urls.push(host + '@tmcw/togeojson@4.1.0/dist/togeojson.umd.js');
}
return urls;
},

The version provided by this plugin is not mandatory, otherwise please propose your own PR.

👋 Raruto

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants