Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OpenLayers v5/6 compatibility #156

Merged
merged 2 commits into from
Nov 17, 2019
Merged

Add OpenLayers v5/6 compatibility #156

merged 2 commits into from
Nov 17, 2019

Conversation

ThomasG77
Copy link
Contributor

The code for OpenLayers 6 was failing due to ol.inherits removal in OpenLayers 6 (release notes reference). I've made correction with a "if else" to manage code for both OpenLayers 5 and 6. My choice has been to not create a function as there was only one call to inherits in the ol3-sidebar.js base code. I've borrowed the logic from https://gis.stackexchange.com/a/324607 without using a function.
Need a review.

A suggestion after this commit would be to remove reference to ol3-sidebar.js and rename it to ol-sidebar.js, do the same for ol3-sidebar.css (would be ol-sidebar.css) and change the doc to mention OpenLayers 3+ (version is now 6.1.1)

@ThomasG77 ThomasG77 changed the title Upgrade to ol6 script and css and manage OpenLayers v5/6 compatibility Upgrade script and css for OpenLayers 6 and manage OpenLayers v5/6 compatibility Nov 15, 2019
examples/ol3.html Show resolved Hide resolved
examples/ol3.html Show resolved Hide resolved
@Turbo87 Turbo87 changed the title Upgrade script and css for OpenLayers 6 and manage OpenLayers v5/6 compatibility Improve OpenLayers v5/6 compatibility Nov 16, 2019
@Turbo87 Turbo87 changed the title Improve OpenLayers v5/6 compatibility Add OpenLayers v5/6 compatibility Nov 16, 2019
@walkermatt
Copy link

Just to say that I've just bumped into the issue with ol.inherits no longer being available while updating the ol-layerswitcher example that used the sidebar.

@Turbo87 Turbo87 merged commit 4c389ec into Turbo87:master Nov 17, 2019
@ThomasG77 ThomasG77 deleted the fix-ol-compatibility-v5-and-6 branch November 17, 2019 13:15
@Turbo87 Turbo87 mentioned this pull request Nov 21, 2019
paultcochrane added a commit to paultcochrane/sidebar-v2 that referenced this pull request Nov 28, 2019
This change implements the suggestion mentioned in Turbo87#156 to rename the
source files from `ol3` to simply `ol` so as to reflect the
compatibility from OpenLayers 3 up to and including OpenLayers 6.

The example file as well as the documentation have been updated to be
consistent with the filename generalisation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants