Skip to content

Commit

Permalink
[BUID] + lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Viglino committed Dec 20, 2021
1 parent f325970 commit 5af20f1
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 16 deletions.
14 changes: 8 additions & 6 deletions dist/ol-ext.js
Original file line number Diff line number Diff line change
Expand Up @@ -6878,7 +6878,7 @@ ol.control.Dialog.prototype.setContent = function(options) {
if (this.get('zoom')) this.element.classList.add('ol-zoom');
else this.element.classList.remove('ol-zoom');
if (options.className) {
options.className.split(' ').forEach(function(c) {
options.className.split(' ').forEach(function() {
this.element.classList.add(options.className);
}.bind(this));
}
Expand Down Expand Up @@ -13275,10 +13275,12 @@ ol.control.SearchGPS.prototype._createForm = function () {
var latd = createInput('ol-dms','°');
var latm = createInput('ol-dms','\'');
var lats = createInput('ol-dms','"');
// Focus
this.button.addEventListener("click", function() {
lon.focus();
});
// Focus on open
if (this.button) {
this.button.addEventListener("click", function() {
lon.focus();
});
}
// Change value on click
this.on('select', function(e){
lon.value = e.search.gps[0];
Expand Down Expand Up @@ -14942,7 +14944,7 @@ ol.control.Swipe.prototype.addLayer = function(layers, right) {
};
/** Remove all layers
*/
ol.control.Swipe.prototype.removeLayers = function(layers) {
ol.control.Swipe.prototype.removeLayers = function() {
var layers = [];
this.layers.forEach(function(l) { layers.push(l.layer); });
this.removeLayer(layers)
Expand Down
2 changes: 1 addition & 1 deletion dist/ol-ext.min.js

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions examples/search/map.control.searchgps.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<!----------------------------------------------------------
<!--
Copyright (c) 2017-2018 Jean-Marc VIGLINO,
released under CeCILL-B (french BSD like) licence: http://www.cecill.info/
------------------------------------------------------------>
-->
<title>ol-ext: Search GPS control</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

Expand Down Expand Up @@ -73,6 +71,7 @@ <h1>ol-ext: Search GPS control</h1>

// Set the control grid reference
var search = new ol.control.SearchGPS({
// target: $('.options').get(0)
});
map.addControl (search);

Expand Down
10 changes: 6 additions & 4 deletions src/control/SearchGPS.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,12 @@ ol_control_SearchGPS.prototype._createForm = function () {
var latm = createInput('ol-dms','\'');
var lats = createInput('ol-dms','"');

// Focus
this.button.addEventListener("click", function() {
lon.focus();
});
// Focus on open
if (this.button) {
this.button.addEventListener("click", function() {
lon.focus();
});
}

// Change value on click
this.on('select', function(e){
Expand Down
2 changes: 1 addition & 1 deletion src/control/Swipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ ol_control_Swipe.prototype.addLayer = function(layers, right) {

/** Remove all layers
*/
ol_control_Swipe.prototype.removeLayers = function(layers) {
ol_control_Swipe.prototype.removeLayers = function() {
var layers = [];
this.layers.forEach(function(l) { layers.push(l.layer); });
this.removeLayer(layers)
Expand Down

0 comments on commit 5af20f1

Please sign in to comment.