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.

Members fund testing for the Drupal project. Drupal Association Learn more


jeffschuler’s picture

Status: Active » Needs review
1013 bytes

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.

jeffschuler’s picture

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

Pol’s picture

Status: Needs review » Reviewed & tested by the community

Just tested the patch and it works.

Thanks !

Pol’s picture

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