Skip to content

Fix KML preview failure caused by ol.featureloader#112

Merged
EricSoroos merged 1 commit intockan:masterfrom
jayvardhan:fix-kml-loader-ol-helpers
Nov 4, 2025
Merged

Fix KML preview failure caused by ol.featureloader#112
EricSoroos merged 1 commit intockan:masterfrom
jayvardhan:fix-kml-loader-ol-helpers

Conversation

@jayvardhan
Copy link

Fixes Uncaught TypeError: kmlLoader is undefined when loading KML files.

This patch addresses the issue #107 after the OpenLayers migration done in #102.

It replaces the use of global ol.featureloader API used in OL_HELPERS.createKMLLayer function, causing KML previews to fail with the browser error: Uncaught TypeError: can't access property "call", kmlLoader is undefined .

The ol.featureloader.loadFeaturesXhr(...) custom loader is replaced with OpenLayers 9–compatible approach using
ol.source.Vector configured with url, format, and ol.loadingstrategy.all restoring the KML preview functionality.

Tested on CKAN 2.11 ckanext-geoview ("ol": "9.2.4") with multiple .kml resources now render successfully in map previews.

@EricSoroos
Copy link

LGTM. Thanks for the fix.

@EricSoroos EricSoroos merged commit 97b3dce into ckan:master Nov 4, 2025
4 checks passed
@jayvardhan
Copy link
Author

@EricSoroos Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants