Hello,

I'm working on displaying KML on maps and during my work, I've spotted a small bug.
It looks like the behavior "Zoom to layer" is not working when the layer is a KML.

It looks like the "loadend" event is not fired in plugins/behaviors/openlayers_behavior_zoomtolayer.js.

Files: 
CommentFileSizeAuthor
#2 openlayers-layer_loadend_ajax-1627032-2.patch1.23 KBjeffschuler
PASSED: [[SimpleTest]]: [MySQL] 238 pass(es).
[ View ]
#1 openlayers-layer_loadend_ajax-1627032-1.patch1013 bytesjeffschuler
PASSED: [[SimpleTest]]: [MySQL] 238 pass(es).
[ View ]

Comments

Status:Active» Needs review
StatusFileSize
new1013 bytes
PASSED: [[SimpleTest]]: [MySQL] 238 pass(es).
[ View ]

from zzolo on IRC:

its because KML and GeoJSON are ajax requests and so when the zoom to layer behavior fires, those layers are not fully loaded yet

This triggers loadend after features are loaded.

StatusFileSize
new1.23 KB
PASSED: [[SimpleTest]]: [MySQL] 238 pass(es).
[ View ]

Two places in geojson feature-loading this needs to happen.

Status:Needs review» Reviewed & tested by the community

Just tested the patch and it works.

Thanks !

Status:Reviewed & tested by the community» Closed (fixed)