Transformed
This commit is contained in:
+11
-10
@@ -1,7 +1,7 @@
|
||||
goog.provide('ol.style.Atlas');
|
||||
|
||||
goog.require('ol.dom');
|
||||
|
||||
/**
|
||||
* @module ol/style/Atlas
|
||||
*/
|
||||
import _ol_dom_ from '../dom.js';
|
||||
|
||||
/**
|
||||
* This class facilitates the creation of image atlases.
|
||||
@@ -20,7 +20,7 @@ goog.require('ol.dom');
|
||||
* edges overlap when being rendered). To avoid this we add a
|
||||
* padding around each image.
|
||||
*/
|
||||
ol.style.Atlas = function(size, space) {
|
||||
var _ol_style_Atlas_ = function(size, space) {
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -44,7 +44,7 @@ ol.style.Atlas = function(size, space) {
|
||||
* @private
|
||||
* @type {CanvasRenderingContext2D}
|
||||
*/
|
||||
this.context_ = ol.dom.createCanvasContext2D(size, size);
|
||||
this.context_ = _ol_dom_.createCanvasContext2D(size, size);
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -58,7 +58,7 @@ ol.style.Atlas = function(size, space) {
|
||||
* @param {string} id The identifier of the entry to check.
|
||||
* @return {?ol.AtlasInfo} The atlas info.
|
||||
*/
|
||||
ol.style.Atlas.prototype.get = function(id) {
|
||||
_ol_style_Atlas_.prototype.get = function(id) {
|
||||
return this.entries_[id] || null;
|
||||
};
|
||||
|
||||
@@ -73,7 +73,7 @@ ol.style.Atlas.prototype.get = function(id) {
|
||||
* `renderCallback`.
|
||||
* @return {?ol.AtlasInfo} The position and atlas image for the entry.
|
||||
*/
|
||||
ol.style.Atlas.prototype.add = function(id, width, height, renderCallback, opt_this) {
|
||||
_ol_style_Atlas_.prototype.add = function(id, width, height, renderCallback, opt_this) {
|
||||
var block, i, ii;
|
||||
for (i = 0, ii = this.emptyBlocks_.length; i < ii; ++i) {
|
||||
block = this.emptyBlocks_[i];
|
||||
@@ -110,7 +110,7 @@ ol.style.Atlas.prototype.add = function(id, width, height, renderCallback, opt_t
|
||||
* @param {number} width The width of the entry to insert.
|
||||
* @param {number} height The height of the entry to insert.
|
||||
*/
|
||||
ol.style.Atlas.prototype.split_ = function(index, block, width, height) {
|
||||
_ol_style_Atlas_.prototype.split_ = function(index, block, width, height) {
|
||||
var deltaWidth = block.width - width;
|
||||
var deltaHeight = block.height - height;
|
||||
|
||||
@@ -168,7 +168,7 @@ ol.style.Atlas.prototype.split_ = function(index, block, width, height) {
|
||||
* @param {ol.AtlasBlock} newBlock1 The 1st block to add.
|
||||
* @param {ol.AtlasBlock} newBlock2 The 2nd block to add.
|
||||
*/
|
||||
ol.style.Atlas.prototype.updateBlocks_ = function(index, newBlock1, newBlock2) {
|
||||
_ol_style_Atlas_.prototype.updateBlocks_ = function(index, newBlock1, newBlock2) {
|
||||
var args = [index, 1];
|
||||
if (newBlock1.width > 0 && newBlock1.height > 0) {
|
||||
args.push(newBlock1);
|
||||
@@ -178,3 +178,4 @@ ol.style.Atlas.prototype.updateBlocks_ = function(index, newBlock1, newBlock2) {
|
||||
}
|
||||
this.emptyBlocks_.splice.apply(this.emptyBlocks_, args);
|
||||
};
|
||||
export default _ol_style_Atlas_;
|
||||
|
||||
Reference in New Issue
Block a user