Piwigo / piwigo-openstreetmap

OpenStreetMap integration for Piwigo
http://piwigo.org/ext/extension_view.php?eid=701
GNU General Public License v3.0
35 stars 35 forks source link

Add kml-support #72

Open ThomasDaheim opened 8 years ago

ThomasDaheim commented 8 years ago

Probably, gpx.inc.php should be renamed as well...

xbgmsharp commented 8 years ago

Could you avoid the cloudfare call? Why is it need? <script src="//cdnjs.cloudflare.com/ajax/libs/d3/3.4.13/d3.min.js" charset="utf-8"></script>

Maybe we should use a different Leaflet plugin: https://github.com/makinacorpus/Leaflet.FileLayer https://github.com/mapbox/leaflet-omnivore

The first array_push should be array_push($conf['file_ext'], 'gpx', 'kml'); http://php.net/manual/en/function.array-push.php

Could you provide a sample KML file link that I could download so I could test.

ThomasDaheim commented 8 years ago

I have simply taken the kml.js that I could find. Whatever works is fine with me :-)

Fine to change the array_push - as I said, I don't really speak php

ThomasDaheim commented 8 years ago

BTW, I have noticed that for kml the start and end markers can't be set. Have removed that.

In addition, I don't think that kml has info for a profile. But I didn't dared to remove that from the template...

xbgmsharp commented 8 years ago

it won't work

    if ( (array_key_exists('path', @$picture['current']))
        && (strpos($picture['current']['path'],".gpx") === false
        && strpos($picture['current']['path'],".kml") === false))

Should be

    if ( (array_key_exists('path', @$picture['current']))
        && (strpos($picture['current']['path'],".gpx") === false
        || strpos($picture['current']['path'],".kml") === false) )

As in If path and (GPX or KML)

xbgmsharp commented 8 years ago

Where is kml.js coming from? Please add an header so we know the author and the license.

ThomasDaheim commented 8 years ago

Code above works here without issues :-)

My reading was: "return if path and (not gpx and not kml)" since your checking whether picture path & file contains ".gpx" or ".kml" extension. With your code you would return if either gpx or kml - thats not what we want, right?

patmans commented 6 years ago

What is the status of this? I was trying to get lots of gpx files working again.