Always use === to compare with 0
This commit is contained in:
@@ -66,7 +66,7 @@ ol.coordinate.closestOnSegment = function(coordinate, segment) {
|
||||
var y2 = end[1];
|
||||
var dx = x2 - x1;
|
||||
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);
|
||||
var x, y;
|
||||
if (along <= 0) {
|
||||
|
||||
@@ -1265,7 +1265,7 @@ ol.Map.prototype.renderFrame_ = function(time) {
|
||||
Array.prototype.push.apply(
|
||||
this.postRenderFunctions_, frameState.postRenderFunctions);
|
||||
|
||||
var idle = this.preRenderFunctions_.length == 0 &&
|
||||
var idle = this.preRenderFunctions_.length === 0 &&
|
||||
!frameState.animate &&
|
||||
!frameState.viewHints[ol.ViewHint.ANIMATING] &&
|
||||
!frameState.viewHints[ol.ViewHint.INTERACTING];
|
||||
|
||||
@@ -323,7 +323,7 @@ ol.MapBrowserEventHandler.prototype.isMouseActionButton_ =
|
||||
if (ol.LEGACY_IE_SUPPORT && ol.IS_LEGACY_IE) {
|
||||
return pointerEvent.button == 1;
|
||||
} else {
|
||||
return pointerEvent.button == 0;
|
||||
return pointerEvent.button === 0;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user