Skip to content

Commit

Permalink
Add OpenLayers v5/6 compatibility (#156)
Browse files Browse the repository at this point in the history
* Upgrade to ol6 and manage v5/6 compatibility

* Add minified version of corrected js file
  • Loading branch information
ThomasG77 authored and Turbo87 committed Nov 17, 2019
1 parent 06cc675 commit 4c389ec
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions examples/ol3.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
<link rel="stylesheet" href="//openlayers.org/en/v4.6.5/css/ol.css" type="text/css">
<link rel="stylesheet" href="//cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.1.1/css/ol.css" type="text/css">

<link rel="stylesheet" href="../css/ol3-sidebar.css" />

Expand Down Expand Up @@ -81,7 +81,7 @@ <h1 class="sidebar-header">Settings<span class="sidebar-close"><i class="fa fa-c

<a href="https://github.com/Turbo87/sidebar-v2/"><img style="position: fixed; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub"></a>

<script src="//openlayers.org/en/v4.6.5/build/ol.js" type="text/javascript"></script>
<script src="//cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.1.1/build/ol.js"></script>
<script src="../js/ol3-sidebar.js"></script>

<script>
Expand Down
7 changes: 6 additions & 1 deletion js/ol3-sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,12 @@ ol.control.Sidebar = function (settings) {
}
};

ol.inherits(ol.control.Sidebar, ol.control.Control);
if ('inherits' in ol) {
ol.inherits(ol.control.Sidebar, ol.control.Control);
} else {
ol.control.Sidebar.prototype = Object.create(ol.control.Control.prototype);
ol.control.Sidebar.prototype.constructor = ol.control.Sidebar;
}

ol.control.Sidebar.prototype.setMap = function(map) {
var i, child;
Expand Down
2 changes: 1 addition & 1 deletion js/ol3-sidebar.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4c389ec

Please sign in to comment.