Simplify code in ol.render.Box#createGeometry_
This commit is contained in:
@@ -69,14 +69,12 @@ ol.render.Box.prototype.createGeometry_ = function() {
|
|||||||
var startPixel = this.startPixel_;
|
var startPixel = this.startPixel_;
|
||||||
var endPixel = this.endPixel_;
|
var endPixel = this.endPixel_;
|
||||||
var pixels = [
|
var pixels = [
|
||||||
[
|
startPixel,
|
||||||
startPixel,
|
[startPixel[0], endPixel[1]],
|
||||||
[startPixel[0], endPixel[1]],
|
endPixel,
|
||||||
endPixel,
|
[endPixel[0], startPixel[1]]
|
||||||
[endPixel[0], startPixel[1]]
|
|
||||||
]
|
|
||||||
];
|
];
|
||||||
var coordinates = goog.array.map(pixels[0],
|
var coordinates = goog.array.map(pixels,
|
||||||
this.map_.getCoordinateFromPixel, this.map_);
|
this.map_.getCoordinateFromPixel, this.map_);
|
||||||
// close the polygon
|
// close the polygon
|
||||||
coordinates[4] = coordinates[0].slice();
|
coordinates[4] = coordinates[0].slice();
|
||||||
|
|||||||
Reference in New Issue
Block a user