Use === and !== for comparisons with 0
This commit is contained in:
@@ -28,7 +28,7 @@ ol.geom.squaredDistanceToSegment = function(coordinate, segment) {
|
||||
var v = segment[0];
|
||||
var w = segment[1];
|
||||
var l2 = ol.coordinate.squaredDistance(v, w);
|
||||
if (l2 == 0) {
|
||||
if (l2 === 0) {
|
||||
return ol.coordinate.squaredDistance(coordinate, v);
|
||||
}
|
||||
var t = ((coordinate[0] - v[0]) * (w[0] - v[0]) +
|
||||
|
||||
@@ -82,7 +82,7 @@ ol.interaction.TouchPan.prototype.handleTouchEnd =
|
||||
function(mapBrowserEvent) {
|
||||
var map = mapBrowserEvent.map;
|
||||
var view = map.getView();
|
||||
if (this.targetTouches.length == 0) {
|
||||
if (this.targetTouches.length === 0) {
|
||||
var interacting = view.setHint(ol.ViewHint.INTERACTING, -1);
|
||||
if (!this.noKinetic_ && this.kinetic_ && this.kinetic_.end()) {
|
||||
var distance = this.kinetic_.getDistance();
|
||||
|
||||
@@ -792,7 +792,7 @@ ol.Map.prototype.renderFrame_ = function(time) {
|
||||
|
||||
var i, ii, view2DState;
|
||||
|
||||
if (this.freezeRenderingCount_ != 0) {
|
||||
if (this.freezeRenderingCount_ !== 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -209,7 +209,7 @@ ol.MapBrowserEventHandler.prototype.click_ = function(browserEvent) {
|
||||
if (!this.dragged_) {
|
||||
var newEvent;
|
||||
var type = browserEvent.type;
|
||||
if (this.timestamp_ == 0 || type == goog.events.EventType.DBLCLICK) {
|
||||
if (this.timestamp_ === 0 || type == goog.events.EventType.DBLCLICK) {
|
||||
newEvent = new ol.MapBrowserEvent(
|
||||
ol.MapBrowserEvent.EventType.DBLCLICK, this.map_, browserEvent);
|
||||
this.dispatchEvent(newEvent);
|
||||
|
||||
@@ -417,7 +417,7 @@ ol.projection.removeTransform = function(source, destination) {
|
||||
var transform = transforms[sourceCode][destinationCode];
|
||||
delete transforms[sourceCode][destinationCode];
|
||||
var keys = goog.object.getKeys(transforms[sourceCode]);
|
||||
if (keys.length == 0) {
|
||||
if (keys.length === 0) {
|
||||
delete transforms[sourceCode];
|
||||
}
|
||||
return transform;
|
||||
|
||||
@@ -132,7 +132,7 @@ ol.renderer.canvas.Map.prototype.renderFrame = function(frameState) {
|
||||
|
||||
// for performance reasons, context.setTransform is only used
|
||||
// when the view is rotated. see http://jsperf.com/canvas-transform
|
||||
if (frameState.view2DState.rotation == 0) {
|
||||
if (frameState.view2DState.rotation === 0) {
|
||||
var dx = goog.vec.Mat4.getElement(transform, 0, 3);
|
||||
var dy = goog.vec.Mat4.getElement(transform, 1, 3);
|
||||
var dw = image.width * goog.vec.Mat4.getElement(transform, 0, 0);
|
||||
|
||||
Reference in New Issue
Block a user