diff --git a/src/geometry/Point.js b/src/geometry/Point.js index b899f6aa..9bc0267c 100644 --- a/src/geometry/Point.js +++ b/src/geometry/Point.js @@ -55,11 +55,11 @@ L.Point.prototype = { return this; }, - dotProduct: function(point) { + scaleBy: function(point) { return new L.Point(this.x * point.x, this.y * point.y); }, - dotDivision: function(point) { + unscaleBy: function(point) { return new L.Point(this.x / point.x, this.y / point.y); }, diff --git a/src/layer/tile/GridLayer.js b/src/layer/tile/GridLayer.js index c2e0a7f2..bf9e83e4 100644 --- a/src/layer/tile/GridLayer.js +++ b/src/layer/tile/GridLayer.js @@ -513,7 +513,7 @@ L.GridLayer = L.Layer.extend({ var map = this._map, tileSize = this.getTileSize(), - nwPoint = coords.dotProduct(tileSize), + nwPoint = coords.scaleBy(tileSize), sePoint = nwPoint.add(tileSize), nw = map.wrapLatLng(map.unproject(nwPoint, coords.z)), @@ -644,7 +644,7 @@ L.GridLayer = L.Layer.extend({ }, _getTilePos: function (coords) { - return coords.dotProduct(this.getTileSize()).subtract(this._level.origin); + return coords.scaleBy(this.getTileSize()).subtract(this._level.origin); }, _wrapCoords: function (coords) { @@ -658,8 +658,8 @@ L.GridLayer = L.Layer.extend({ _pxBoundsToTileRange: function (bounds) { var tileSize = this.getTileSize(); return new L.Bounds( - bounds.min.dotDivision(tileSize).floor(), - bounds.max.dotDivision(tileSize).ceil().subtract([1, 1])); + bounds.min.unscaleBy(tileSize).floor(), + bounds.max.unscaleBy(tileSize).ceil().subtract([1, 1])); }, _noTilesToLoad: function () {