Rename _ol_style_Icon_ to Icon
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import {getUid} from '../../../../src/ol/index.js';
|
||||
import {iconImageCache} from '../../../../src/ol/style.js';
|
||||
import _ol_style_Icon_ from '../../../../src/ol/style/Icon.js';
|
||||
import Icon from '../../../../src/ol/style/Icon.js';
|
||||
import _ol_style_IconImage_ from '../../../../src/ol/style/IconImage.js';
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ describe('ol.style.Icon', function() {
|
||||
|
||||
it('caches canvas images with a uid as src', function() {
|
||||
var canvas = document.createElement('canvas');
|
||||
new _ol_style_Icon_({
|
||||
new Icon({
|
||||
img: canvas,
|
||||
imgSize: size
|
||||
});
|
||||
@@ -22,7 +22,7 @@ describe('ol.style.Icon', function() {
|
||||
});
|
||||
|
||||
it('imgSize overrides img.width and img.height', function(done) {
|
||||
var style = new _ol_style_Icon_({
|
||||
var style = new Icon({
|
||||
src: src,
|
||||
imgSize: size
|
||||
});
|
||||
@@ -39,17 +39,17 @@ describe('ol.style.Icon', function() {
|
||||
describe('#clone', function() {
|
||||
|
||||
it('creates a new ol.style.Icon', function() {
|
||||
var original = new _ol_style_Icon_({
|
||||
var original = new Icon({
|
||||
src: src
|
||||
});
|
||||
var clone = original.clone();
|
||||
expect(clone).to.be.an(_ol_style_Icon_);
|
||||
expect(clone).to.be.an(Icon);
|
||||
expect(clone).to.not.be(original);
|
||||
});
|
||||
|
||||
it('copies all values ', function() {
|
||||
var canvas = document.createElement('canvas');
|
||||
var original = new _ol_style_Icon_({
|
||||
var original = new Icon({
|
||||
anchor: [1, 0],
|
||||
anchorOrigin: 'bottom-right',
|
||||
anchorXUnits: 'pixels',
|
||||
@@ -85,7 +85,7 @@ describe('ol.style.Icon', function() {
|
||||
expect(original.getRotateWithView()).to.eql(clone.getRotateWithView());
|
||||
expect(original.getSnapToPixel()).to.eql(clone.getSnapToPixel());
|
||||
|
||||
var original2 = new _ol_style_Icon_({
|
||||
var original2 = new Icon({
|
||||
src: src
|
||||
});
|
||||
var clone2 = original2.clone();
|
||||
@@ -95,7 +95,7 @@ describe('ol.style.Icon', function() {
|
||||
});
|
||||
|
||||
it('the clone does not reference the same objects as the original', function() {
|
||||
var original = new _ol_style_Icon_({
|
||||
var original = new Icon({
|
||||
anchor: [1, 0],
|
||||
color: [1, 2, 3, 0.4],
|
||||
src: src,
|
||||
@@ -123,7 +123,7 @@ describe('ol.style.Icon', function() {
|
||||
var fractionAnchor = [0.25, 0.25];
|
||||
|
||||
it('uses fractional units by default', function() {
|
||||
var iconStyle = new _ol_style_Icon_({
|
||||
var iconStyle = new Icon({
|
||||
src: 'test.png',
|
||||
size: size,
|
||||
anchor: fractionAnchor
|
||||
@@ -132,7 +132,7 @@ describe('ol.style.Icon', function() {
|
||||
});
|
||||
|
||||
it('uses pixels units', function() {
|
||||
var iconStyle = new _ol_style_Icon_({
|
||||
var iconStyle = new Icon({
|
||||
src: 'test.png',
|
||||
size: size,
|
||||
anchor: [2, 18],
|
||||
@@ -143,7 +143,7 @@ describe('ol.style.Icon', function() {
|
||||
});
|
||||
|
||||
it('uses a bottom left anchor origin', function() {
|
||||
var iconStyle = new _ol_style_Icon_({
|
||||
var iconStyle = new Icon({
|
||||
src: 'test.png',
|
||||
size: size,
|
||||
anchor: fractionAnchor,
|
||||
@@ -153,7 +153,7 @@ describe('ol.style.Icon', function() {
|
||||
});
|
||||
|
||||
it('uses a bottom right anchor origin', function() {
|
||||
var iconStyle = new _ol_style_Icon_({
|
||||
var iconStyle = new Icon({
|
||||
src: 'test.png',
|
||||
size: size,
|
||||
anchor: fractionAnchor,
|
||||
@@ -163,7 +163,7 @@ describe('ol.style.Icon', function() {
|
||||
});
|
||||
|
||||
it('uses a top right anchor origin', function() {
|
||||
var iconStyle = new _ol_style_Icon_({
|
||||
var iconStyle = new Icon({
|
||||
src: 'test.png',
|
||||
size: size,
|
||||
anchor: fractionAnchor,
|
||||
@@ -178,7 +178,7 @@ describe('ol.style.Icon', function() {
|
||||
var imageSize = [144, 192];
|
||||
|
||||
it('uses a top left offset origin (default)', function() {
|
||||
var iconStyle = new _ol_style_Icon_({
|
||||
var iconStyle = new Icon({
|
||||
src: 'test.png',
|
||||
size: size,
|
||||
offset: offset
|
||||
@@ -187,7 +187,7 @@ describe('ol.style.Icon', function() {
|
||||
});
|
||||
|
||||
it('uses a bottom left offset origin', function() {
|
||||
var iconStyle = new _ol_style_Icon_({
|
||||
var iconStyle = new Icon({
|
||||
src: 'test.png',
|
||||
size: size,
|
||||
offset: offset,
|
||||
@@ -198,7 +198,7 @@ describe('ol.style.Icon', function() {
|
||||
});
|
||||
|
||||
it('uses a bottom right offset origin', function() {
|
||||
var iconStyle = new _ol_style_Icon_({
|
||||
var iconStyle = new Icon({
|
||||
src: 'test.png',
|
||||
size: size,
|
||||
offset: offset,
|
||||
@@ -209,7 +209,7 @@ describe('ol.style.Icon', function() {
|
||||
});
|
||||
|
||||
it('uses a top right offset origin', function() {
|
||||
var iconStyle = new _ol_style_Icon_({
|
||||
var iconStyle = new Icon({
|
||||
src: 'test.png',
|
||||
size: size,
|
||||
offset: offset,
|
||||
@@ -230,14 +230,14 @@ describe('ol.style.Icon', function() {
|
||||
var iconImage = new _ol_style_IconImage_(null, 'test.png', imgSize);
|
||||
iconImageCache.set(src, null, null, iconImage);
|
||||
|
||||
var iconStyle = new _ol_style_Icon_({
|
||||
var iconStyle = new Icon({
|
||||
src: 'test.png'
|
||||
});
|
||||
expect(iconStyle.getImageSize()).to.eql(imgSize);
|
||||
});
|
||||
|
||||
it('uses the given image size', function() {
|
||||
var iconStyle = new _ol_style_Icon_({
|
||||
var iconStyle = new Icon({
|
||||
img: {src: 'test.png'},
|
||||
imgSize: imgSize
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user