Merge pull request #1893 from twpayne/jshint-clean-ups
Check with JSHint
This commit is contained in:
@@ -5,6 +5,7 @@ before_install:
|
|||||||
- "git fetch origin refs/tags/v3.2.2:refs/tags/v3.2.2"
|
- "git fetch origin refs/tags/v3.2.2:refs/tags/v3.2.2"
|
||||||
- "git checkout tags/v3.2.2"
|
- "git checkout tags/v3.2.2"
|
||||||
- "cd ../.."
|
- "cd ../.."
|
||||||
|
- "npm install"
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- "./build.py plovr"
|
- "./build.py plovr"
|
||||||
|
|||||||
18
build.py
18
build.py
@@ -21,6 +21,7 @@ if sys.platform == 'win32':
|
|||||||
'JAVA': 'java.exe',
|
'JAVA': 'java.exe',
|
||||||
'JAR': 'jar.exe',
|
'JAR': 'jar.exe',
|
||||||
'JSDOC': 'jsdoc.cmd',
|
'JSDOC': 'jsdoc.cmd',
|
||||||
|
'JSHINT': './node_modules/.bin/jshint',
|
||||||
'PYTHON': 'python.exe',
|
'PYTHON': 'python.exe',
|
||||||
'PHANTOMJS': 'phantomjs.cmd'
|
'PHANTOMJS': 'phantomjs.cmd'
|
||||||
}
|
}
|
||||||
@@ -71,6 +72,7 @@ if sys.platform == 'win32':
|
|||||||
else:
|
else:
|
||||||
variables.GIT = 'git'
|
variables.GIT = 'git'
|
||||||
variables.GJSLINT = 'gjslint'
|
variables.GJSLINT = 'gjslint'
|
||||||
|
variables.JSHINT = './node_modules/.bin/jshint'
|
||||||
variables.JAVA = 'java'
|
variables.JAVA = 'java'
|
||||||
variables.JAR = 'jar'
|
variables.JAR = 'jar'
|
||||||
variables.JSDOC = 'jsdoc'
|
variables.JSDOC = 'jsdoc'
|
||||||
@@ -81,7 +83,8 @@ variables.BRANCH = output(
|
|||||||
'%(GIT)s', 'rev-parse', '--abbrev-ref', 'HEAD').strip()
|
'%(GIT)s', 'rev-parse', '--abbrev-ref', 'HEAD').strip()
|
||||||
|
|
||||||
EXECUTABLES = [variables.GIT, variables.GJSLINT, variables.JAVA, variables.JAR,
|
EXECUTABLES = [variables.GIT, variables.GJSLINT, variables.JAVA, variables.JAR,
|
||||||
variables.JSDOC, variables.PYTHON, variables.PHANTOMJS]
|
variables.JSDOC, variables.JSHINT, variables.PYTHON,
|
||||||
|
variables.PHANTOMJS]
|
||||||
|
|
||||||
EXPORTS = [path
|
EXPORTS = [path
|
||||||
for path in ifind('src')
|
for path in ifind('src')
|
||||||
@@ -164,7 +167,7 @@ def report_sizes(t):
|
|||||||
virtual('default', 'build')
|
virtual('default', 'build')
|
||||||
|
|
||||||
|
|
||||||
virtual('integration-test', 'lint', 'build', 'build-all',
|
virtual('integration-test', 'lint', 'jshint', 'build', 'build-all',
|
||||||
'test', 'build/examples/all.combined.js', 'check-examples', 'apidoc')
|
'test', 'build/examples/all.combined.js', 'check-examples', 'apidoc')
|
||||||
|
|
||||||
|
|
||||||
@@ -172,7 +175,7 @@ virtual('build', 'build/ol.css', 'build/ol.js',
|
|||||||
'build/ol-simple.js', 'build/ol-whitespace.js')
|
'build/ol-simple.js', 'build/ol-whitespace.js')
|
||||||
|
|
||||||
|
|
||||||
virtual('check', 'lint', 'build/ol-all.js', 'test')
|
virtual('check', 'lint', 'jshint', 'build/ol-all.js', 'test')
|
||||||
|
|
||||||
|
|
||||||
virtual('todo', 'fixme')
|
virtual('todo', 'fixme')
|
||||||
@@ -409,6 +412,15 @@ def build_lint_libtess_js_timestamp(t):
|
|||||||
t.touch()
|
t.touch()
|
||||||
|
|
||||||
|
|
||||||
|
virtual('jshint', 'build/jshint-timestamp')
|
||||||
|
|
||||||
|
|
||||||
|
@target('build/jshint-timestamp', SRC, EXAMPLES_SRC, SPEC, precious=True)
|
||||||
|
def build_jshint_timestamp(t):
|
||||||
|
t.run(variables.JSHINT, '--verbose', t.newer(t.dependencies))
|
||||||
|
t.touch()
|
||||||
|
|
||||||
|
|
||||||
def _strip_comments(lines):
|
def _strip_comments(lines):
|
||||||
# FIXME this is a horribe hack, we should use a proper JavaScript parser
|
# FIXME this is a horribe hack, we should use a proper JavaScript parser
|
||||||
# here
|
# here
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ $('#time').on('input', function(event) {
|
|||||||
var geometry = /** @type {ol.geom.LineString} */ (feature.getGeometry());
|
var geometry = /** @type {ol.geom.LineString} */ (feature.getGeometry());
|
||||||
var coordinate = geometry.getCoordinateAtM(m, true);
|
var coordinate = geometry.getCoordinateAtM(m, true);
|
||||||
var highlight = feature.get('highlight');
|
var highlight = feature.get('highlight');
|
||||||
if (highlight == undefined) {
|
if (highlight === undefined) {
|
||||||
highlight = new ol.Feature(new ol.geom.Point(coordinate));
|
highlight = new ol.Feature(new ol.geom.Point(coordinate));
|
||||||
feature.set('highlight', highlight);
|
feature.set('highlight', highlight);
|
||||||
featureOverlay.addFeature(highlight);
|
featureOverlay.addFeature(highlight);
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ goog.require('ol.style.Style');
|
|||||||
|
|
||||||
|
|
||||||
var styleFunction = (function() {
|
var styleFunction = (function() {
|
||||||
|
/* jshint -W069 */
|
||||||
var styles = {};
|
var styles = {};
|
||||||
var image = new ol.style.Circle({
|
var image = new ol.style.Circle({
|
||||||
radius: 5,
|
radius: 5,
|
||||||
@@ -57,6 +58,7 @@ var styleFunction = (function() {
|
|||||||
return function(feature, resolution) {
|
return function(feature, resolution) {
|
||||||
return styles[feature.getGeometry().getType()] || styles['default'];
|
return styles[feature.getGeometry().getType()] || styles['default'];
|
||||||
};
|
};
|
||||||
|
/* jshint +W069 */
|
||||||
})();
|
})();
|
||||||
|
|
||||||
var source = new ol.source.GeoJSON(
|
var source = new ol.source.GeoJSON(
|
||||||
@@ -165,6 +167,7 @@ var layer = new ol.layer.Vector({
|
|||||||
});
|
});
|
||||||
|
|
||||||
var overlayStyle = (function() {
|
var overlayStyle = (function() {
|
||||||
|
/* jshint -W069 */
|
||||||
var styles = {};
|
var styles = {};
|
||||||
styles['Polygon'] = [
|
styles['Polygon'] = [
|
||||||
new ol.style.Style({
|
new ol.style.Style({
|
||||||
@@ -225,6 +228,7 @@ var overlayStyle = (function() {
|
|||||||
return function(feature, resolution) {
|
return function(feature, resolution) {
|
||||||
return styles[feature.getGeometry().getType()];
|
return styles[feature.getGeometry().getType()];
|
||||||
};
|
};
|
||||||
|
/* jshint +W069 */
|
||||||
})();
|
})();
|
||||||
|
|
||||||
var select = new ol.interaction.Select({
|
var select = new ol.interaction.Select({
|
||||||
|
|||||||
@@ -68,7 +68,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="edit-form">
|
<div class="edit-form">
|
||||||
<input type="button" value="Refresh" onclick="refreshPoints();" />
|
<input id="refresh-points" type="button" value="Refresh" />
|
||||||
<h2>Points</h2>
|
<h2>Points</h2>
|
||||||
<div class="edit-form-elem">
|
<div class="edit-form-elem">
|
||||||
<label>Text: </label>
|
<label>Text: </label>
|
||||||
@@ -157,7 +157,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="edit-form">
|
<div class="edit-form">
|
||||||
<input type="button" value="Refresh" onclick="refreshLines();" />
|
<input id="refresh-lines" type="button" value="Refresh" />
|
||||||
<h2>Lines</h2>
|
<h2>Lines</h2>
|
||||||
<div class="edit-form-elem">
|
<div class="edit-form-elem">
|
||||||
<label>Text: </label>
|
<label>Text: </label>
|
||||||
@@ -246,7 +246,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="edit-form">
|
<div class="edit-form">
|
||||||
<input type="button" value="Refresh" onclick="refreshPolygons();" />
|
<input id="refresh-polygons" type="button" value="Refresh" />
|
||||||
<h2>Polygons</h2>
|
<h2>Polygons</h2>
|
||||||
<div class="edit-form-elem">
|
<div class="edit-form-elem">
|
||||||
<label>Text: </label>
|
<label>Text: </label>
|
||||||
|
|||||||
@@ -13,56 +13,56 @@ goog.require('ol.style.Text');
|
|||||||
|
|
||||||
|
|
||||||
var myDom = {
|
var myDom = {
|
||||||
'points': {
|
points: {
|
||||||
'text': document.getElementById('points-text'),
|
text: document.getElementById('points-text'),
|
||||||
'align': document.getElementById('points-align'),
|
align: document.getElementById('points-align'),
|
||||||
'baseline': document.getElementById('points-baseline'),
|
baseline: document.getElementById('points-baseline'),
|
||||||
'rotation': document.getElementById('points-rotation'),
|
rotation: document.getElementById('points-rotation'),
|
||||||
'font': document.getElementById('points-font'),
|
font: document.getElementById('points-font'),
|
||||||
'weight': document.getElementById('points-weight'),
|
weight: document.getElementById('points-weight'),
|
||||||
'size': document.getElementById('points-size'),
|
size: document.getElementById('points-size'),
|
||||||
'offset-x': document.getElementById('points-offset-x'),
|
offsetX: document.getElementById('points-offset-x'),
|
||||||
'offset-y': document.getElementById('points-offset-y'),
|
offsetY: document.getElementById('points-offset-y'),
|
||||||
'color': document.getElementById('points-color'),
|
color: document.getElementById('points-color'),
|
||||||
'outline': document.getElementById('points-outline'),
|
outline: document.getElementById('points-outline'),
|
||||||
'outline-width': document.getElementById('points-outline-width'),
|
outlineWidth: document.getElementById('points-outline-width'),
|
||||||
'maxreso': document.getElementById('points-maxreso')
|
maxreso: document.getElementById('points-maxreso')
|
||||||
},
|
},
|
||||||
'lines': {
|
lines: {
|
||||||
'text': document.getElementById('lines-text'),
|
text: document.getElementById('lines-text'),
|
||||||
'align': document.getElementById('lines-align'),
|
align: document.getElementById('lines-align'),
|
||||||
'baseline': document.getElementById('lines-baseline'),
|
baseline: document.getElementById('lines-baseline'),
|
||||||
'rotation': document.getElementById('lines-rotation'),
|
rotation: document.getElementById('lines-rotation'),
|
||||||
'font': document.getElementById('lines-font'),
|
font: document.getElementById('lines-font'),
|
||||||
'weight': document.getElementById('lines-weight'),
|
weight: document.getElementById('lines-weight'),
|
||||||
'size': document.getElementById('lines-size'),
|
size: document.getElementById('lines-size'),
|
||||||
'offset-x': document.getElementById('lines-offset-x'),
|
offsetX: document.getElementById('lines-offset-x'),
|
||||||
'offset-y': document.getElementById('lines-offset-y'),
|
offsetY: document.getElementById('lines-offset-y'),
|
||||||
'color': document.getElementById('lines-color'),
|
color: document.getElementById('lines-color'),
|
||||||
'outline': document.getElementById('lines-outline'),
|
outline: document.getElementById('lines-outline'),
|
||||||
'outline-width': document.getElementById('lines-outline-width'),
|
outlineWidth: document.getElementById('lines-outline-width'),
|
||||||
'maxreso': document.getElementById('lines-maxreso')
|
maxreso: document.getElementById('lines-maxreso')
|
||||||
},
|
},
|
||||||
'polygons': {
|
polygons: {
|
||||||
'text': document.getElementById('polygons-text'),
|
text: document.getElementById('polygons-text'),
|
||||||
'align': document.getElementById('polygons-align'),
|
align: document.getElementById('polygons-align'),
|
||||||
'baseline': document.getElementById('polygons-baseline'),
|
baseline: document.getElementById('polygons-baseline'),
|
||||||
'rotation': document.getElementById('polygons-rotation'),
|
rotation: document.getElementById('polygons-rotation'),
|
||||||
'font': document.getElementById('polygons-font'),
|
font: document.getElementById('polygons-font'),
|
||||||
'weight': document.getElementById('polygons-weight'),
|
weight: document.getElementById('polygons-weight'),
|
||||||
'size': document.getElementById('polygons-size'),
|
size: document.getElementById('polygons-size'),
|
||||||
'offset-x': document.getElementById('polygons-offset-x'),
|
offsetX: document.getElementById('polygons-offset-x'),
|
||||||
'offset-y': document.getElementById('polygons-offset-y'),
|
offsetY: document.getElementById('polygons-offset-y'),
|
||||||
'color': document.getElementById('polygons-color'),
|
color: document.getElementById('polygons-color'),
|
||||||
'outline': document.getElementById('polygons-outline'),
|
outline: document.getElementById('polygons-outline'),
|
||||||
'outline-width': document.getElementById('polygons-outline-width'),
|
outlineWidth: document.getElementById('polygons-outline-width'),
|
||||||
'maxreso': document.getElementById('polygons-maxreso')
|
maxreso: document.getElementById('polygons-maxreso')
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var getText = function(feature, resolution, dom) {
|
var getText = function(feature, resolution, dom) {
|
||||||
var type = dom['text'].value;
|
var type = dom.text.value;
|
||||||
var maxResolution = dom['maxreso'].value;
|
var maxResolution = dom.maxreso.value;
|
||||||
var text = feature.getProperties().name;
|
var text = feature.getProperties().name;
|
||||||
|
|
||||||
if (resolution > maxResolution) {
|
if (resolution > maxResolution) {
|
||||||
@@ -80,17 +80,17 @@ var getText = function(feature, resolution, dom) {
|
|||||||
|
|
||||||
|
|
||||||
var createTextStyle = function(feature, resolution, dom) {
|
var createTextStyle = function(feature, resolution, dom) {
|
||||||
var align = dom['align'].value;
|
var align = dom.align.value;
|
||||||
var baseline = dom['baseline'].value;
|
var baseline = dom.baseline.value;
|
||||||
var size = dom['size'].value;
|
var size = dom.size.value;
|
||||||
var offsetX = parseInt(dom['offset-x'].value, 10);
|
var offsetX = parseInt(dom.offsetX.value, 10);
|
||||||
var offsetY = parseInt(dom['offset-y'].value, 10);
|
var offsetY = parseInt(dom.offsetY.value, 10);
|
||||||
var weight = dom['weight'].value;
|
var weight = dom.weight.value;
|
||||||
var rotation = parseFloat(dom['rotation'].value);
|
var rotation = parseFloat(dom.rotation.value);
|
||||||
var font = weight + ' ' + size + ' ' + dom['font'].value;
|
var font = weight + ' ' + size + ' ' + dom.font.value;
|
||||||
var fillColor = dom['color'].value;
|
var fillColor = dom.color.value;
|
||||||
var outlineColor = dom['outline'].value;
|
var outlineColor = dom.outline.value;
|
||||||
var outlineWidth = parseInt(dom['outline-width'].value, 10);
|
var outlineWidth = parseInt(dom.outlineWidth.value, 10);
|
||||||
|
|
||||||
return new ol.style.Text({
|
return new ol.style.Text({
|
||||||
textAlign: align,
|
textAlign: align,
|
||||||
@@ -195,17 +195,17 @@ var map = new ol.Map({
|
|||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
var refreshPoints = function() {
|
$('#refresh-points').click(function() {
|
||||||
vectorPoints.setStyle(createPointStyleFunction());
|
vectorPoints.setStyle(createPointStyleFunction());
|
||||||
};
|
});
|
||||||
|
|
||||||
var refreshLines = function() {
|
$('#refresh-lines').click(function() {
|
||||||
vectorLines.setStyle(createLineStyleFunction());
|
vectorLines.setStyle(createLineStyleFunction());
|
||||||
};
|
});
|
||||||
|
|
||||||
var refreshPolygons = function() {
|
$('#refresh-polygons').click(function() {
|
||||||
vectorPolygons.setStyle(createPolygonStyleFunction());
|
vectorPolygons.setStyle(createPolygonStyleFunction());
|
||||||
};
|
});
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -52,3 +52,22 @@ Document.prototype.msFullscreenEnabled;
|
|||||||
|
|
||||||
/** @type {Element} */
|
/** @type {Element} */
|
||||||
Document.prototype.msFullscreenElement;
|
Document.prototype.msFullscreenElement;
|
||||||
|
|
||||||
|
|
||||||
|
/** @type {number} */
|
||||||
|
Touch.prototype.force;
|
||||||
|
|
||||||
|
/** @type {number} */
|
||||||
|
Touch.prototype.radiusX;
|
||||||
|
|
||||||
|
/** @type {number} */
|
||||||
|
Touch.prototype.radiusY;
|
||||||
|
|
||||||
|
/** @type {number} */
|
||||||
|
Touch.prototype.webkitForce;
|
||||||
|
|
||||||
|
/** @type {number} */
|
||||||
|
Touch.prototype.webkitRadiusX;
|
||||||
|
|
||||||
|
/** @type {number} */
|
||||||
|
Touch.prototype.webkitRadiusY;
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"closure-util": "~0.8.2",
|
"closure-util": "~0.8.2",
|
||||||
"async": "~0.2.10",
|
"async": "~0.2.10",
|
||||||
"htmlparser2": "~3.4.0"
|
"htmlparser2": "~3.4.0",
|
||||||
|
"jshint": "~2.4.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ ol.coordinate.closestOnSegment = function(coordinate, segment) {
|
|||||||
var y2 = end[1];
|
var y2 = end[1];
|
||||||
var dx = x2 - x1;
|
var dx = x2 - x1;
|
||||||
var dy = y2 - y1;
|
var dy = y2 - y1;
|
||||||
var along = (dx == 0 && dy == 0) ? 0 :
|
var along = (dx === 0 && dy === 0) ? 0 :
|
||||||
((dx * (x0 - x1)) + (dy * (y0 - y1))) / ((dx * dx + dy * dy) || 0);
|
((dx * (x0 - x1)) + (dy * (y0 - y1))) / ((dx * dx + dy * dy) || 0);
|
||||||
var x, y;
|
var x, y;
|
||||||
if (along <= 0) {
|
if (along <= 0) {
|
||||||
|
|||||||
@@ -1632,9 +1632,10 @@ ol.format.GML.GEOMETRY_NODE_FACTORY_ = function(value, objectStack,
|
|||||||
var multiCurve = goog.object.get(context, 'multiCurve');
|
var multiCurve = goog.object.get(context, 'multiCurve');
|
||||||
var parentNode = objectStack[objectStack.length - 1].node;
|
var parentNode = objectStack[objectStack.length - 1].node;
|
||||||
goog.asserts.assert(ol.xml.isNode(parentNode));
|
goog.asserts.assert(ol.xml.isNode(parentNode));
|
||||||
|
var nodeName;
|
||||||
if (!goog.isArray(value)) {
|
if (!goog.isArray(value)) {
|
||||||
goog.asserts.assertInstanceof(value, ol.geom.Geometry);
|
goog.asserts.assertInstanceof(value, ol.geom.Geometry);
|
||||||
var nodeName = value.getType();
|
nodeName = value.getType();
|
||||||
if (nodeName === 'MultiPolygon' && multiSurface === true) {
|
if (nodeName === 'MultiPolygon' && multiSurface === true) {
|
||||||
nodeName = 'MultiSurface';
|
nodeName = 'MultiSurface';
|
||||||
} else if (nodeName === 'Polygon' && surface === true) {
|
} else if (nodeName === 'Polygon' && surface === true) {
|
||||||
|
|||||||
@@ -490,6 +490,7 @@ ol.format.GPX.writeWptType_ = function(node, coordinate, objectStack) {
|
|||||||
ol.xml.setAttributeNS(node, null, 'lat', coordinate[1]);
|
ol.xml.setAttributeNS(node, null, 'lat', coordinate[1]);
|
||||||
ol.xml.setAttributeNS(node, null, 'lon', coordinate[0]);
|
ol.xml.setAttributeNS(node, null, 'lon', coordinate[0]);
|
||||||
var geometryLayout = goog.object.get(context, 'geometryLayout');
|
var geometryLayout = goog.object.get(context, 'geometryLayout');
|
||||||
|
/* jshint -W086 */
|
||||||
switch (geometryLayout) {
|
switch (geometryLayout) {
|
||||||
case ol.geom.GeometryLayout.XYZM:
|
case ol.geom.GeometryLayout.XYZM:
|
||||||
if (coordinate[3] !== 0) {
|
if (coordinate[3] !== 0) {
|
||||||
@@ -505,6 +506,7 @@ ol.format.GPX.writeWptType_ = function(node, coordinate, objectStack) {
|
|||||||
goog.object.set(properties, 'time', coordinate[2]);
|
goog.object.set(properties, 'time', coordinate[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/* jshint +W086 */
|
||||||
var orderedKeys = ol.format.GPX.WPT_TYPE_SEQUENCE_[namespaceURI];
|
var orderedKeys = ol.format.GPX.WPT_TYPE_SEQUENCE_[namespaceURI];
|
||||||
var values = ol.xml.makeSequence(properties, orderedKeys);
|
var values = ol.xml.makeSequence(properties, orderedKeys);
|
||||||
ol.xml.pushSerializeAndPop(/** @type {ol.xml.NodeStackItem} */
|
ol.xml.pushSerializeAndPop(/** @type {ol.xml.NodeStackItem} */
|
||||||
|
|||||||
@@ -1265,7 +1265,7 @@ ol.Map.prototype.renderFrame_ = function(time) {
|
|||||||
Array.prototype.push.apply(
|
Array.prototype.push.apply(
|
||||||
this.postRenderFunctions_, frameState.postRenderFunctions);
|
this.postRenderFunctions_, frameState.postRenderFunctions);
|
||||||
|
|
||||||
var idle = this.preRenderFunctions_.length == 0 &&
|
var idle = this.preRenderFunctions_.length === 0 &&
|
||||||
!frameState.animate &&
|
!frameState.animate &&
|
||||||
!frameState.viewHints[ol.ViewHint.ANIMATING] &&
|
!frameState.viewHints[ol.ViewHint.ANIMATING] &&
|
||||||
!frameState.viewHints[ol.ViewHint.INTERACTING];
|
!frameState.viewHints[ol.ViewHint.INTERACTING];
|
||||||
|
|||||||
@@ -323,7 +323,7 @@ ol.MapBrowserEventHandler.prototype.isMouseActionButton_ =
|
|||||||
if (ol.LEGACY_IE_SUPPORT && ol.IS_LEGACY_IE) {
|
if (ol.LEGACY_IE_SUPPORT && ol.IS_LEGACY_IE) {
|
||||||
return pointerEvent.button == 1;
|
return pointerEvent.button == 1;
|
||||||
} else {
|
} else {
|
||||||
return pointerEvent.button == 0;
|
return pointerEvent.button === 0;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -193,9 +193,9 @@ ol.pointer.TouchSource.prototype.touchToPointer_ =
|
|||||||
e.detail = this.clickCount_;
|
e.detail = this.clickCount_;
|
||||||
e.button = 0;
|
e.button = 0;
|
||||||
e.buttons = 1;
|
e.buttons = 1;
|
||||||
e.width = inTouch['webkitRadiusX'] || inTouch['radiusX'] || 0;
|
e.width = inTouch.webkitRadiusX || inTouch.radiusX || 0;
|
||||||
e.height = inTouch['webkitRadiusY'] || inTouch['radiusY'] || 0;
|
e.height = inTouch.webkitRadiusY || inTouch.radiusY || 0;
|
||||||
e.pressure = inTouch['webkitForce'] || inTouch['force'] || 0.5;
|
e.pressure = inTouch.webkitForce || inTouch.force || 0.5;
|
||||||
e.isPrimary = this.isPrimaryTouch_(inTouch);
|
e.isPrimary = this.isPrimaryTouch_(inTouch);
|
||||||
e.pointerType = ol.pointer.TouchSource.POINTER_TYPE;
|
e.pointerType = ol.pointer.TouchSource.POINTER_TYPE;
|
||||||
|
|
||||||
|
|||||||
@@ -272,7 +272,9 @@ ol.source.ImageWMS.prototype.getRequestUrl_ =
|
|||||||
params[this.v13_ ? 'CRS' : 'SRS'] = projection.getCode();
|
params[this.v13_ ? 'CRS' : 'SRS'] = projection.getCode();
|
||||||
|
|
||||||
if (!('STYLES' in this.params_)) {
|
if (!('STYLES' in this.params_)) {
|
||||||
|
/* jshint -W053 */
|
||||||
goog.object.set(params, 'STYLES', new String(''));
|
goog.object.set(params, 'STYLES', new String(''));
|
||||||
|
/* jshint +W053 */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pixelRatio != 1) {
|
if (pixelRatio != 1) {
|
||||||
|
|||||||
@@ -237,7 +237,9 @@ ol.source.TileWMS.prototype.getRequestUrl_ =
|
|||||||
params[this.v13_ ? 'CRS' : 'SRS'] = projection.getCode();
|
params[this.v13_ ? 'CRS' : 'SRS'] = projection.getCode();
|
||||||
|
|
||||||
if (!('STYLES' in this.params_)) {
|
if (!('STYLES' in this.params_)) {
|
||||||
|
/* jshint -W053 */
|
||||||
goog.object.set(params, 'STYLES', new String(''));
|
goog.object.set(params, 'STYLES', new String(''));
|
||||||
|
/* jshint +W053 */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pixelRatio != 1) {
|
if (pixelRatio != 1) {
|
||||||
|
|||||||
@@ -243,6 +243,8 @@ ol.source.WMTS.prototype.updateDimensions = function(dimensions) {
|
|||||||
*/
|
*/
|
||||||
ol.source.WMTS.optionsFromCapabilities = function(wmtsCap, layer) {
|
ol.source.WMTS.optionsFromCapabilities = function(wmtsCap, layer) {
|
||||||
|
|
||||||
|
/* jshint -W069 */
|
||||||
|
|
||||||
// TODO: add support for TileMatrixLimits
|
// TODO: add support for TileMatrixLimits
|
||||||
|
|
||||||
var layers = wmtsCap['contents']['layers'];
|
var layers = wmtsCap['contents']['layers'];
|
||||||
@@ -328,4 +330,7 @@ ol.source.WMTS.optionsFromCapabilities = function(wmtsCap, layer) {
|
|||||||
style: style,
|
style: style,
|
||||||
dimensions: dimensions
|
dimensions: dimensions
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* jshint +W069 */
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -118,8 +118,7 @@ describe('ol.pointer.TouchSource', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
function simulateTouchEvent(type, changedTouches, touches) {
|
function simulateTouchEvent(type, changedTouches, touches) {
|
||||||
var touches = goog.isDef(touches) ?
|
touches = goog.isDef(touches) ? touches : changedTouches;
|
||||||
touches : changedTouches;
|
|
||||||
|
|
||||||
var event = new goog.events.BrowserEvent({
|
var event = new goog.events.BrowserEvent({
|
||||||
type: type,
|
type: type,
|
||||||
|
|||||||
@@ -285,7 +285,7 @@ describe('ol.proj', function() {
|
|||||||
units: units,
|
units: units,
|
||||||
extent: extent
|
extent: extent
|
||||||
});
|
});
|
||||||
var transform = function(input, output, dimension) {return input};
|
var transform = function(input, output, dimension) {return input;};
|
||||||
ol.proj.addTransform(foo, bar, transform);
|
ol.proj.addTransform(foo, bar, transform);
|
||||||
expect(ol.proj.transforms_).not.to.be(undefined);
|
expect(ol.proj.transforms_).not.to.be(undefined);
|
||||||
expect(ol.proj.transforms_.foo).not.to.be(undefined);
|
expect(ol.proj.transforms_.foo).not.to.be(undefined);
|
||||||
|
|||||||
Reference in New Issue
Block a user