Transformed

This commit is contained in:
Tim Schaub
2017-12-11 16:29:33 -07:00
parent 1cdb6a66f0
commit 7f47883c48
737 changed files with 22216 additions and 21609 deletions

View File

@@ -1,14 +1,12 @@
goog.require('ol.Feature');
goog.require('ol.geom.Polygon');
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Vector');
goog.require('ol.source.Vector');
goog.require('ol.style.Fill');
goog.require('ol.style.Style');
goog.require('ol.style.Stroke');
import _ol_Feature_ from '../../../../src/ol/Feature.js';
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
import _ol_Map_ from '../../../../src/ol/Map.js';
import _ol_View_ from '../../../../src/ol/View.js';
import _ol_layer_Vector_ from '../../../../src/ol/layer/Vector.js';
import _ol_source_Vector_ from '../../../../src/ol/source/Vector.js';
import _ol_style_Fill_ from '../../../../src/ol/style/Fill.js';
import _ol_style_Style_ from '../../../../src/ol/style/Style.js';
import _ol_style_Stroke_ from '../../../../src/ol/style/Stroke.js';
describe('ol.rendering.style.Polygon', function() {
@@ -18,17 +16,17 @@ describe('ol.rendering.style.Polygon', function() {
function createMap(renderer, opt_size) {
var size = opt_size || 50;
vectorSource = new ol.source.Vector();
var vectorLayer = new ol.layer.Vector({
vectorSource = new _ol_source_Vector_();
var vectorLayer = new _ol_layer_Vector_({
source: vectorSource
});
map = new ol.Map({
map = new _ol_Map_({
pixelRatio: 1,
target: createMapDiv(size, size),
renderer: renderer,
layers: [vectorLayer],
view: new ol.View({
view: new _ol_View_({
projection: 'EPSG:4326',
center: [0, 0],
resolution: 1
@@ -46,43 +44,43 @@ describe('ol.rendering.style.Polygon', function() {
describe('different types', function() {
function createFeatures() {
var fill = new ol.style.Fill({color: 'red'});
var fill = new _ol_style_Fill_({color: 'red'});
var feature;
// rectangle
feature = new ol.Feature({
geometry: new ol.geom.Polygon([
feature = new _ol_Feature_({
geometry: new _ol_geom_Polygon_([
[[-20, 10], [-20, 20], [-5, 20], [-5, 10], [-20, 10]]
])
});
feature.setStyle(new ol.style.Style({
feature.setStyle(new _ol_style_Style_({
fill: fill
}));
vectorSource.addFeature(feature);
// rectangle with 1 hole
feature = new ol.Feature({
geometry: new ol.geom.Polygon([
feature = new _ol_Feature_({
geometry: new _ol_geom_Polygon_([
[[0, 10], [0, 20], [15, 20], [15, 10], [0, 10]],
[[5, 13], [10, 13], [10, 17], [5, 17], [5, 13]]
])
});
feature.setStyle(new ol.style.Style({
feature.setStyle(new _ol_style_Style_({
fill: fill
}));
vectorSource.addFeature(feature);
// rectangle with 2 holes
feature = new ol.Feature({
geometry: new ol.geom.Polygon([
feature = new _ol_Feature_({
geometry: new _ol_geom_Polygon_([
[[-20, -20], [-20, 5], [15, 5], [15, -20], [-20, -20]],
[[-18, -18], [-12, -18], [-12, -12], [-18, -12], [-18, -18]],
[[5, -18], [12, -18], [12, -12], [5, -12], [5, -18]]
])
});
feature.setStyle(new ol.style.Style({
feature.setStyle(new _ol_style_Style_({
fill: fill
}));
vectorSource.addFeature(feature);
@@ -106,7 +104,7 @@ describe('ol.rendering.style.Polygon', function() {
describe('different types with stroke', function() {
function createFeatures() {
var stroke = new ol.style.Stroke({
var stroke = new _ol_style_Stroke_({
width: 10,
color: '#000',
lineJoin: 'round',
@@ -115,39 +113,39 @@ describe('ol.rendering.style.Polygon', function() {
var feature;
// rectangle
feature = new ol.Feature({
geometry: new ol.geom.Polygon([
feature = new _ol_Feature_({
geometry: new _ol_geom_Polygon_([
[[-20, 10], [-20, 20], [-5, 20], [-5, 10], [-20, 10]]
])
});
feature.setStyle(new ol.style.Style({
feature.setStyle(new _ol_style_Style_({
stroke: stroke
}));
vectorSource.addFeature(feature);
// rectangle with 1 hole
feature = new ol.Feature({
geometry: new ol.geom.Polygon([
feature = new _ol_Feature_({
geometry: new _ol_geom_Polygon_([
[[0, 10], [0, 20], [20, 20], [20, 10], [0, 10]],
[[5, 13], [10, 13], [10, 17], [5, 17], [5, 13]]
])
});
feature.setStyle(new ol.style.Style({
feature.setStyle(new _ol_style_Style_({
stroke: stroke
}));
vectorSource.addFeature(feature);
// rectangle with 2 holes
feature = new ol.Feature({
geometry: new ol.geom.Polygon([
feature = new _ol_Feature_({
geometry: new _ol_geom_Polygon_([
[[-20, -20], [-20, 5], [20, 5], [20, -20], [-20, -20]],
[[-12, -3], [-12, -12], [-8, -12], [-8, -3], [-12, -3]],
[[0, -12], [13, -12], [13, -3], [0, -3], [0, -12]]
])
});
feature.setStyle(new ol.style.Style({
feature.setStyle(new _ol_style_Style_({
stroke: stroke
}));
vectorSource.addFeature(feature);
@@ -175,37 +173,37 @@ describe('ol.rendering.style.Polygon', function() {
function createFeatures() {
var feature;
// rectangle with z-index 2
feature = new ol.Feature({
geometry: new ol.geom.Polygon([
feature = new _ol_Feature_({
geometry: new _ol_geom_Polygon_([
[[-20, 10], [-20, 20], [-0, 20], [-0, 10], [-20, 10]]
])
});
feature.setStyle(new ol.style.Style({
fill: new ol.style.Fill({color: '#E31E10'}),
feature.setStyle(new _ol_style_Style_({
fill: new _ol_style_Fill_({color: '#E31E10'}),
zIndex: 2
}));
vectorSource.addFeature(feature);
// rectangle with z-index 3
feature = new ol.Feature({
geometry: new ol.geom.Polygon([
feature = new _ol_Feature_({
geometry: new _ol_geom_Polygon_([
[[-15, 5], [-15, 15], [5, 15], [5, 5], [-15, 5]]
])
});
feature.setStyle(new ol.style.Style({
fill: new ol.style.Fill({color: '#1A5E42'}),
feature.setStyle(new _ol_style_Style_({
fill: new _ol_style_Fill_({color: '#1A5E42'}),
zIndex: 3
}));
vectorSource.addFeature(feature);
// rectangle with z-index 1
feature = new ol.Feature({
geometry: new ol.geom.Polygon([
feature = new _ol_Feature_({
geometry: new _ol_geom_Polygon_([
[[-10, 0], [-10, 10], [10, 10], [10, 0], [-10, 0]]
])
});
feature.setStyle(new ol.style.Style({
fill: new ol.style.Fill({color: '#DEDE21'}),
feature.setStyle(new _ol_style_Style_({
fill: new _ol_style_Fill_({color: '#DEDE21'}),
zIndex: 1
}));
vectorSource.addFeature(feature);
@@ -232,38 +230,38 @@ describe('ol.rendering.style.Polygon', function() {
function createFeatures() {
var feature;
// rectangle
feature = new ol.Feature({
geometry: new ol.geom.Polygon([
feature = new _ol_Feature_({
geometry: new _ol_geom_Polygon_([
[[-20, 10], [-20, 20], [-5, 20], [-5, 10], [-20, 10]]
])
});
feature.setStyle(new ol.style.Style({
fill: new ol.style.Fill({color: '#9696EB'}),
stroke: new ol.style.Stroke({color: '#9696EB', width: 1})
feature.setStyle(new _ol_style_Style_({
fill: new _ol_style_Fill_({color: '#9696EB'}),
stroke: new _ol_style_Stroke_({color: '#9696EB', width: 1})
}));
vectorSource.addFeature(feature);
// rectangle with 1 hole
feature = new ol.Feature({
geometry: new ol.geom.Polygon([
feature = new _ol_Feature_({
geometry: new _ol_geom_Polygon_([
[[0, 10], [0, 20], [15, 20], [15, 10], [0, 10]]
])
});
feature.setStyle(new ol.style.Style({
fill: new ol.style.Fill({color: 'rgba(255, 0, 0, 0.1)'}),
stroke: new ol.style.Stroke({color: '#DE213A', width: 3})
feature.setStyle(new _ol_style_Style_({
fill: new _ol_style_Fill_({color: 'rgba(255, 0, 0, 0.1)'}),
stroke: new _ol_style_Stroke_({color: '#DE213A', width: 3})
}));
vectorSource.addFeature(feature);
// rectangle with 2 holes
feature = new ol.Feature({
geometry: new ol.geom.Polygon([
feature = new _ol_Feature_({
geometry: new _ol_geom_Polygon_([
[[-20, -20], [-20, 5], [15, 5], [15, -20], [-20, -20]]
])
});
feature.setStyle(new ol.style.Style({
fill: new ol.style.Fill({color: 'rgba(18, 204, 105, 0.3)'}),
stroke: new ol.style.Stroke({color: '#032E17', width: 2})
feature.setStyle(new _ol_style_Style_({
fill: new _ol_style_Fill_({color: 'rgba(18, 204, 105, 0.3)'}),
stroke: new _ol_style_Stroke_({color: '#032E17', width: 2})
}));
vectorSource.addFeature(feature);
}
@@ -318,14 +316,14 @@ describe('ol.rendering.style.Polygon', function() {
}
function createFeatures() {
var feature = new ol.Feature({
geometry: new ol.geom.Polygon([
var feature = new _ol_Feature_({
geometry: new _ol_geom_Polygon_([
[[-20, -20], [-20, 20], [18, 20], [-20, -20]]
])
});
feature.setStyle(new ol.style.Style({
fill: new ol.style.Fill({color: createPattern()}),
stroke: new ol.style.Stroke({color: createRainbowGradient(), width: 3})
feature.setStyle(new _ol_style_Style_({
fill: new _ol_style_Fill_({color: createPattern()}),
stroke: new _ol_style_Stroke_({color: createRainbowGradient(), width: 3})
}));
vectorSource.addFeature(feature);
}