makinacorpus / Leaflet.FileLayer

Loads files locally (GeoJSON, KML, GPX) as layers using HTML5 File API
http://makinacorpus.github.io/Leaflet.FileLayer/
MIT License
273 stars 91 forks source link

kml show image in description (displaying an image from the local disk) #16

Closed ghost closed 10 years ago

ghost commented 10 years ago

Is it possible to display an image from the local disk after loading a local KML file ( image link in KML description)

leplatrem commented 10 years ago

Unfortunately you can't.

That would mean being able, from a webpage Javascript, to load any arbitrary file (and information about it) coming from users hard disks. This would be a security problem...

Maybe you can through a Java applet :)

Good luck !

ghost commented 10 years ago

Thanks !

ghost commented 10 years ago

Still a comment, just an idea. I'm sorry to bother you again,

Is it possible that the user selects all local images using the html5 File API (like the KML file) and than use these files in popup. It's just an idea and I don't know if and how it should be done.

leplatrem commented 10 years ago

Yes, in this case, it is completely possible!

Look at this example to get started : http://stackoverflow.com/questions/4459379/preview-an-image-before-it-is-uploaded

ghost commented 10 years ago

I'll give it a try :-)