KML Layer Best Practices


#1

KML/KMZ files and layers can be a little complex at times and some people have had issues, so I thought I'd post some suggestions/recommendations.




  • KMZ files are basically ZIP files that sometimes contain multiple KML files within them. You could actually change the .kmz file extension to .zip and unzip the file then load each individual KML file as a separate layer


  • The Ushahidi Map has limits on how much KML data it can load. If your KML file is a few Megabytes big, this is going to be an issue in any browser. Good sizes are in the sub-megabyte range.


  • Sometimes, poorly formatted KML files will be an issue and show up blank on the map. Usually this has to do with the styling in the KML file itself. Google Earth is more forgiving. Examples:

    In this example, it will be assumed the LineStyle has a zero width so will show up blank
    Code:


    ff0000ff



    Correct Version:
    Code:


    ff0000ff
    1



    You can find the KML reference guide here: http://code.google.com/apis/kml/documentation/kmlreference.html



#2

Thanks a lot for these tips. They helped me to get the layers working on Ushahidi. I used feedvalidator.org to check my KML files.


Quote:
The Ushahidi Map has limits on how much KML data it can load. If your KML file is a few Megabytes big, this is going to be an issue in any browser. Good sizes are in the sub-megabyte range.


All my KML files are a couple Megabytes big containing data that spans the whole globe. Since loading them takes a lot of time I was wondering whether it is possible to dynamically load the KML data depending on the current area displayed on the map?


#3

Simon,


That could possibly be done in the code but it would not be a update and would have to change the way Ushahidi currently works with KML files. Perhaps you could break your KML layers up by geographic region (X Layer (Africa), X Layer (Europe), etc)?



#4

Layers will not add not matter i try..........



#5

Same for me, can anyone give more explanations how to get into HTML so make the change mentioned above?

Thanks for your help



#6

I also am having issues uploading KML files in a Crowdmap. I've used both Google Maps and Google Earth to create simple paths and neither will display in Crowdmap. Any pointers?