Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I've done a good amount of debugging, and can confirm the following.
- The KML file is being loaded from the same domain as the site.
- The layer is getting added to the map and displayed in the layer switcher.
- Using Firebug, I can see the generated layer markup, and it's properly being toggled to display or not display when using the layer switcher. The markup is below. I think the crux of the problem is the polyine is not being converted to anything renderable.
<g id="OpenLayers.Layer.Vector_18_root" style="visibility: visible; display: block;" transform=""> <g id="OpenLayers.Layer.Vector_18_vroot"/> <g id="OpenLayers.Layer.Vector_18_troot"/> </g>
Thoughts?
Comment | File | Size | Author |
---|---|---|---|
#8 | 869834_kml_projection.patch | 1.47 KB | tmcw |
#7 | openlayers-kml-projection.patch | 721 bytes | levelos |
#5 | openlayers-kml-projection.patch | 318 bytes | levelos |
Comments
Comment #1
levelos CreditAttribution: levelos commentedI take it back, no type of KML overlay is visible, be it a point, linestring, or polygon.
Comment #2
tmcw CreditAttribution: tmcw commentedIs there a live example of this happening?
Comment #3
levelos CreditAttribution: levelos commentedI'm working in a development environment, so can't point to my specific tests. I've tried using both 6.x-2.0-alpha8 and the latest dev snapshot, and I've tried using several sample KML files, including the one on the Ol site, http://openlayers.org/dev/examples. Is there an example where KML layers are working? Maybe I could cross reference.
Comment #4
levelos CreditAttribution: levelos commentedImportant update on this one. The KML layers work correctly when the map projection is set to 4326, but not 900913. Obviously poses a problem when wanting to use Google. Any thoughts?
Comment #5
levelos CreditAttribution: levelos commentedOk, more updates. Sorry for the live stream of my debugging.
Seems the features in the KML files were being rendered on the map, just at the wrong coordinates, all with 0,0, at least when the map projection was set to 900913. When the projection was changed 4326, everything worked fine. A bit more digging led me to the solution, including the projection setting in the KML vector layer definition in kml.js. A patch is attached.
Comment #7
levelos CreditAttribution: levelos commentedTrying a new patch, the last one was rejected.
Comment #8
tmcw CreditAttribution: tmcw commentedCan you test this patch and confirm that it works for you? This should provide a more comprehensive fix for the problem.
Comment #9
levelos CreditAttribution: levelos commentedThanks, that seems to work as well.
Comment #10
tmcw CreditAttribution: tmcw commentedGreat, committed: http://drupal.org/cvs?commit=402358