owncloud-archive / maps

:globe_with_meridians: Maps app for ownCloud
GNU Affero General Public License v3.0
42 stars 20 forks source link

Display KML/KMZ and GPX files from owncloud #39

Open poVoq opened 9 years ago

poVoq commented 9 years ago

Is there an option to display kml or gpx files by uploading it to the files section and starting the maps app?

There is a plug in for leaflet that should allow both file types. See: http://psha.org.ru/b/leaflet-plugins.html

An advanced option would be to allow selecting layers of multiple kml and gpx files to be displayed the same time, but for now a simple show kml from the files app would do.

Thanks!

DJaeger commented 8 years ago

I will look into this.

jas4711 commented 8 years ago

Supporting this would be excellent -- would be a first step towards replacing Runkeeper/GarminConnect/etc for me.

I have looked into GPX/etc support for Leaflet, and from what I can tell there are two better alternatives than the one suggested above:

1) https://github.com/mapbox/leaflet-omnivore - loads files on server-side, supports GPX/KML/etc. There is a demo here: https://www.mapbox.com/mapbox.js/example/v1.0.0/omnivore-gpx/

2) https://github.com/makinacorpus/Leaflet.FileLayer - loads files on client-side, supports GPX/KML/etc. This is clever as things only happen in the client, although integration with ownCloud becomes harder.

DJaeger commented 8 years ago

I think we should use the first one, as our purpose is to either open such files from within owncloud or them from the app's own database.

poVoq commented 8 years ago

Great to see that there is progress on this.

One general remark though: it would be nice if the system would not convert .kml into .gpx internally, as you loose a lot of the functionality of .kml (like lables and geometry like circles etc.) though this.

v1r0x commented 8 years ago

the used library (omnivore) supports native kml parsing. Don't know if this is lossless. Haven't tried it with kml files. You could test it yourself (replace omnivore.gpx(...) with omnivore.kml(...)) or send me a kml file and I will test it.

poVoq commented 8 years ago

Ahh, ok... well according to the list of features here: https://github.com/mapbox/togeojson (this is what omnivore is using), the .kml support it quite ok. Doesn't seem to support overlays, but its otherwise quite usable. Will probably test it is a few days with some files from http://www.waterpointmapper.org/

v1r0x commented 8 years ago

Tested it with a testfile yesterday and seems to work.

hitam4450 commented 8 years ago

Are there any test kmz files scheduled??

Currently I use MAPS.ME as off-line maps. They use KMZ files for storing location information. It would be great to be able to import these files into maps, to tarnsfer easily the points of interests resp. personal locations, without any external Cloud service!!

regads, hitam4450

v1r0x commented 8 years ago

I tested it with a downloaded example file. I will implement this option, but I'm currently on holiday and won't be back before the end of september.

jancborchardt commented 8 years ago

To foster collaboration, cc'ing other folks who work on GPX apps:

@Frank1604 @eneiluj let’s work together on one nice Maps app with proper functionality. :)