diff --git a/plugins/behaviors/openlayers_behavior_zoomtolayer.js b/plugins/behaviors/openlayers_behavior_zoomtolayer.js index db8506b..2ea2a69 100644 --- a/plugins/behaviors/openlayers_behavior_zoomtolayer.js +++ b/plugins/behaviors/openlayers_behavior_zoomtolayer.js @@ -47,6 +47,9 @@ Drupal.openlayers.addBehavior('openlayers_behavior_zoomtolayer', function (data, */ function handle_loadend_once(event) { var layer = event.object; + if (layer.features.length === 0) { + return; + } layer.events.unregister('loadend', layer, handle_loadend_once); accumulate_extent(layer);