Raruto / leaflet-kmz

A KMZ file loader for Leaflet Maps
GNU General Public License v3.0
48 stars 27 forks source link

Possible to load data direct ? #18

Closed dceejay closed 3 years ago

dceejay commented 3 years ago

Hi, apologies if I'm being dense - but is there a way to call this library directly with data ? IE not load via a url. Eg if I receive data via a websocket - or from a drag / drop operation ? If so how...? Thanks

Raruto commented 3 years ago

Hi Dave,

it depends on the data format you are dealing with, but you can start by trying to take a look at these lines:

https://github.com/Raruto/leaflet-kmz/blob/525e0bdf072fd3f69bdf8f10795737b8d1e1235e/src/KMZLayer.js#L35-L61

If you will then be able to produce something concrete I would be happy to add it among the other examples of this library.

Have a nice day, Raruto

dceejay commented 3 years ago

Ah - I didn't realise all those _ methods were exposed (too used to nodejs where they need to be exported :-) That should work... I'll have a go. thanks