This object is in archive! 

Problem with MapItems (KML-KMZ)

Ingo Rau shared this problem 6 years ago
Solved

Two (probably) related problems with KML/KMZ:

I downloaded some KMLs from here:

http://www.geofinder.ch/verbaende.php

and added them to MapItems. Locus opened and displayed them well, but zooming was very slow. I dived into a file and saw they're referencing a remote stylesheet which itself references icons. But Locus wasn't displaying the referenced icon, only the default brown "i". So I assumed the whole remote-stylesheet thing didn't work (though Locus shouldn't have to try it again on every zoom, slowing it down considerably...)


=> Problem 1


Now I download the icon locally, edited the KML and packed it together with the icon into a KMZ (I attached one). Added that to the mapItems folder and voilà! Two Android 5.1.1 devices (Note4 with CyanogenMod and S5neo with Samsung Stock ROM) display those KMZ perfectly and without delay.

But my new Tab S2 with Android 7.1.2 still fails: After tapping the Eye icon, a progress bar appears for a split second and then nothing: No error message, but the eye is still white and nothing is displayed.

=> Problem 2

Now I unpacked the KMZ again and tried it: The KML opens, but the default icons are displayed again, not the hut.png. I tried the unpacked version on the other phones: All fine.


Can't imagine what's different on Android Nougat... It's not the endles Android-with-external-sdcards story, I got the mapItems folder in the default internal location.

Replies (2)

photo
1

Good day Ingo,

thanks for a complex bug report, let's move on it.


I'm testing attached file and for me, it does not load at all. I'm trying it in Google Earth and also nothing. Anyway after I've removed special character 'u' from name of inner! kml file, it works correctly in Google Earth and also in Locus Map. So it looks like in new Android 7 is some new library that work with zip files and is not able to read these specially named files ( I'm testing it also on Android 7 ) ... it just thrown exception on background "Invalid zip file".


Do you also have original file with links to icons that caused you slowdown? I would like to check it, thanks.

photo
1

Well, that would make a lot of sense. Can't test it right now, as I don't have my Tab at work, but will tonight. Probably the encoding of the files in the ZIP I created is not UTF-8, and new Android lib dropped support of older encodings or something like this. Still doesn't explain why the unpacked version does not display correct icons. Do you see correct icon or the Locus "i" icon with the KMZ? Did you try it with unpacked KML+PNG?

The link to the file I started with: http://www.geofinder.ch/daten.php?f=kml&typ=21&suche=sac-cas

photo
1

I think it will be more because this combination ( kml file in map items with "floating" icons in same directory ) is not implemented. Till now it was never needed :).


And thanks for the link, you are correct, after every zoom, Locus Map tries to load all icons again. I never saw this, but link to icon is just link to another KML file where are icons defined. Locus Map is not able to handle this system now and because it's so rare, I do not think it's needed.

Anyway very interesting file that open two weaknesses of Locus Map ... these special included KML files and also inability to correctly handle problem with loading images over http. In case of problem, it's neverending story, damn.


For now, you have to use KMZ with UTF-8 encoded file names, it should work. Thank you

photo
1

Thx for quick analysis (man, if all app developers would look at bug reports this fast, the world would be a better place ;-).

I fully understand and can totally live with it. It's probably best to name the included KML simply doc.kml, as Locus does when exporting - no need to repeat the name inside. And the "floating icon" solution was only for testing anyway.

So wish you a sunny weekend (should be as sunny in Czech as in Switzerland :)!

photo
1

FYI: Analysis was correct: I repacked the KMZ with UTF-8 filenames (keeping the umlaut in the name), and voilà - worked flawlessly! :)

So obviously Google dropped support in their libraries. Anyway, I'm happy now :)

Replies have been locked on this page!