Hello,
Working with the latest beta1 release but I had the same problem with alpha2. I've uploaded a simple KML file on my dev server. The KML is really simple and validates for error – just a simple Point location. I've created a KML layer with a link to my KML file on the same surver, same subdomain as the test. I've added the layer to a map with display style (that works for displays other layers). But my KML is now showing up. It does show in the layer switcher but the point from my file is not visible. Map projectio is 900913, display projection is 4326.
Am I doing something wrong or missing something? I've wasted many hours already starting from more complex KML files and now with the simplest KML with a single point in it. But the KML file does not seem to be the problem here.
Comment | File | Size | Author |
---|---|---|---|
#5 | 3.kml_.txt | 321 bytes | Kaloyan Petrov |
#2 | test_map.txt | 6.27 KB | Kaloyan Petrov |
#2 | kml_layer.txt | 614 bytes | Kaloyan Petrov |
#2 | kml_layer.txt | 614 bytes | Kaloyan Petrov |
Comments
Comment #1
nod_could you post an export of you map and layer please ?
Comment #2
Kaloyan Petrov CreditAttribution: Kaloyan Petrov commentedThanks for the fast response! The exports are attached plus the test KML file.
Comment #3
nod_got to sleep right now but you might want to try disabling all your layers and all of your behaviors to check that they are not conflicting. If it still doesn't work, there has to be a javascript error involved, copy it here.
Comment #4
Kaloyan Petrov CreditAttribution: Kaloyan Petrov commentedThanks, I'll try to disable all other layers and behaviors tomorrow. Clone from the default OL map did not display the layer too. No errors in js from firebug or php in the site log...
Comment #5
Kaloyan Petrov CreditAttribution: Kaloyan Petrov commentedToday I tried the map without any features enabled and all other layers disabled. I tried it on a copy of the default map. I also made it on a clean install and still no KML showing. No JS or PHP errors...
I've explained what I do in the first post – essentially add a new kml layer with kml file in the files directory of Drupal. The file is simple and has a single point in it. I've attached it. Then add the layer to clone of default map. The layer is in the layer switcher but does not show up on the map. I feel like I'm missing something in the process since there are no error to give me a clue for bugs.
Comment #6
Kaloyan Petrov CreditAttribution: Kaloyan Petrov commentedI just tried the same routine on a fresh Drupal 6 install and the KML layer appears just fine.
Comment #7
nod_Wow that's a pain to debug, i really need to clean up layers soon.
Ok, so It works with openlayers 2.10, so i'll need to find out what changed to fix this. No real change between 6.x and 7.x on the js for kml layers.
Comment #8
Kaloyan Petrov CreditAttribution: Kaloyan Petrov commented2.10 is not problem. I did test it on D6 with 2.10 and 2.11 and KML layer still displays fine. I'm trying clean installations for older alpha1 and alpha2 versions of OpenLayers for D7 now. I'll give feedback soon.
Comment #9
Kaloyan Petrov CreditAttribution: Kaloyan Petrov commentedAlright, after testing clean installations on both D6 and D7 and older versions of OL I can confirm:
Drupal 6.22 + OpenLayers latest dev version (2011-Aug-26):
+ OpenLayers 2.9 – KML layer visible
+ OpenLayers 2.10 – KML layer visible
+ OpenLayers 2.11 – maps tiles not visible but KML layer visible
Drupal7.9 + OpenLayers 7.x-2.0-alpha2
+ OpenLayers 2.10 – KML layer visible
- OpenLayers 2.11 – KML layer NOT visible
Drupal7.9 + OpenLayers 7.x-2.0-beta1
+ OpenLayers 2.10 – KML layer visible
- OpenLayers 2.11 – KML layer NOT visible
I'm not sure what breaks because there are no JS erros reported by firebug. There is a PHP error though:
http://mydomain/admin/structure/openlayers/maps/ekonet/edit?render=overlay
Message: Layer ekonet not found.
The ekonet layer is the map that is supposed to display the KML layer. The error does not seem to be related with KML though. Without the KML layer enabled for this map the error still remains.
Comment #10
nod_wow, thank you so much for this awesome testing spree.
I'll look up the diff on the openlayers js side and i'll try to get this fixed asap. you just saved my evening with all your testing :-)
Comment #11
nod_duplicate post. sorry.
Comment #12
Kaloyan Petrov CreditAttribution: Kaloyan Petrov commentedUnfortunately I can't help much with the debugging js part so I'm glad I could help with the testing :) If I can help with anything else, please, let me know.
Comment #13
Patroclas CreditAttribution: Patroclas commentedNot sure if this will help - but with a similar problem I found that re-ordering the layers in the map got my missing kml layers to show. Try bringing that layer well up above 0 if it isn't already?
Comment #14
Kaloyan Petrov CreditAttribution: Kaloyan Petrov commentedThat's strange but I just tried it and confirm that it helped show the missing KML layers with OpenLayer 2.11.
Comment #15
Patroclas CreditAttribution: Patroclas commentedGlad it worked for you too!
I am not getting good results with layers set with a negative number.
Comment #16
vliefooghe CreditAttribution: vliefooghe commentedSame problem with a KML file.
OpenLayers 2.10 works without change.
For OpenLayers 2.11, I had to change weight of KML layer above 0 (that is 4, for example).
Comment #17
nod_I'm guessing the layer weight is directly related to the layer css z-index. Since there is a solution i haven't rushed to make a patch, but it'll be there soon.
Comment #18
zzolo CreditAttribution: zzolo commentedHey all. I believe this was actually caused because in the OL 2.11 library, something changed where the way we were adding KML layers would not happen because of event ordering, I believe. This is probably why changing the weight allowed it to work.
So, I have changed the JS for the KML layer to use the AJAX method more directly. This is similar to the new GeoJSON layer. The change along with a test layer and map are committed:
http://drupalcode.org/project/openlayers.git/commit/5137d63
Please test.
Comment #19
Kaloyan Petrov CreditAttribution: Kaloyan Petrov commentedInitials tests are good. No problems displaying kml layers and no need to reorder them now.
Thanks Alan! :)