Rename _ol_style_Style_ to Style

This commit is contained in:
Tim Schaub
2018-01-11 13:22:43 -07:00
parent 5f40eec148
commit 4f4c90fc20
80 changed files with 420 additions and 420 deletions
+4 -4
View File
@@ -7,7 +7,7 @@ import VectorSource from '../src/ol/source/Vector.js';
import _ol_style_Circle_ from '../src/ol/style/Circle.js'; import _ol_style_Circle_ from '../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
// Create separate layers for red, green an blue circles. // Create separate layers for red, green an blue circles.
@@ -18,7 +18,7 @@ var redLayer = new VectorLayer({
source: new VectorSource({ source: new VectorSource({
features: [new Feature(new Point([0, 0]))] features: [new Feature(new Point([0, 0]))]
}), }),
style: new _ol_style_Style_({ style: new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
color: 'rgba(255,0,0,0.8)' color: 'rgba(255,0,0,0.8)'
@@ -36,7 +36,7 @@ var greenLayer = new VectorLayer({
// 433.013 is roughly 250 * Math.sqrt(3) // 433.013 is roughly 250 * Math.sqrt(3)
features: [new Feature(new Point([250, 433.013]))] features: [new Feature(new Point([250, 433.013]))]
}), }),
style: new _ol_style_Style_({ style: new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
color: 'rgba(0,255,0,0.8)' color: 'rgba(0,255,0,0.8)'
@@ -53,7 +53,7 @@ var blueLayer = new VectorLayer({
source: new VectorSource({ source: new VectorSource({
features: [new Feature(new Point([500, 0]))] features: [new Feature(new Point([500, 0]))]
}), }),
style: new _ol_style_Style_({ style: new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
color: 'rgba(0,0,255,0.8)' color: 'rgba(0,0,255,0.8)'
+2 -2
View File
@@ -8,7 +8,7 @@ import {fromLonLat} from '../src/ol/proj.js';
import VectorSource from '../src/ol/source/Vector.js'; import VectorSource from '../src/ol/source/Vector.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
var canvas = document.createElement('canvas'); var canvas = document.createElement('canvas');
var context = canvas.getContext('2d'); var context = canvas.getContext('2d');
@@ -58,7 +58,7 @@ var pattern = (function() {
// Generate style for gradient or pattern fill // Generate style for gradient or pattern fill
var fill = new _ol_style_Fill_(); var fill = new _ol_style_Fill_();
var style = new _ol_style_Style_({ var style = new Style({
fill: fill, fill: fill,
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: '#333', color: '#333',
+2 -2
View File
@@ -9,13 +9,13 @@ import VectorSource from '../src/ol/source/Vector.js';
import _ol_style_Circle_ from '../src/ol/style/Circle.js'; import _ol_style_Circle_ from '../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
var source = new VectorSource({ var source = new VectorSource({
url: 'data/geojson/switzerland.geojson', url: 'data/geojson/switzerland.geojson',
format: new GeoJSON() format: new GeoJSON()
}); });
var style = new _ol_style_Style_({ var style = new Style({
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
color: 'rgba(255, 255, 255, 0.6)' color: 'rgba(255, 255, 255, 0.6)'
}), }),
+2 -2
View File
@@ -10,7 +10,7 @@ import VectorSource from '../src/ol/source/Vector.js';
import _ol_style_Circle_ from '../src/ol/style/Circle.js'; import _ol_style_Circle_ from '../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
import _ol_style_Text_ from '../src/ol/style/Text.js'; import _ol_style_Text_ from '../src/ol/style/Text.js';
@@ -40,7 +40,7 @@ var clusters = new VectorLayer({
var size = feature.get('features').length; var size = feature.get('features').length;
var style = styleCache[size]; var style = styleCache[size];
if (!style) { if (!style) {
style = new _ol_style_Style_({ style = new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
radius: 10, radius: 10,
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
+2 -2
View File
@@ -14,7 +14,7 @@ import VectorSource from '../src/ol/source/Vector.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Icon_ from '../src/ol/style/Icon.js'; import _ol_style_Icon_ from '../src/ol/style/Icon.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
/** /**
@@ -156,7 +156,7 @@ var map = new Map({
source: new VectorSource({ source: new VectorSource({
features: [pointFeature, lineFeature, polygonFeature] features: [pointFeature, lineFeature, polygonFeature]
}), }),
style: new _ol_style_Style_({ style: new Style({
image: new _ol_style_Icon_(/** @type {olx.style.IconOptions} */ ({ image: new _ol_style_Icon_(/** @type {olx.style.IconOptions} */ ({
anchor: [0.5, 46], anchor: [0.5, 46],
anchorXUnits: 'fraction', anchorXUnits: 'fraction',
+7 -7
View File
@@ -14,11 +14,11 @@ import VectorSource from '../src/ol/source/Vector.js';
import _ol_style_Circle_ from '../src/ol/style/Circle.js'; import _ol_style_Circle_ from '../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
var defaultStyle = { var defaultStyle = {
'Point': new _ol_style_Style_({ 'Point': new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
color: 'rgba(255,255,0,0.5)' color: 'rgba(255,255,0,0.5)'
@@ -30,13 +30,13 @@ var defaultStyle = {
}) })
}) })
}), }),
'LineString': new _ol_style_Style_({ 'LineString': new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: '#f00', color: '#f00',
width: 3 width: 3
}) })
}), }),
'Polygon': new _ol_style_Style_({ 'Polygon': new Style({
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
color: 'rgba(0,255,255,0.5)' color: 'rgba(0,255,255,0.5)'
}), }),
@@ -45,7 +45,7 @@ var defaultStyle = {
width: 1 width: 1
}) })
}), }),
'MultiPoint': new _ol_style_Style_({ 'MultiPoint': new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
color: 'rgba(255,0,255,0.5)' color: 'rgba(255,0,255,0.5)'
@@ -57,13 +57,13 @@ var defaultStyle = {
}) })
}) })
}), }),
'MultiLineString': new _ol_style_Style_({ 'MultiLineString': new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: '#0f0', color: '#0f0',
width: 3 width: 3
}) })
}), }),
'MultiPolygon': new _ol_style_Style_({ 'MultiPolygon': new Style({
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
color: 'rgba(0,0,255,0.5)' color: 'rgba(0,0,255,0.5)'
}), }),
+7 -7
View File
@@ -14,11 +14,11 @@ import VectorSource from '../src/ol/source/Vector.js';
import _ol_style_Circle_ from '../src/ol/style/Circle.js'; import _ol_style_Circle_ from '../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
var defaultStyle = { var defaultStyle = {
'Point': new _ol_style_Style_({ 'Point': new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
color: 'rgba(255,255,0,0.5)' color: 'rgba(255,255,0,0.5)'
@@ -30,13 +30,13 @@ var defaultStyle = {
}) })
}) })
}), }),
'LineString': new _ol_style_Style_({ 'LineString': new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: '#f00', color: '#f00',
width: 3 width: 3
}) })
}), }),
'Polygon': new _ol_style_Style_({ 'Polygon': new Style({
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
color: 'rgba(0,255,255,0.5)' color: 'rgba(0,255,255,0.5)'
}), }),
@@ -45,7 +45,7 @@ var defaultStyle = {
width: 1 width: 1
}) })
}), }),
'MultiPoint': new _ol_style_Style_({ 'MultiPoint': new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
color: 'rgba(255,0,255,0.5)' color: 'rgba(255,0,255,0.5)'
@@ -57,13 +57,13 @@ var defaultStyle = {
}) })
}) })
}), }),
'MultiLineString': new _ol_style_Style_({ 'MultiLineString': new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: '#0f0', color: '#0f0',
width: 3 width: 3
}) })
}), }),
'MultiPolygon': new _ol_style_Style_({ 'MultiPolygon': new Style({
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
color: 'rgba(0,0,255,0.5)' color: 'rgba(0,0,255,0.5)'
}), }),
+2 -2
View File
@@ -10,7 +10,7 @@ import VectorSource from '../src/ol/source/Vector.js';
import _ol_style_Circle_ from '../src/ol/style/Circle.js'; import _ol_style_Circle_ from '../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
var raster = new TileLayer({ var raster = new TileLayer({
source: new OSM() source: new OSM()
@@ -19,7 +19,7 @@ var raster = new TileLayer({
var source = new VectorSource(); var source = new VectorSource();
var vector = new VectorLayer({ var vector = new VectorLayer({
source: source, source: source,
style: new _ol_style_Style_({ style: new Style({
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
color: 'rgba(255, 255, 255, 0.2)' color: 'rgba(255, 255, 255, 0.2)'
}), }),
+4 -4
View File
@@ -7,7 +7,7 @@ import OSM from '../src/ol/source/OSM.js';
import _ol_style_Circle_ from '../src/ol/style/Circle.js'; import _ol_style_Circle_ from '../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
var map = new Map({ var map = new Map({
@@ -23,7 +23,7 @@ var map = new Map({
}) })
}); });
var imageStyle = new _ol_style_Style_({ var imageStyle = new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
radius: 5, radius: 5,
snapToPixel: false, snapToPixel: false,
@@ -32,7 +32,7 @@ var imageStyle = new _ol_style_Style_({
}) })
}); });
var headInnerImageStyle = new _ol_style_Style_({ var headInnerImageStyle = new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
radius: 2, radius: 2,
snapToPixel: false, snapToPixel: false,
@@ -40,7 +40,7 @@ var headInnerImageStyle = new _ol_style_Style_({
}) })
}); });
var headOuterImageStyle = new _ol_style_Style_({ var headOuterImageStyle = new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
radius: 5, radius: 5,
snapToPixel: false, snapToPixel: false,
+4 -4
View File
@@ -13,7 +13,7 @@ import _ol_style_Circle_ from '../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_RegularShape_ from '../src/ol/style/RegularShape.js'; import _ol_style_RegularShape_ from '../src/ol/style/RegularShape.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
import _ol_style_Text_ from '../src/ol/style/Text.js'; import _ol_style_Text_ from '../src/ol/style/Text.js';
@@ -43,7 +43,7 @@ function createEarthquakeStyle(feature) {
var magnitude = parseFloat(name.substr(2)); var magnitude = parseFloat(name.substr(2));
var radius = 5 + 20 * (magnitude - 5); var radius = 5 + 20 * (magnitude - 5);
return new _ol_style_Style_({ return new Style({
geometry: feature.getGeometry(), geometry: feature.getGeometry(),
image: new _ol_style_RegularShape_({ image: new _ol_style_RegularShape_({
radius1: radius, radius1: radius,
@@ -85,7 +85,7 @@ function styleFunction(feature, resolution) {
var style; var style;
var size = feature.get('features').length; var size = feature.get('features').length;
if (size > 1) { if (size > 1) {
style = new _ol_style_Style_({ style = new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
radius: feature.get('radius'), radius: feature.get('radius'),
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
@@ -106,7 +106,7 @@ function styleFunction(feature, resolution) {
} }
function selectStyleFunction(feature) { function selectStyleFunction(feature) {
var styles = [new _ol_style_Style_({ var styles = [new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
radius: feature.get('radius'), radius: feature.get('radius'),
fill: invisibleFill fill: invisibleFill
+3 -3
View File
@@ -10,7 +10,7 @@ import VectorSource from '../src/ol/source/Vector.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Icon_ from '../src/ol/style/Icon.js'; import _ol_style_Icon_ from '../src/ol/style/Icon.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
var symbol = [[0, 0], [4, 2], [6, 0], [10, 5], [6, 3], [4, 5], [0, 0]]; var symbol = [[0, 0], [4, 2], [6, 0], [10, 5], [6, 3], [4, 5], [0, 0]];
@@ -35,12 +35,12 @@ var styleFunction = function(feature) {
var vectorContext = _ol_render_.toContext( var vectorContext = _ol_render_.toContext(
/** @type {CanvasRenderingContext2D} */ (canvas.getContext('2d')), /** @type {CanvasRenderingContext2D} */ (canvas.getContext('2d')),
{size: [size, size], pixelRatio: 1}); {size: [size, size], pixelRatio: 1});
vectorContext.setStyle(new _ol_style_Style_({ vectorContext.setStyle(new Style({
fill: new _ol_style_Fill_({color: 'rgba(255, 153, 0, 0.4)'}), fill: new _ol_style_Fill_({color: 'rgba(255, 153, 0, 0.4)'}),
stroke: new _ol_style_Stroke_({color: 'rgba(255, 204, 0, 0.2)', width: 2}) stroke: new _ol_style_Stroke_({color: 'rgba(255, 204, 0, 0.2)', width: 2})
})); }));
vectorContext.drawGeometry(new Polygon([symbol.map(scaleFunction)])); vectorContext.drawGeometry(new Polygon([symbol.map(scaleFunction)]));
style = new _ol_style_Style_({ style = new Style({
image: new _ol_style_Icon_({ image: new _ol_style_Icon_({
img: canvas, img: canvas,
imgSize: [size, size], imgSize: [size, size],
+2 -2
View File
@@ -12,7 +12,7 @@ import OSM from '../src/ol/source/OSM.js';
import VectorSource from '../src/ol/source/Vector.js'; import VectorSource from '../src/ol/source/Vector.js';
import _ol_style_Circle_ from '../src/ol/style/Circle.js'; import _ol_style_Circle_ from '../src/ol/style/Circle.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
var map = new Map({ var map = new Map({
@@ -66,7 +66,7 @@ function flash(feature) {
var radius = easeOut(elapsedRatio) * 25 + 5; var radius = easeOut(elapsedRatio) * 25 + 5;
var opacity = easeOut(1 - elapsedRatio); var opacity = easeOut(1 - elapsedRatio);
var style = new _ol_style_Style_({ var style = new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
radius: radius, radius: radius,
snapToPixel: false, snapToPixel: false,
+4 -4
View File
@@ -11,7 +11,7 @@ import _ol_style_Circle_ from '../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Icon_ from '../src/ol/style/Icon.js'; import _ol_style_Icon_ from '../src/ol/style/Icon.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
// This long string is placed here due to jsFiddle limitations. // This long string is placed here due to jsFiddle limitations.
// It is usually loaded with AJAX. // It is usually loaded with AJAX.
@@ -85,18 +85,18 @@ var endMarker = new Feature({
}); });
var styles = { var styles = {
'route': new _ol_style_Style_({ 'route': new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
width: 6, color: [237, 212, 0, 0.8] width: 6, color: [237, 212, 0, 0.8]
}) })
}), }),
'icon': new _ol_style_Style_({ 'icon': new Style({
image: new _ol_style_Icon_({ image: new _ol_style_Icon_({
anchor: [0.5, 1], anchor: [0.5, 1],
src: 'data/icon.png' src: 'data/icon.png'
}) })
}), }),
'geoMarker': new _ol_style_Style_({ 'geoMarker': new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
radius: 7, radius: 7,
snapToPixel: false, snapToPixel: false,
+2 -2
View File
@@ -8,7 +8,7 @@ import VectorLayer from '../src/ol/layer/Vector.js';
import Stamen from '../src/ol/source/Stamen.js'; import Stamen from '../src/ol/source/Stamen.js';
import VectorSource from '../src/ol/source/Vector.js'; import VectorSource from '../src/ol/source/Vector.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
var map = new Map({ var map = new Map({
layers: [ layers: [
@@ -25,7 +25,7 @@ var map = new Map({
}) })
}); });
var style = new _ol_style_Style_({ var style = new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: '#EAE911', color: '#EAE911',
width: 2 width: 2
+9 -9
View File
@@ -11,7 +11,7 @@ import VectorSource from '../src/ol/source/Vector.js';
import _ol_style_Circle_ from '../src/ol/style/Circle.js'; import _ol_style_Circle_ from '../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
var image = new _ol_style_Circle_({ var image = new _ol_style_Circle_({
@@ -21,25 +21,25 @@ var image = new _ol_style_Circle_({
}); });
var styles = { var styles = {
'Point': new _ol_style_Style_({ 'Point': new Style({
image: image image: image
}), }),
'LineString': new _ol_style_Style_({ 'LineString': new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: 'green', color: 'green',
width: 1 width: 1
}) })
}), }),
'MultiLineString': new _ol_style_Style_({ 'MultiLineString': new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: 'green', color: 'green',
width: 1 width: 1
}) })
}), }),
'MultiPoint': new _ol_style_Style_({ 'MultiPoint': new Style({
image: image image: image
}), }),
'MultiPolygon': new _ol_style_Style_({ 'MultiPolygon': new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: 'yellow', color: 'yellow',
width: 1 width: 1
@@ -48,7 +48,7 @@ var styles = {
color: 'rgba(255, 255, 0, 0.1)' color: 'rgba(255, 255, 0, 0.1)'
}) })
}), }),
'Polygon': new _ol_style_Style_({ 'Polygon': new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: 'blue', color: 'blue',
lineDash: [4], lineDash: [4],
@@ -58,7 +58,7 @@ var styles = {
color: 'rgba(0, 0, 255, 0.1)' color: 'rgba(0, 0, 255, 0.1)'
}) })
}), }),
'GeometryCollection': new _ol_style_Style_({ 'GeometryCollection': new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: 'magenta', color: 'magenta',
width: 2 width: 2
@@ -74,7 +74,7 @@ var styles = {
}) })
}) })
}), }),
'Circle': new _ol_style_Style_({ 'Circle': new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: 'red', color: 'red',
width: 2 width: 2
+2 -2
View File
@@ -11,7 +11,7 @@ import VectorSource from '../src/ol/source/Vector.js';
import _ol_style_Circle_ from '../src/ol/style/Circle.js'; import _ol_style_Circle_ from '../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
var view = new View({ var view = new View({
center: [0, 0], center: [0, 0],
@@ -67,7 +67,7 @@ geolocation.on('change:accuracyGeometry', function() {
}); });
var positionFeature = new Feature(); var positionFeature = new Feature();
positionFeature.setStyle(new _ol_style_Style_({ positionFeature.setStyle(new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
radius: 6, radius: 6,
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
+4 -4
View File
@@ -8,7 +8,7 @@ import VectorSource from '../src/ol/source/Vector.js';
import _ol_style_Circle_ from '../src/ol/style/Circle.js'; import _ol_style_Circle_ from '../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
var raster = new TileLayer({ var raster = new TileLayer({
source: new BingMaps({ source: new BingMaps({
@@ -18,7 +18,7 @@ var raster = new TileLayer({
}); });
var style = { var style = {
'Point': new _ol_style_Style_({ 'Point': new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
color: 'rgba(255,255,0,0.4)' color: 'rgba(255,255,0,0.4)'
@@ -30,13 +30,13 @@ var style = {
}) })
}) })
}), }),
'LineString': new _ol_style_Style_({ 'LineString': new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: '#f00', color: '#f00',
width: 3 width: 3
}) })
}), }),
'MultiLineString': new _ol_style_Style_({ 'MultiLineString': new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: '#0f0', color: '#0f0',
width: 3 width: 3
+2 -2
View File
@@ -6,14 +6,14 @@ import OSM from '../src/ol/source/OSM.js';
import VectorSource from '../src/ol/source/Vector.js'; import VectorSource from '../src/ol/source/Vector.js';
import Feature from '../src/ol/Feature.js'; import Feature from '../src/ol/Feature.js';
import LineString from '../src/ol/geom/LineString.js'; import LineString from '../src/ol/geom/LineString.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
var raster = new TileLayer({ var raster = new TileLayer({
source: new OSM() source: new OSM()
}); });
var style = new _ol_style_Style_({ var style = new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: 'black', color: 'black',
width: 1 width: 1
+4 -4
View File
@@ -8,7 +8,7 @@ import {fromLonLat} from '../src/ol/proj.js';
import TileJSON from '../src/ol/source/TileJSON.js'; import TileJSON from '../src/ol/source/TileJSON.js';
import VectorSource from '../src/ol/source/Vector.js'; import VectorSource from '../src/ol/source/Vector.js';
import _ol_style_Icon_ from '../src/ol/style/Icon.js'; import _ol_style_Icon_ from '../src/ol/style/Icon.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
var rome = new Feature({ var rome = new Feature({
@@ -23,7 +23,7 @@ var madrid = new Feature({
geometry: new Point(fromLonLat([-3.683333, 40.4])) geometry: new Point(fromLonLat([-3.683333, 40.4]))
}); });
rome.setStyle(new _ol_style_Style_({ rome.setStyle(new Style({
image: new _ol_style_Icon_(/** @type {olx.style.IconOptions} */ ({ image: new _ol_style_Icon_(/** @type {olx.style.IconOptions} */ ({
color: '#8959A8', color: '#8959A8',
crossOrigin: 'anonymous', crossOrigin: 'anonymous',
@@ -31,7 +31,7 @@ rome.setStyle(new _ol_style_Style_({
})) }))
})); }));
london.setStyle(new _ol_style_Style_({ london.setStyle(new Style({
image: new _ol_style_Icon_(/** @type {olx.style.IconOptions} */ ({ image: new _ol_style_Icon_(/** @type {olx.style.IconOptions} */ ({
color: '#4271AE', color: '#4271AE',
crossOrigin: 'anonymous', crossOrigin: 'anonymous',
@@ -39,7 +39,7 @@ london.setStyle(new _ol_style_Style_({
})) }))
})); }));
madrid.setStyle(new _ol_style_Style_({ madrid.setStyle(new Style({
image: new _ol_style_Icon_(/** @type {olx.style.IconOptions} */ ({ image: new _ol_style_Icon_(/** @type {olx.style.IconOptions} */ ({
color: [113, 140, 0], color: [113, 140, 0],
crossOrigin: 'anonymous', crossOrigin: 'anonymous',
+2 -2
View File
@@ -8,11 +8,11 @@ import VectorLayer from '../src/ol/layer/Vector.js';
import Stamen from '../src/ol/source/Stamen.js'; import Stamen from '../src/ol/source/Stamen.js';
import VectorSource from '../src/ol/source/Vector.js'; import VectorSource from '../src/ol/source/Vector.js';
import _ol_style_Icon_ from '../src/ol/style/Icon.js'; import _ol_style_Icon_ from '../src/ol/style/Icon.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
function createStyle(src, img) { function createStyle(src, img) {
return new _ol_style_Style_({ return new Style({
image: new _ol_style_Icon_(/** @type {olx.style.IconOptions} */ ({ image: new _ol_style_Icon_(/** @type {olx.style.IconOptions} */ ({
anchor: [0.5, 0.96], anchor: [0.5, 0.96],
crossOrigin: 'anonymous', crossOrigin: 'anonymous',
+3 -3
View File
@@ -5,7 +5,7 @@ import Point from '../src/ol/geom/Point.js';
import VectorLayer from '../src/ol/layer/Vector.js'; import VectorLayer from '../src/ol/layer/Vector.js';
import VectorSource from '../src/ol/source/Vector.js'; import VectorSource from '../src/ol/source/Vector.js';
import _ol_style_Icon_ from '../src/ol/style/Icon.js'; import _ol_style_Icon_ from '../src/ol/style/Icon.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
var iconInfo = [{ var iconInfo = [{
@@ -65,7 +65,7 @@ for (i = 0; i < featureCount; ++i) {
[2 * e * Math.random() - e, 2 * e * Math.random() - e]); [2 * e * Math.random() - e, 2 * e * Math.random() - e]);
feature = new Feature(geometry); feature = new Feature(geometry);
feature.setStyle( feature.setStyle(
new _ol_style_Style_({ new Style({
image: icons[i % (iconCount - 1)] image: icons[i % (iconCount - 1)]
}) })
); );
@@ -101,7 +101,7 @@ new VectorLayer({
source: new VectorSource({ source: new VectorSource({
features: overlayFeatures features: overlayFeatures
}), }),
style: new _ol_style_Style_({ style: new Style({
image: icons[iconCount - 1] image: icons[iconCount - 1]
}) })
}); });
+2 -2
View File
@@ -8,7 +8,7 @@ import VectorLayer from '../src/ol/layer/Vector.js';
import TileJSON from '../src/ol/source/TileJSON.js'; import TileJSON from '../src/ol/source/TileJSON.js';
import VectorSource from '../src/ol/source/Vector.js'; import VectorSource from '../src/ol/source/Vector.js';
import _ol_style_Icon_ from '../src/ol/style/Icon.js'; import _ol_style_Icon_ from '../src/ol/style/Icon.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
var iconFeature = new Feature({ var iconFeature = new Feature({
@@ -18,7 +18,7 @@ var iconFeature = new Feature({
rainfall: 500 rainfall: 500
}); });
var iconStyle = new _ol_style_Style_({ var iconStyle = new Style({
image: new _ol_style_Icon_(/** @type {olx.style.IconOptions} */ ({ image: new _ol_style_Icon_(/** @type {olx.style.IconOptions} */ ({
anchor: [0.5, 46], anchor: [0.5, 46],
anchorXUnits: 'fraction', anchorXUnits: 'fraction',
+4 -4
View File
@@ -12,7 +12,7 @@ import VectorSource from '../src/ol/source/Vector.js';
import _ol_style_Circle_ from '../src/ol/style/Circle.js'; import _ol_style_Circle_ from '../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
var colors = { var colors = {
@@ -28,7 +28,7 @@ var styleFunction = function(feature) {
var color = colors[feature.get('PLT')]; var color = colors[feature.get('PLT')];
var style = styleCache[color]; var style = styleCache[color];
if (!style) { if (!style) {
style = new _ol_style_Style_({ style = new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: color, color: color,
width: 3 width: 3
@@ -156,7 +156,7 @@ var stroke = new _ol_style_Stroke_({
color: 'rgba(255,0,0,0.9)', color: 'rgba(255,0,0,0.9)',
width: 1 width: 1
}); });
var style = new _ol_style_Style_({ var style = new Style({
stroke: stroke, stroke: stroke,
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
radius: 5, radius: 5,
@@ -178,7 +178,7 @@ map.on('postcompose', function(evt) {
var featureOverlay = new VectorLayer({ var featureOverlay = new VectorLayer({
source: new VectorSource(), source: new VectorSource(),
map: map, map: map,
style: new _ol_style_Style_({ style: new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
radius: 5, radius: 5,
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
+3 -3
View File
@@ -5,11 +5,11 @@ import VectorLayer from '../src/ol/layer/Vector.js';
import VectorSource from '../src/ol/source/Vector.js'; import VectorSource from '../src/ol/source/Vector.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
import _ol_style_Text_ from '../src/ol/style/Text.js'; import _ol_style_Text_ from '../src/ol/style/Text.js';
var style = new _ol_style_Style_({ var style = new Style({
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
color: 'rgba(255, 255, 255, 0.6)' color: 'rgba(255, 255, 255, 0.6)'
}), }),
@@ -44,7 +44,7 @@ var map = new Map({
var featureOverlay = new VectorLayer({ var featureOverlay = new VectorLayer({
source: new VectorSource(), source: new VectorSource(),
map: map, map: map,
style: new _ol_style_Style_({ style: new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: '#f00', color: '#f00',
width: 1 width: 1
+2 -2
View File
@@ -8,7 +8,7 @@ import VectorSource from '../src/ol/source/Vector.js';
import _ol_style_Circle_ from '../src/ol/style/Circle.js'; import _ol_style_Circle_ from '../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
var styleCache = {}; var styleCache = {};
@@ -21,7 +21,7 @@ var styleFunction = function(feature) {
var radius = 5 + 20 * (magnitude - 5); var radius = 5 + 20 * (magnitude - 5);
var style = styleCache[radius]; var style = styleCache[radius];
if (!style) { if (!style) {
style = new _ol_style_Style_({ style = new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
radius: radius, radius: radius,
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
+2 -2
View File
@@ -7,7 +7,7 @@ import Stamen from '../src/ol/source/Stamen.js';
import VectorSource from '../src/ol/source/Vector.js'; import VectorSource from '../src/ol/source/Vector.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
/* /*
@@ -35,7 +35,7 @@ var styleFunction = function(feature) {
delta = 24 - delta; delta = 24 - delta;
} }
var opacity = 0.75 * (1 - delta / 12); var opacity = 0.75 * (1 - delta / 12);
return new _ol_style_Style_({ return new Style({
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
color: [0xff, 0xff, 0x33, opacity] color: [0xff, 0xff, 0x33, opacity]
}), }),
+4 -4
View File
@@ -7,13 +7,13 @@ import VectorSource from '../src/ol/source/Vector.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_RegularShape_ from '../src/ol/style/RegularShape.js'; import _ol_style_RegularShape_ from '../src/ol/style/RegularShape.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
var stroke = new _ol_style_Stroke_({color: 'black', width: 1}); var stroke = new _ol_style_Stroke_({color: 'black', width: 1});
var styles = { var styles = {
'square': new _ol_style_Style_({ 'square': new Style({
image: new _ol_style_RegularShape_({ image: new _ol_style_RegularShape_({
fill: new _ol_style_Fill_({color: 'blue'}), fill: new _ol_style_Fill_({color: 'blue'}),
stroke: stroke, stroke: stroke,
@@ -22,7 +22,7 @@ var styles = {
angle: Math.PI / 4 angle: Math.PI / 4
}) })
}), }),
'triangle': new _ol_style_Style_({ 'triangle': new Style({
image: new _ol_style_RegularShape_({ image: new _ol_style_RegularShape_({
fill: new _ol_style_Fill_({color: 'red'}), fill: new _ol_style_Fill_({color: 'red'}),
stroke: stroke, stroke: stroke,
@@ -32,7 +32,7 @@ var styles = {
angle: 0 angle: 0
}) })
}), }),
'star': new _ol_style_Style_({ 'star': new Style({
image: new _ol_style_RegularShape_({ image: new _ol_style_RegularShape_({
fill: new _ol_style_Fill_({color: 'green'}), fill: new _ol_style_Fill_({color: 'green'}),
stroke: stroke, stroke: stroke,
+3 -3
View File
@@ -8,7 +8,7 @@ import OSM from '../src/ol/source/OSM.js';
import VectorSource from '../src/ol/source/Vector.js'; import VectorSource from '../src/ol/source/Vector.js';
import _ol_style_Icon_ from '../src/ol/style/Icon.js'; import _ol_style_Icon_ from '../src/ol/style/Icon.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
var raster = new TileLayer({ var raster = new TileLayer({
source: new OSM() source: new OSM()
@@ -20,7 +20,7 @@ var styleFunction = function(feature) {
var geometry = feature.getGeometry(); var geometry = feature.getGeometry();
var styles = [ var styles = [
// linestring // linestring
new _ol_style_Style_({ new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: '#ffcc33', color: '#ffcc33',
width: 2 width: 2
@@ -33,7 +33,7 @@ var styleFunction = function(feature) {
var dy = end[1] - start[1]; var dy = end[1] - start[1];
var rotation = Math.atan2(dy, dx); var rotation = Math.atan2(dy, dx);
// arrows // arrows
styles.push(new _ol_style_Style_({ styles.push(new Style({
geometry: new Point(end), geometry: new Point(end),
image: new _ol_style_Icon_({ image: new _ol_style_Icon_({
src: 'data/arrow.png', src: 'data/arrow.png',
+2 -2
View File
@@ -7,7 +7,7 @@ import VectorTileSource from '../src/ol/source/VectorTile.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Icon_ from '../src/ol/style/Icon.js'; import _ol_style_Icon_ from '../src/ol/style/Icon.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
import _ol_style_Text_ from '../src/ol/style/Text.js'; import _ol_style_Text_ from '../src/ol/style/Text.js';
import TileGrid from '../src/ol/tilegrid/TileGrid.js'; import TileGrid from '../src/ol/tilegrid/TileGrid.js';
@@ -45,7 +45,7 @@ var map = new Map({
}), }),
tileUrlFunction: tileUrlFunction tileUrlFunction: tileUrlFunction
}), }),
style: createMapboxStreetsV6Style(_ol_style_Style_, _ol_style_Fill_, _ol_style_Stroke_, _ol_style_Icon_, _ol_style_Text_) style: createMapboxStreetsV6Style(Style, _ol_style_Fill_, _ol_style_Stroke_, _ol_style_Icon_, _ol_style_Text_)
}) })
], ],
target: 'map', target: 'map',
+2 -2
View File
@@ -6,7 +6,7 @@ import VectorTileSource from '../src/ol/source/VectorTile.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Icon_ from '../src/ol/style/Icon.js'; import _ol_style_Icon_ from '../src/ol/style/Icon.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
import _ol_style_Text_ from '../src/ol/style/Text.js'; import _ol_style_Text_ from '../src/ol/style/Text.js';
@@ -24,7 +24,7 @@ var map = new Map({
url: 'https://{a-d}.tiles.mapbox.com/v4/mapbox.mapbox-streets-v6/' + url: 'https://{a-d}.tiles.mapbox.com/v4/mapbox.mapbox-streets-v6/' +
'{z}/{x}/{y}.vector.pbf?access_token=' + key '{z}/{x}/{y}.vector.pbf?access_token=' + key
}), }),
style: createMapboxStreetsV6Style(_ol_style_Style_, _ol_style_Fill_, _ol_style_Stroke_, _ol_style_Icon_, _ol_style_Text_) style: createMapboxStreetsV6Style(Style, _ol_style_Fill_, _ol_style_Stroke_, _ol_style_Icon_, _ol_style_Text_)
}) })
], ],
target: 'map', target: 'map',
+3 -3
View File
@@ -13,7 +13,7 @@ import VectorSource from '../src/ol/source/Vector.js';
import _ol_style_Circle_ from '../src/ol/style/Circle.js'; import _ol_style_Circle_ from '../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
var raster = new TileLayer({ var raster = new TileLayer({
@@ -24,7 +24,7 @@ var source = new VectorSource();
var vector = new VectorLayer({ var vector = new VectorLayer({
source: source, source: source,
style: new _ol_style_Style_({ style: new Style({
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
color: 'rgba(255, 255, 255, 0.2)' color: 'rgba(255, 255, 255, 0.2)'
}), }),
@@ -180,7 +180,7 @@ function addInteraction() {
draw = new Draw({ draw = new Draw({
source: source, source: source,
type: type, type: type,
style: new _ol_style_Style_({ style: new Style({
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
color: 'rgba(255, 255, 255, 0.2)' color: 'rgba(255, 255, 255, 0.2)'
}), }),
+12 -12
View File
@@ -9,7 +9,7 @@ import VectorSource from '../src/ol/source/Vector.js';
import _ol_style_Circle_ from '../src/ol/style/Circle.js'; import _ol_style_Circle_ from '../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
var styleFunction = (function() { var styleFunction = (function() {
@@ -19,8 +19,8 @@ var styleFunction = (function() {
fill: null, fill: null,
stroke: new _ol_style_Stroke_({color: 'orange', width: 2}) stroke: new _ol_style_Stroke_({color: 'orange', width: 2})
}); });
styles['Point'] = new _ol_style_Style_({image: image}); styles['Point'] = new Style({image: image});
styles['Polygon'] = new _ol_style_Style_({ styles['Polygon'] = new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: 'blue', color: 'blue',
width: 3 width: 3
@@ -29,13 +29,13 @@ var styleFunction = (function() {
color: 'rgba(0, 0, 255, 0.1)' color: 'rgba(0, 0, 255, 0.1)'
}) })
}); });
styles['MultiLineString'] = new _ol_style_Style_({ styles['MultiLineString'] = new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: 'green', color: 'green',
width: 3 width: 3
}) })
}); });
styles['MultiPolygon'] = new _ol_style_Style_({ styles['MultiPolygon'] = new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: 'yellow', color: 'yellow',
width: 1 width: 1
@@ -44,7 +44,7 @@ var styleFunction = (function() {
color: 'rgba(255, 255, 0, 0.1)' color: 'rgba(255, 255, 0, 0.1)'
}) })
}); });
styles['default'] = new _ol_style_Style_({ styles['default'] = new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: 'red', color: 'red',
width: 3 width: 3
@@ -156,18 +156,18 @@ var layer = new VectorLayer({
var overlayStyle = (function() { var overlayStyle = (function() {
var styles = {}; var styles = {};
styles['Polygon'] = [ styles['Polygon'] = [
new _ol_style_Style_({ new Style({
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
color: [255, 255, 255, 0.5] color: [255, 255, 255, 0.5]
}) })
}), }),
new _ol_style_Style_({ new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: [255, 255, 255, 1], color: [255, 255, 255, 1],
width: 5 width: 5
}) })
}), }),
new _ol_style_Style_({ new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: [0, 153, 255, 1], color: [0, 153, 255, 1],
width: 3 width: 3
@@ -177,13 +177,13 @@ var overlayStyle = (function() {
styles['MultiPolygon'] = styles['Polygon']; styles['MultiPolygon'] = styles['Polygon'];
styles['LineString'] = [ styles['LineString'] = [
new _ol_style_Style_({ new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: [255, 255, 255, 1], color: [255, 255, 255, 1],
width: 5 width: 5
}) })
}), }),
new _ol_style_Style_({ new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: [0, 153, 255, 1], color: [0, 153, 255, 1],
width: 3 width: 3
@@ -193,7 +193,7 @@ var overlayStyle = (function() {
styles['MultiLineString'] = styles['LineString']; styles['MultiLineString'] = styles['LineString'];
styles['Point'] = [ styles['Point'] = [
new _ol_style_Style_({ new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
radius: 7, radius: 7,
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
+4 -4
View File
@@ -6,7 +6,7 @@ import {fromLonLat} from '../src/ol/proj.js';
import VectorTileSource from '../src/ol/source/VectorTile.js'; import VectorTileSource from '../src/ol/source/VectorTile.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
var key = 'vector-tiles-5eJz6JX'; var key = 'vector-tiles-5eJz6JX';
@@ -16,7 +16,7 @@ var roadColor = {
'minor_road': '#ccb', 'minor_road': '#ccb',
'highway': '#f39' 'highway': '#f39'
}; };
var buildingStyle = new _ol_style_Style_({ var buildingStyle = new Style({
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
color: '#666', color: '#666',
opacity: 0.4 opacity: 0.4
@@ -26,7 +26,7 @@ var buildingStyle = new _ol_style_Style_({
width: 1 width: 1
}) })
}); });
var waterStyle = new _ol_style_Style_({ var waterStyle = new Style({
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
color: '#9db9e8' color: '#9db9e8'
}) })
@@ -46,7 +46,7 @@ var roadStyle = function(feature) {
color = roadColor[kind]; color = roadColor[kind];
width = kind == 'highway' ? 1.5 : 1; width = kind == 'highway' ? 1.5 : 1;
} }
style = new _ol_style_Style_({ style = new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: color, color: color,
width: width width: width
+3 -3
View File
@@ -7,7 +7,7 @@ import VectorSource from '../src/ol/source/Vector.js';
import _ol_style_Circle_ from '../src/ol/style/Circle.js'; import _ol_style_Circle_ from '../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
var styles = [ var styles = [
/* We are using two different styles for the polygons: /* We are using two different styles for the polygons:
@@ -17,7 +17,7 @@ var styles = [
* returned as `MultiPoint` geometry, which will be used to render * returned as `MultiPoint` geometry, which will be used to render
* the style. * the style.
*/ */
new _ol_style_Style_({ new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: 'blue', color: 'blue',
width: 3 width: 3
@@ -26,7 +26,7 @@ var styles = [
color: 'rgba(0, 0, 255, 0.1)' color: 'rgba(0, 0, 255, 0.1)'
}) })
}), }),
new _ol_style_Style_({ new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
radius: 5, radius: 5,
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
+6 -6
View File
@@ -7,14 +7,14 @@ import VectorSource from '../src/ol/source/Vector.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_RegularShape_ from '../src/ol/style/RegularShape.js'; import _ol_style_RegularShape_ from '../src/ol/style/RegularShape.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
var stroke = new _ol_style_Stroke_({color: 'black', width: 2}); var stroke = new _ol_style_Stroke_({color: 'black', width: 2});
var fill = new _ol_style_Fill_({color: 'red'}); var fill = new _ol_style_Fill_({color: 'red'});
var styles = { var styles = {
'square': new _ol_style_Style_({ 'square': new Style({
image: new _ol_style_RegularShape_({ image: new _ol_style_RegularShape_({
fill: fill, fill: fill,
stroke: stroke, stroke: stroke,
@@ -23,7 +23,7 @@ var styles = {
angle: Math.PI / 4 angle: Math.PI / 4
}) })
}), }),
'triangle': new _ol_style_Style_({ 'triangle': new Style({
image: new _ol_style_RegularShape_({ image: new _ol_style_RegularShape_({
fill: fill, fill: fill,
stroke: stroke, stroke: stroke,
@@ -33,7 +33,7 @@ var styles = {
angle: 0 angle: 0
}) })
}), }),
'star': new _ol_style_Style_({ 'star': new Style({
image: new _ol_style_RegularShape_({ image: new _ol_style_RegularShape_({
fill: fill, fill: fill,
stroke: stroke, stroke: stroke,
@@ -43,7 +43,7 @@ var styles = {
angle: 0 angle: 0
}) })
}), }),
'cross': new _ol_style_Style_({ 'cross': new Style({
image: new _ol_style_RegularShape_({ image: new _ol_style_RegularShape_({
fill: fill, fill: fill,
stroke: stroke, stroke: stroke,
@@ -53,7 +53,7 @@ var styles = {
angle: 0 angle: 0
}) })
}), }),
'x': new _ol_style_Style_({ 'x': new Style({
image: new _ol_style_RegularShape_({ image: new _ol_style_RegularShape_({
fill: fill, fill: fill,
stroke: stroke, stroke: stroke,
+2 -2
View File
@@ -5,7 +5,7 @@ import _ol_render_ from '../src/ol/render.js';
import _ol_style_Circle_ from '../src/ol/style/Circle.js'; import _ol_style_Circle_ from '../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
var canvas = document.getElementById('canvas'); var canvas = document.getElementById('canvas');
@@ -13,7 +13,7 @@ var vectorContext = _ol_render_.toContext(canvas.getContext('2d'), {size: [100,
var fill = new _ol_style_Fill_({color: 'blue'}); var fill = new _ol_style_Fill_({color: 'blue'});
var stroke = new _ol_style_Stroke_({color: 'black'}); var stroke = new _ol_style_Stroke_({color: 'black'});
var style = new _ol_style_Style_({ var style = new Style({
fill: fill, fill: fill,
stroke: stroke, stroke: stroke,
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
+2 -2
View File
@@ -11,7 +11,7 @@ import VectorSource from '../src/ol/source/Vector.js';
import _ol_style_Circle_ from '../src/ol/style/Circle.js'; import _ol_style_Circle_ from '../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
var raster = new TileLayer({ var raster = new TileLayer({
source: new OSM() source: new OSM()
@@ -19,7 +19,7 @@ var raster = new TileLayer({
var vector = new VectorLayer({ var vector = new VectorLayer({
source: new VectorSource(), source: new VectorSource(),
style: new _ol_style_Style_({ style: new Style({
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
color: 'rgba(255, 255, 255, 0.2)' color: 'rgba(255, 255, 255, 0.2)'
}), }),
+2 -2
View File
@@ -7,10 +7,10 @@ import VectorLayer from '../src/ol/layer/Vector.js';
import BingMaps from '../src/ol/source/BingMaps.js'; import BingMaps from '../src/ol/source/BingMaps.js';
import VectorSource from '../src/ol/source/Vector.js'; import VectorSource from '../src/ol/source/Vector.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
import _ol_style_Text_ from '../src/ol/style/Text.js'; import _ol_style_Text_ from '../src/ol/style/Text.js';
var style = new _ol_style_Style_({ var style = new Style({
text: new _ol_style_Text_({ text: new _ol_style_Text_({
font: 'bold 11px "Open Sans", "Arial Unicode MS", "sans-serif"', font: 'bold 11px "Open Sans", "Arial Unicode MS", "sans-serif"',
placement: 'line', placement: 'line',
+2 -2
View File
@@ -9,7 +9,7 @@ import _ol_style_Circle_ from '../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_RegularShape_ from '../src/ol/style/RegularShape.js'; import _ol_style_RegularShape_ from '../src/ol/style/RegularShape.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
var atlasManager = new AtlasManager({ var atlasManager = new AtlasManager({
// we increase the initial size so that all symbols fit into // we increase the initial size so that all symbols fit into
@@ -92,7 +92,7 @@ for (i = 0; i < featureCount; ++i) {
[2 * e * Math.random() - e, 2 * e * Math.random() - e]); [2 * e * Math.random() - e, 2 * e * Math.random() - e]);
feature = new Feature(geometry); feature = new Feature(geometry);
feature.setStyle( feature.setStyle(
new _ol_style_Style_({ new Style({
image: symbols[i % symbolCount] image: symbols[i % symbolCount]
}) })
); );
+2 -2
View File
@@ -5,7 +5,7 @@ import LineString from '../src/ol/geom/LineString.js';
import VectorLayer from '../src/ol/layer/Vector.js'; import VectorLayer from '../src/ol/layer/Vector.js';
import VectorSource from '../src/ol/source/Vector.js'; import VectorSource from '../src/ol/source/Vector.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
var count = 10000; var count = 10000;
@@ -41,7 +41,7 @@ var vector = new VectorLayer({
features: features, features: features,
wrapX: false wrapX: false
}), }),
style: new _ol_style_Style_({ style: new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: '#666666', color: '#666666',
width: 1 width: 1
+4 -4
View File
@@ -8,7 +8,7 @@ import VectorSource from '../src/ol/source/Vector.js';
import _ol_style_Circle_ from '../src/ol/style/Circle.js'; import _ol_style_Circle_ from '../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
var count = 20000; var count = 20000;
@@ -24,14 +24,14 @@ for (var i = 0; i < count; ++i) {
} }
var styles = { var styles = {
'10': new _ol_style_Style_({ '10': new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
radius: 5, radius: 5,
fill: new _ol_style_Fill_({color: '#666666'}), fill: new _ol_style_Fill_({color: '#666666'}),
stroke: new _ol_style_Stroke_({color: '#bada55', width: 1}) stroke: new _ol_style_Stroke_({color: '#bada55', width: 1})
}) })
}), }),
'20': new _ol_style_Style_({ '20': new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
radius: 10, radius: 10,
fill: new _ol_style_Fill_({color: '#666666'}), fill: new _ol_style_Fill_({color: '#666666'}),
@@ -100,7 +100,7 @@ var stroke = new _ol_style_Stroke_({
color: 'rgba(255,255,0,0.9)', color: 'rgba(255,255,0,0.9)',
width: 3 width: 3
}); });
var style = new _ol_style_Style_({ var style = new Style({
stroke: stroke, stroke: stroke,
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
radius: 10, radius: 10,
+2 -2
View File
@@ -7,7 +7,7 @@ import TileJSON from '../src/ol/source/TileJSON.js';
import VectorSource from '../src/ol/source/Vector.js'; import VectorSource from '../src/ol/source/Vector.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
var raster = new TileLayer({ var raster = new TileLayer({
@@ -16,7 +16,7 @@ var raster = new TileLayer({
}) })
}); });
var style = new _ol_style_Style_({ var style = new Style({
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
color: 'rgba(255, 255, 255, 0.6)' color: 'rgba(255, 255, 255, 0.6)'
}), }),
+4 -4
View File
@@ -13,7 +13,7 @@ import TileLayer from '../src/ol/layer/Tile.js';
import VectorLayer from '../src/ol/layer/Vector.js'; import VectorLayer from '../src/ol/layer/Vector.js';
import OSM from '../src/ol/source/OSM.js'; import OSM from '../src/ol/source/OSM.js';
import VectorSource from '../src/ol/source/Vector.js'; import VectorSource from '../src/ol/source/Vector.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Circle_ from '../src/ol/style/Circle.js'; import _ol_style_Circle_ from '../src/ol/style/Circle.js';
@@ -28,7 +28,7 @@ var nodes = new VectorSource({wrapX: false});
var nodesLayer = new VectorLayer({ var nodesLayer = new VectorLayer({
source: nodes, source: nodes,
style: function(f) { style: function(f) {
var style = new _ol_style_Style_({ var style = new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
radius: 8, radius: 8,
fill: new _ol_style_Fill_({color: 'rgba(255, 0, 0, 0.2)'}), fill: new _ol_style_Fill_({color: 'rgba(255, 0, 0, 0.2)'}),
@@ -51,7 +51,7 @@ var edges = new VectorSource({wrapX: false});
var edgesLayer = new VectorLayer({ var edgesLayer = new VectorLayer({
source: edges, source: edges,
style: function(f) { style: function(f) {
var style = new _ol_style_Style_({ var style = new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: 'blue', color: 'blue',
width: 1 width: 1
@@ -73,7 +73,7 @@ var faces = new VectorSource({wrapX: false});
var facesLayer = new VectorLayer({ var facesLayer = new VectorLayer({
source: faces, source: faces,
style: function(f) { style: function(f) {
var style = new _ol_style_Style_({ var style = new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: 'black', color: 'black',
width: 1 width: 1
+5 -5
View File
@@ -9,7 +9,7 @@ import VectorSource from '../src/ol/source/Vector.js';
import XYZ from '../src/ol/source/XYZ.js'; import XYZ from '../src/ol/source/XYZ.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
import _ol_tilegrid_ from '../src/ol/tilegrid.js'; import _ol_tilegrid_ from '../src/ol/tilegrid.js';
@@ -20,7 +20,7 @@ var layer = '0';
var esrijsonFormat = new EsriJSON(); var esrijsonFormat = new EsriJSON();
var styleCache = { var styleCache = {
'ABANDONED': new _ol_style_Style_({ 'ABANDONED': new Style({
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
color: 'rgba(225, 225, 225, 255)' color: 'rgba(225, 225, 225, 255)'
}), }),
@@ -29,7 +29,7 @@ var styleCache = {
width: 0.4 width: 0.4
}) })
}), }),
'GAS': new _ol_style_Style_({ 'GAS': new Style({
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
color: 'rgba(255, 0, 0, 255)' color: 'rgba(255, 0, 0, 255)'
}), }),
@@ -38,7 +38,7 @@ var styleCache = {
width: 0.4 width: 0.4
}) })
}), }),
'OIL': new _ol_style_Style_({ 'OIL': new Style({
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
color: 'rgba(56, 168, 0, 255)' color: 'rgba(56, 168, 0, 255)'
}), }),
@@ -47,7 +47,7 @@ var styleCache = {
width: 0 width: 0
}) })
}), }),
'OILGAS': new _ol_style_Style_({ 'OILGAS': new Style({
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
color: 'rgba(168, 112, 0, 255)' color: 'rgba(168, 112, 0, 255)'
}), }),
+3 -3
View File
@@ -6,7 +6,7 @@ import VectorLayer from '../src/ol/layer/Vector.js';
import VectorSource from '../src/ol/source/Vector.js'; import VectorSource from '../src/ol/source/Vector.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
import _ol_style_Text_ from '../src/ol/style/Text.js'; import _ol_style_Text_ from '../src/ol/style/Text.js';
var map = new Map({ var map = new Map({
@@ -17,7 +17,7 @@ var map = new Map({
}) })
}); });
var labelStyle = new _ol_style_Style_({ var labelStyle = new Style({
geometry: function(feature) { geometry: function(feature) {
var geometry = feature.getGeometry(); var geometry = feature.getGeometry();
if (geometry.getType() == 'MultiPolygon') { if (geometry.getType() == 'MultiPolygon') {
@@ -47,7 +47,7 @@ var labelStyle = new _ol_style_Style_({
}) })
}) })
}); });
var countryStyle = new _ol_style_Style_({ var countryStyle = new Style({
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
color: 'rgba(255, 255, 255, 0.6)' color: 'rgba(255, 255, 255, 0.6)'
}), }),
+4 -4
View File
@@ -8,7 +8,7 @@ import VectorSource from '../src/ol/source/Vector.js';
import _ol_style_Circle_ from '../src/ol/style/Circle.js'; import _ol_style_Circle_ from '../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
import _ol_style_Text_ from '../src/ol/style/Text.js'; import _ol_style_Text_ from '../src/ol/style/Text.js';
var openSansAdded = false; var openSansAdded = false;
@@ -128,7 +128,7 @@ var createTextStyle = function(feature, resolution, dom) {
// Polygons // Polygons
function polygonStyleFunction(feature, resolution) { function polygonStyleFunction(feature, resolution) {
return new _ol_style_Style_({ return new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: 'blue', color: 'blue',
width: 1 width: 1
@@ -151,7 +151,7 @@ var vectorPolygons = new VectorLayer({
// Lines // Lines
function lineStyleFunction(feature, resolution) { function lineStyleFunction(feature, resolution) {
return new _ol_style_Style_({ return new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: 'green', color: 'green',
width: 2 width: 2
@@ -171,7 +171,7 @@ var vectorLines = new VectorLayer({
// Points // Points
function pointStyleFunction(feature, resolution) { function pointStyleFunction(feature, resolution) {
return new _ol_style_Style_({ return new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
radius: 10, radius: 10,
fill: new _ol_style_Fill_({color: 'rgba(255, 0, 0, 0.1)'}), fill: new _ol_style_Fill_({color: 'rgba(255, 0, 0, 0.1)'}),
+3 -3
View File
@@ -5,11 +5,11 @@ import VectorLayer from '../src/ol/layer/Vector.js';
import VectorSource from '../src/ol/source/Vector.js'; import VectorSource from '../src/ol/source/Vector.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
import _ol_style_Text_ from '../src/ol/style/Text.js'; import _ol_style_Text_ from '../src/ol/style/Text.js';
var style = new _ol_style_Style_({ var style = new Style({
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
color: 'rgba(255, 255, 255, 0.6)' color: 'rgba(255, 255, 255, 0.6)'
}), }),
@@ -49,7 +49,7 @@ var map = new Map({
}) })
}); });
var highlightStyle = new _ol_style_Style_({ var highlightStyle = new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: '#f00', color: '#f00',
width: 1 width: 1
+7 -7
View File
@@ -11,13 +11,13 @@ import VectorSource from '../src/ol/source/Vector.js';
import _ol_style_Circle_ from '../src/ol/style/Circle.js'; import _ol_style_Circle_ from '../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
var map; var map;
var styles = { var styles = {
'amenity': { 'amenity': {
'parking': new _ol_style_Style_({ 'parking': new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: 'rgba(170, 170, 170, 1.0)', color: 'rgba(170, 170, 170, 1.0)',
width: 1 width: 1
@@ -28,7 +28,7 @@ var styles = {
}) })
}, },
'building': { 'building': {
'.*': new _ol_style_Style_({ '.*': new Style({
zIndex: 100, zIndex: 100,
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: 'rgba(246, 99, 79, 1.0)', color: 'rgba(246, 99, 79, 1.0)',
@@ -40,13 +40,13 @@ var styles = {
}) })
}, },
'highway': { 'highway': {
'service': new _ol_style_Style_({ 'service': new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: 'rgba(255, 255, 255, 1.0)', color: 'rgba(255, 255, 255, 1.0)',
width: 2 width: 2
}) })
}), }),
'.*': new _ol_style_Style_({ '.*': new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: 'rgba(255, 255, 255, 1.0)', color: 'rgba(255, 255, 255, 1.0)',
width: 3 width: 3
@@ -54,7 +54,7 @@ var styles = {
}) })
}, },
'landuse': { 'landuse': {
'forest|grass|allotments': new _ol_style_Style_({ 'forest|grass|allotments': new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: 'rgba(140, 208, 95, 1.0)', color: 'rgba(140, 208, 95, 1.0)',
width: 1 width: 1
@@ -65,7 +65,7 @@ var styles = {
}) })
}, },
'natural': { 'natural': {
'tree': new _ol_style_Style_({ 'tree': new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
radius: 2, radius: 2,
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
+2 -2
View File
@@ -8,13 +8,13 @@ import VectorLayer from '../src/ol/layer/Vector.js';
import BingMaps from '../src/ol/source/BingMaps.js'; import BingMaps from '../src/ol/source/BingMaps.js';
import VectorSource from '../src/ol/source/Vector.js'; import VectorSource from '../src/ol/source/Vector.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
var vectorSource = new VectorSource(); var vectorSource = new VectorSource();
var vector = new VectorLayer({ var vector = new VectorLayer({
source: vectorSource, source: vectorSource,
style: new _ol_style_Style_({ style: new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: 'rgba(0, 0, 255, 1.0)', color: 'rgba(0, 0, 255, 1.0)',
width: 2 width: 2
+2 -2
View File
@@ -7,7 +7,7 @@ import _ol_loadingstrategy_ from '../src/ol/loadingstrategy.js';
import BingMaps from '../src/ol/source/BingMaps.js'; import BingMaps from '../src/ol/source/BingMaps.js';
import VectorSource from '../src/ol/source/Vector.js'; import VectorSource from '../src/ol/source/Vector.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../src/ol/style/Style.js'; import Style from '../src/ol/style/Style.js';
var vectorSource = new VectorSource({ var vectorSource = new VectorSource({
@@ -24,7 +24,7 @@ var vectorSource = new VectorSource({
var vector = new VectorLayer({ var vector = new VectorLayer({
source: vectorSource, source: vectorSource,
style: new _ol_style_Style_({ style: new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: 'rgba(0, 0, 255, 1.0)', color: 'rgba(0, 0, 255, 1.0)',
width: 2 width: 2
+2 -2
View File
@@ -7,7 +7,7 @@ import EventType from './events/EventType.js';
import {inherits} from './index.js'; import {inherits} from './index.js';
import BaseObject from './Object.js'; import BaseObject from './Object.js';
import Geometry from './geom/Geometry.js'; import Geometry from './geom/Geometry.js';
import _ol_style_Style_ from './style/Style.js'; import Style from './style/Style.js';
/** /**
* @classdesc * @classdesc
@@ -307,7 +307,7 @@ Feature.createStyleFunction = function(obj) {
if (Array.isArray(obj)) { if (Array.isArray(obj)) {
styles = obj; styles = obj;
} else { } else {
assert(obj instanceof _ol_style_Style_, assert(obj instanceof Style,
41); // Expected an `ol.style.Style` or an array of `ol.style.Style` 41); // Expected an `ol.style.Style` or an array of `ol.style.Style`
styles = [obj]; styles = [obj];
} }
+4 -4
View File
@@ -25,7 +25,7 @@ import _ol_style_Icon_ from '../style/Icon.js';
import IconAnchorUnits from '../style/IconAnchorUnits.js'; import IconAnchorUnits from '../style/IconAnchorUnits.js';
import IconOrigin from '../style/IconOrigin.js'; import IconOrigin from '../style/IconOrigin.js';
import _ol_style_Stroke_ from '../style/Stroke.js'; import _ol_style_Stroke_ from '../style/Stroke.js';
import _ol_style_Style_ from '../style/Style.js'; import Style from '../style/Style.js';
import _ol_style_Text_ from '../style/Text.js'; import _ol_style_Text_ from '../style/Text.js';
import _ol_xml_ from '../xml.js'; import _ol_xml_ from '../xml.js';
@@ -253,7 +253,7 @@ KML.createStyleDefaults_ = function() {
* @type {ol.style.Style} * @type {ol.style.Style}
* @private * @private
*/ */
KML.DEFAULT_STYLE_ = new _ol_style_Style_({ KML.DEFAULT_STYLE_ = new Style({
fill: KML.DEFAULT_FILL_STYLE_, fill: KML.DEFAULT_FILL_STYLE_,
image: KML.DEFAULT_IMAGE_STYLE_, image: KML.DEFAULT_IMAGE_STYLE_,
text: KML.DEFAULT_TEXT_STYLE_, text: KML.DEFAULT_TEXT_STYLE_,
@@ -325,7 +325,7 @@ KML.createNameStyleFunction_ = function(foundStyle, name) {
textStyle.setOffsetY(textOffset[1]); textStyle.setOffsetY(textOffset[1]);
textStyle.setTextAlign(textAlign); textStyle.setTextAlign(textAlign);
var nameStyle = new _ol_style_Style_({ var nameStyle = new Style({
text: textStyle text: textStyle
}); });
return nameStyle; return nameStyle;
@@ -1042,7 +1042,7 @@ KML.readStyle_ = function(node, objectStack) {
if (outline !== undefined && !outline) { if (outline !== undefined && !outline) {
strokeStyle = null; strokeStyle = null;
} }
return [new _ol_style_Style_({ return [new Style({
fill: fillStyle, fill: fillStyle,
image: imageStyle, image: imageStyle,
stroke: strokeStyle, stroke: strokeStyle,
+2 -2
View File
@@ -24,7 +24,7 @@ import PointerInteraction from '../interaction/Pointer.js';
import InteractionProperty from '../interaction/Property.js'; import InteractionProperty from '../interaction/Property.js';
import VectorLayer from '../layer/Vector.js'; import VectorLayer from '../layer/Vector.js';
import VectorSource from '../source/Vector.js'; import VectorSource from '../source/Vector.js';
import _ol_style_Style_ from '../style/Style.js'; import Style from '../style/Style.js';
/** /**
* @classdesc * @classdesc
@@ -297,7 +297,7 @@ inherits(Draw, PointerInteraction);
* @return {ol.StyleFunction} Styles. * @return {ol.StyleFunction} Styles.
*/ */
Draw.getDefaultStyleFunction = function() { Draw.getDefaultStyleFunction = function() {
var styles = _ol_style_Style_.createDefaultEditing(); var styles = Style.createDefaultEditing();
return function(feature, resolution) { return function(feature, resolution) {
return styles[feature.getGeometry().getType()]; return styles[feature.getGeometry().getType()];
}; };
+3 -3
View File
@@ -15,7 +15,7 @@ import _ol_interaction_ExtentEventType_ from '../interaction/ExtentEventType.js'
import PointerInteraction from '../interaction/Pointer.js'; import PointerInteraction from '../interaction/Pointer.js';
import VectorLayer from '../layer/Vector.js'; import VectorLayer from '../layer/Vector.js';
import VectorSource from '../source/Vector.js'; import VectorSource from '../source/Vector.js';
import _ol_style_Style_ from '../style/Style.js'; import Style from '../style/Style.js';
/** /**
* @classdesc * @classdesc
@@ -243,7 +243,7 @@ ExtentInteraction.handleUpEvent_ = function(mapBrowserEvent) {
* @private * @private
*/ */
ExtentInteraction.getDefaultExtentStyleFunction_ = function() { ExtentInteraction.getDefaultExtentStyleFunction_ = function() {
var style = _ol_style_Style_.createDefaultEditing(); var style = Style.createDefaultEditing();
return function(feature, resolution) { return function(feature, resolution) {
return style[GeometryType.POLYGON]; return style[GeometryType.POLYGON];
}; };
@@ -256,7 +256,7 @@ ExtentInteraction.getDefaultExtentStyleFunction_ = function() {
* @private * @private
*/ */
ExtentInteraction.getDefaultPointerStyleFunction_ = function() { ExtentInteraction.getDefaultPointerStyleFunction_ = function() {
var style = _ol_style_Style_.createDefaultEditing(); var style = Style.createDefaultEditing();
return function(feature, resolution) { return function(feature, resolution) {
return style[GeometryType.POINT]; return style[GeometryType.POINT];
}; };
+2 -2
View File
@@ -22,7 +22,7 @@ import VectorLayer from '../layer/Vector.js';
import VectorSource from '../source/Vector.js'; import VectorSource from '../source/Vector.js';
import VectorEventType from '../source/VectorEventType.js'; import VectorEventType from '../source/VectorEventType.js';
import RBush from '../structs/RBush.js'; import RBush from '../structs/RBush.js';
import _ol_style_Style_ from '../style/Style.js'; import Style from '../style/Style.js';
/** /**
* @classdesc * @classdesc
@@ -1193,7 +1193,7 @@ Modify.prototype.updateSegmentIndices_ = function(
* @return {ol.StyleFunction} Styles. * @return {ol.StyleFunction} Styles.
*/ */
Modify.getDefaultStyleFunction = function() { Modify.getDefaultStyleFunction = function() {
var style = _ol_style_Style_.createDefaultEditing(); var style = Style.createDefaultEditing();
return function(feature, resolution) { return function(feature, resolution) {
return style[GeometryType.POINT]; return style[GeometryType.POINT];
}; };
+2 -2
View File
@@ -13,7 +13,7 @@ import Interaction from '../interaction/Interaction.js';
import VectorLayer from '../layer/Vector.js'; import VectorLayer from '../layer/Vector.js';
import _ol_obj_ from '../obj.js'; import _ol_obj_ from '../obj.js';
import VectorSource from '../source/Vector.js'; import VectorSource from '../source/Vector.js';
import _ol_style_Style_ from '../style/Style.js'; import Style from '../style/Style.js';
/** /**
* @classdesc * @classdesc
@@ -325,7 +325,7 @@ Select.prototype.setMap = function(map) {
* @return {ol.StyleFunction} Styles. * @return {ol.StyleFunction} Styles.
*/ */
Select.getDefaultStyleFunction = function() { Select.getDefaultStyleFunction = function() {
var styles = _ol_style_Style_.createDefaultEditing(); var styles = Style.createDefaultEditing();
extend(styles[GeometryType.POLYGON], styles[GeometryType.LINE_STRING]); extend(styles[GeometryType.POLYGON], styles[GeometryType.LINE_STRING]);
extend(styles[GeometryType.GEOMETRY_COLLECTION], styles[GeometryType.LINE_STRING]); extend(styles[GeometryType.GEOMETRY_COLLECTION], styles[GeometryType.LINE_STRING]);
+2 -2
View File
@@ -10,7 +10,7 @@ import {clamp} from '../math.js';
import _ol_obj_ from '../obj.js'; import _ol_obj_ from '../obj.js';
import RenderEventType from '../render/EventType.js'; import RenderEventType from '../render/EventType.js';
import _ol_style_Icon_ from '../style/Icon.js'; import _ol_style_Icon_ from '../style/Icon.js';
import _ol_style_Style_ from '../style/Style.js'; import Style from '../style/Style.js';
/** /**
@@ -117,7 +117,7 @@ var Heatmap = function(opt_options) {
var style = this.styleCache_[index]; var style = this.styleCache_[index];
if (!style) { if (!style) {
style = [ style = [
new _ol_style_Style_({ new Style({
image: new _ol_style_Icon_({ image: new _ol_style_Icon_({
opacity: opacity, opacity: opacity,
src: this.circleImage_ src: this.circleImage_
+3 -3
View File
@@ -6,7 +6,7 @@ import LayerType from '../LayerType.js';
import Layer from '../layer/Layer.js'; import Layer from '../layer/Layer.js';
import _ol_layer_VectorRenderType_ from '../layer/VectorRenderType.js'; import _ol_layer_VectorRenderType_ from '../layer/VectorRenderType.js';
import _ol_obj_ from '../obj.js'; import _ol_obj_ from '../obj.js';
import _ol_style_Style_ from '../style/Style.js'; import Style from '../style/Style.js';
/** /**
@@ -207,9 +207,9 @@ VectorLayer.prototype.setRenderOrder = function(renderOrder) {
* @api * @api
*/ */
VectorLayer.prototype.setStyle = function(style) { VectorLayer.prototype.setStyle = function(style) {
this.style_ = style !== undefined ? style : _ol_style_Style_.defaultFunction; this.style_ = style !== undefined ? style : Style.defaultFunction;
this.styleFunction_ = style === null ? this.styleFunction_ = style === null ?
undefined : _ol_style_Style_.createFunction(this.style_); undefined : Style.createFunction(this.style_);
this.changed(); this.changed();
}; };
+35 -35
View File
@@ -18,7 +18,7 @@ import _ol_style_Stroke_ from '../style/Stroke.js';
* @param {olx.style.StyleOptions=} opt_options Style options. * @param {olx.style.StyleOptions=} opt_options Style options.
* @api * @api
*/ */
var _ol_style_Style_ = function(opt_options) { var Style = function(opt_options) {
var options = opt_options || {}; var options = opt_options || {};
@@ -32,7 +32,7 @@ var _ol_style_Style_ = function(opt_options) {
* @private * @private
* @type {!ol.StyleGeometryFunction} * @type {!ol.StyleGeometryFunction}
*/ */
this.geometryFunction_ = _ol_style_Style_.defaultGeometryFunction; this.geometryFunction_ = Style.defaultGeometryFunction;
if (options.geometry !== undefined) { if (options.geometry !== undefined) {
this.setGeometry(options.geometry); this.setGeometry(options.geometry);
@@ -82,12 +82,12 @@ var _ol_style_Style_ = function(opt_options) {
* @return {ol.style.Style} The cloned style. * @return {ol.style.Style} The cloned style.
* @api * @api
*/ */
_ol_style_Style_.prototype.clone = function() { Style.prototype.clone = function() {
var geometry = this.getGeometry(); var geometry = this.getGeometry();
if (geometry && geometry.clone) { if (geometry && geometry.clone) {
geometry = geometry.clone(); geometry = geometry.clone();
} }
return new _ol_style_Style_({ return new Style({
geometry: geometry, geometry: geometry,
fill: this.getFill() ? this.getFill().clone() : undefined, fill: this.getFill() ? this.getFill().clone() : undefined,
image: this.getImage() ? this.getImage().clone() : undefined, image: this.getImage() ? this.getImage().clone() : undefined,
@@ -104,7 +104,7 @@ _ol_style_Style_.prototype.clone = function() {
* @return {ol.StyleRenderFunction|null} Custom renderer function. * @return {ol.StyleRenderFunction|null} Custom renderer function.
* @api * @api
*/ */
_ol_style_Style_.prototype.getRenderer = function() { Style.prototype.getRenderer = function() {
return this.renderer_; return this.renderer_;
}; };
@@ -115,7 +115,7 @@ _ol_style_Style_.prototype.getRenderer = function() {
* @param {ol.StyleRenderFunction|null} renderer Custom renderer function. * @param {ol.StyleRenderFunction|null} renderer Custom renderer function.
* @api * @api
*/ */
_ol_style_Style_.prototype.setRenderer = function(renderer) { Style.prototype.setRenderer = function(renderer) {
this.renderer_ = renderer; this.renderer_ = renderer;
}; };
@@ -127,7 +127,7 @@ _ol_style_Style_.prototype.setRenderer = function(renderer) {
* be rendered with this style. * be rendered with this style.
* @api * @api
*/ */
_ol_style_Style_.prototype.getGeometry = function() { Style.prototype.getGeometry = function() {
return this.geometry_; return this.geometry_;
}; };
@@ -138,7 +138,7 @@ _ol_style_Style_.prototype.getGeometry = function() {
* and returns the geometry to render instead of the feature's geometry. * and returns the geometry to render instead of the feature's geometry.
* @api * @api
*/ */
_ol_style_Style_.prototype.getGeometryFunction = function() { Style.prototype.getGeometryFunction = function() {
return this.geometryFunction_; return this.geometryFunction_;
}; };
@@ -148,7 +148,7 @@ _ol_style_Style_.prototype.getGeometryFunction = function() {
* @return {ol.style.Fill} Fill style. * @return {ol.style.Fill} Fill style.
* @api * @api
*/ */
_ol_style_Style_.prototype.getFill = function() { Style.prototype.getFill = function() {
return this.fill_; return this.fill_;
}; };
@@ -158,7 +158,7 @@ _ol_style_Style_.prototype.getFill = function() {
* @param {ol.style.Fill} fill Fill style. * @param {ol.style.Fill} fill Fill style.
* @api * @api
*/ */
_ol_style_Style_.prototype.setFill = function(fill) { Style.prototype.setFill = function(fill) {
this.fill_ = fill; this.fill_ = fill;
}; };
@@ -168,7 +168,7 @@ _ol_style_Style_.prototype.setFill = function(fill) {
* @return {ol.style.Image} Image style. * @return {ol.style.Image} Image style.
* @api * @api
*/ */
_ol_style_Style_.prototype.getImage = function() { Style.prototype.getImage = function() {
return this.image_; return this.image_;
}; };
@@ -178,7 +178,7 @@ _ol_style_Style_.prototype.getImage = function() {
* @param {ol.style.Image} image Image style. * @param {ol.style.Image} image Image style.
* @api * @api
*/ */
_ol_style_Style_.prototype.setImage = function(image) { Style.prototype.setImage = function(image) {
this.image_ = image; this.image_ = image;
}; };
@@ -188,7 +188,7 @@ _ol_style_Style_.prototype.setImage = function(image) {
* @return {ol.style.Stroke} Stroke style. * @return {ol.style.Stroke} Stroke style.
* @api * @api
*/ */
_ol_style_Style_.prototype.getStroke = function() { Style.prototype.getStroke = function() {
return this.stroke_; return this.stroke_;
}; };
@@ -198,7 +198,7 @@ _ol_style_Style_.prototype.getStroke = function() {
* @param {ol.style.Stroke} stroke Stroke style. * @param {ol.style.Stroke} stroke Stroke style.
* @api * @api
*/ */
_ol_style_Style_.prototype.setStroke = function(stroke) { Style.prototype.setStroke = function(stroke) {
this.stroke_ = stroke; this.stroke_ = stroke;
}; };
@@ -208,7 +208,7 @@ _ol_style_Style_.prototype.setStroke = function(stroke) {
* @return {ol.style.Text} Text style. * @return {ol.style.Text} Text style.
* @api * @api
*/ */
_ol_style_Style_.prototype.getText = function() { Style.prototype.getText = function() {
return this.text_; return this.text_;
}; };
@@ -218,7 +218,7 @@ _ol_style_Style_.prototype.getText = function() {
* @param {ol.style.Text} text Text style. * @param {ol.style.Text} text Text style.
* @api * @api
*/ */
_ol_style_Style_.prototype.setText = function(text) { Style.prototype.setText = function(text) {
this.text_ = text; this.text_ = text;
}; };
@@ -228,7 +228,7 @@ _ol_style_Style_.prototype.setText = function(text) {
* @return {number|undefined} ZIndex. * @return {number|undefined} ZIndex.
* @api * @api
*/ */
_ol_style_Style_.prototype.getZIndex = function() { Style.prototype.getZIndex = function() {
return this.zIndex_; return this.zIndex_;
}; };
@@ -241,7 +241,7 @@ _ol_style_Style_.prototype.getZIndex = function() {
* for this style. * for this style.
* @api * @api
*/ */
_ol_style_Style_.prototype.setGeometry = function(geometry) { Style.prototype.setGeometry = function(geometry) {
if (typeof geometry === 'function') { if (typeof geometry === 'function') {
this.geometryFunction_ = geometry; this.geometryFunction_ = geometry;
} else if (typeof geometry === 'string') { } else if (typeof geometry === 'string') {
@@ -249,7 +249,7 @@ _ol_style_Style_.prototype.setGeometry = function(geometry) {
return /** @type {ol.geom.Geometry} */ (feature.get(geometry)); return /** @type {ol.geom.Geometry} */ (feature.get(geometry));
}; };
} else if (!geometry) { } else if (!geometry) {
this.geometryFunction_ = _ol_style_Style_.defaultGeometryFunction; this.geometryFunction_ = Style.defaultGeometryFunction;
} else if (geometry !== undefined) { } else if (geometry !== undefined) {
this.geometryFunction_ = function() { this.geometryFunction_ = function() {
return /** @type {ol.geom.Geometry} */ (geometry); return /** @type {ol.geom.Geometry} */ (geometry);
@@ -265,7 +265,7 @@ _ol_style_Style_.prototype.setGeometry = function(geometry) {
* @param {number|undefined} zIndex ZIndex. * @param {number|undefined} zIndex ZIndex.
* @api * @api
*/ */
_ol_style_Style_.prototype.setZIndex = function(zIndex) { Style.prototype.setZIndex = function(zIndex) {
this.zIndex_ = zIndex; this.zIndex_ = zIndex;
}; };
@@ -278,7 +278,7 @@ _ol_style_Style_.prototype.setZIndex = function(zIndex) {
* A style function, a single style, or an array of styles. * A style function, a single style, or an array of styles.
* @return {ol.StyleFunction} A style function. * @return {ol.StyleFunction} A style function.
*/ */
_ol_style_Style_.createFunction = function(obj) { Style.createFunction = function(obj) {
var styleFunction; var styleFunction;
if (typeof obj === 'function') { if (typeof obj === 'function') {
@@ -291,7 +291,7 @@ _ol_style_Style_.createFunction = function(obj) {
if (Array.isArray(obj)) { if (Array.isArray(obj)) {
styles = obj; styles = obj;
} else { } else {
assert(obj instanceof _ol_style_Style_, assert(obj instanceof Style,
41); // Expected an `ol.style.Style` or an array of `ol.style.Style` 41); // Expected an `ol.style.Style` or an array of `ol.style.Style`
styles = [obj]; styles = [obj];
} }
@@ -307,7 +307,7 @@ _ol_style_Style_.createFunction = function(obj) {
* @type {Array.<ol.style.Style>} * @type {Array.<ol.style.Style>}
* @private * @private
*/ */
_ol_style_Style_.default_ = null; Style.default_ = null;
/** /**
@@ -315,13 +315,13 @@ _ol_style_Style_.default_ = null;
* @param {number} resolution Resolution. * @param {number} resolution Resolution.
* @return {Array.<ol.style.Style>} Style. * @return {Array.<ol.style.Style>} Style.
*/ */
_ol_style_Style_.defaultFunction = function(feature, resolution) { Style.defaultFunction = function(feature, resolution) {
// We don't use an immediately-invoked function // We don't use an immediately-invoked function
// and a closure so we don't get an error at script evaluation time in // and a closure so we don't get an error at script evaluation time in
// browsers that do not support Canvas. (ol.style.Circle does // browsers that do not support Canvas. (ol.style.Circle does
// canvas.getContext('2d') at construction time, which will cause an.error // canvas.getContext('2d') at construction time, which will cause an.error
// in such browsers.) // in such browsers.)
if (!_ol_style_Style_.default_) { if (!Style.default_) {
var fill = new _ol_style_Fill_({ var fill = new _ol_style_Fill_({
color: 'rgba(255,255,255,0.4)' color: 'rgba(255,255,255,0.4)'
}); });
@@ -329,8 +329,8 @@ _ol_style_Style_.defaultFunction = function(feature, resolution) {
color: '#3399CC', color: '#3399CC',
width: 1.25 width: 1.25
}); });
_ol_style_Style_.default_ = [ Style.default_ = [
new _ol_style_Style_({ new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
fill: fill, fill: fill,
stroke: stroke, stroke: stroke,
@@ -341,7 +341,7 @@ _ol_style_Style_.defaultFunction = function(feature, resolution) {
}) })
]; ];
} }
return _ol_style_Style_.default_; return Style.default_;
}; };
@@ -349,14 +349,14 @@ _ol_style_Style_.defaultFunction = function(feature, resolution) {
* Default styles for editing features. * Default styles for editing features.
* @return {Object.<ol.geom.GeometryType, Array.<ol.style.Style>>} Styles * @return {Object.<ol.geom.GeometryType, Array.<ol.style.Style>>} Styles
*/ */
_ol_style_Style_.createDefaultEditing = function() { Style.createDefaultEditing = function() {
/** @type {Object.<ol.geom.GeometryType, Array.<ol.style.Style>>} */ /** @type {Object.<ol.geom.GeometryType, Array.<ol.style.Style>>} */
var styles = {}; var styles = {};
var white = [255, 255, 255, 1]; var white = [255, 255, 255, 1];
var blue = [0, 153, 255, 1]; var blue = [0, 153, 255, 1];
var width = 3; var width = 3;
styles[GeometryType.POLYGON] = [ styles[GeometryType.POLYGON] = [
new _ol_style_Style_({ new Style({
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
color: [255, 255, 255, 0.5] color: [255, 255, 255, 0.5]
}) })
@@ -366,13 +366,13 @@ _ol_style_Style_.createDefaultEditing = function() {
styles[GeometryType.POLYGON]; styles[GeometryType.POLYGON];
styles[GeometryType.LINE_STRING] = [ styles[GeometryType.LINE_STRING] = [
new _ol_style_Style_({ new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: white, color: white,
width: width + 2 width: width + 2
}) })
}), }),
new _ol_style_Style_({ new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: blue, color: blue,
width: width width: width
@@ -389,7 +389,7 @@ _ol_style_Style_.createDefaultEditing = function() {
styles[GeometryType.POINT] = [ styles[GeometryType.POINT] = [
new _ol_style_Style_({ new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
radius: width * 2, radius: width * 2,
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
@@ -422,7 +422,7 @@ _ol_style_Style_.createDefaultEditing = function() {
* for. * for.
* @return {ol.geom.Geometry|ol.render.Feature|undefined} Geometry to render. * @return {ol.geom.Geometry|ol.render.Feature|undefined} Geometry to render.
*/ */
_ol_style_Style_.defaultGeometryFunction = function(feature) { Style.defaultGeometryFunction = function(feature) {
return feature.getGeometry(); return feature.getGeometry();
}; };
export default _ol_style_Style_; export default Style;
+2 -2
View File
@@ -4,7 +4,7 @@ import MultiPolygon from '../../../../src/ol/geom/MultiPolygon.js';
import TileLayer from '../../../../src/ol/layer/Tile.js'; import TileLayer from '../../../../src/ol/layer/Tile.js';
import XYZ from '../../../../src/ol/source/XYZ.js'; import XYZ from '../../../../src/ol/source/XYZ.js';
import _ol_style_Stroke_ from '../../../../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../../../../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../../../../src/ol/style/Style.js'; import Style from '../../../../src/ol/style/Style.js';
describe('layer clipping', function() { describe('layer clipping', function() {
@@ -69,7 +69,7 @@ describe('layer clipping', function() {
[[[80, -40], [120, 0], [80, 40], [40, 0], [80, -40]]] [[[80, -40], [120, 0], [80, 40], [40, 0], [80, -40]]]
]).transform('EPSG:4326', 'EPSG:3857'); ]).transform('EPSG:4326', 'EPSG:3857');
var style = new _ol_style_Style_({ var style = new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
width: 2, width: 2,
color: 'blue' color: 'blue'
+35 -35
View File
@@ -11,7 +11,7 @@ import VectorSource from '../../../../src/ol/source/Vector.js';
import _ol_style_Circle_ from '../../../../src/ol/style/Circle.js'; import _ol_style_Circle_ from '../../../../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../../../../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../../../../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../../../../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../../../../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../../../../src/ol/style/Style.js'; import Style from '../../../../src/ol/style/Style.js';
import _ol_style_Text_ from '../../../../src/ol/style/Text.js'; import _ol_style_Text_ from '../../../../src/ol/style/Text.js';
@@ -79,7 +79,7 @@ describe('ol.rendering.layer.Vector', function() {
[center[0], center[1] - 1], [center[0], center[1] - 1],
[center[0], center[1] + 1] [center[0], center[1] + 1]
])); ]));
smallLine.setStyle(new _ol_style_Style_({ smallLine.setStyle(new Style({
zIndex: -99, zIndex: -99,
stroke: new _ol_style_Stroke_({width: 75, color: 'red'}) stroke: new _ol_style_Stroke_({width: 75, color: 'red'})
})); }));
@@ -105,7 +105,7 @@ describe('ol.rendering.layer.Vector', function() {
[center[0], center[1] - 1], [center[0], center[1] - 1],
[center[0], center[1] + 1] [center[0], center[1] + 1]
])); ]));
smallLine.setStyle(new _ol_style_Style_({ smallLine.setStyle(new Style({
zIndex: -99, zIndex: -99,
stroke: new _ol_style_Stroke_({width: 75, color: 'red'}) stroke: new _ol_style_Stroke_({width: 75, color: 'red'})
})); }));
@@ -133,10 +133,10 @@ describe('ol.rendering.layer.Vector', function() {
[center[0], center[1] + 1] [center[0], center[1] + 1]
])); ]));
smallLine.setStyle([ smallLine.setStyle([
new _ol_style_Style_({ new Style({
stroke: new _ol_style_Stroke_({width: 75, color: 'red'}) stroke: new _ol_style_Stroke_({width: 75, color: 'red'})
}), }),
new _ol_style_Style_({ new Style({
stroke: new _ol_style_Stroke_({width: 45, color: 'white'}) stroke: new _ol_style_Stroke_({width: 45, color: 'white'})
}) })
]); ]);
@@ -146,10 +146,10 @@ describe('ol.rendering.layer.Vector', function() {
[center[0], center[1] + 1000] [center[0], center[1] + 1000]
])); ]));
smallLine2.setStyle([ smallLine2.setStyle([
new _ol_style_Style_({ new Style({
stroke: new _ol_style_Stroke_({width: 35, color: 'blue'}) stroke: new _ol_style_Stroke_({width: 35, color: 'blue'})
}), }),
new _ol_style_Style_({ new Style({
stroke: new _ol_style_Stroke_({width: 15, color: 'green'}) stroke: new _ol_style_Stroke_({width: 15, color: 'green'})
}) })
]); ]);
@@ -172,10 +172,10 @@ describe('ol.rendering.layer.Vector', function() {
[center[0], center[1] + 1] [center[0], center[1] + 1]
])); ]));
smallLine.setStyle([ smallLine.setStyle([
new _ol_style_Style_({ new Style({
stroke: new _ol_style_Stroke_({width: 75, color: 'red'}) stroke: new _ol_style_Stroke_({width: 75, color: 'red'})
}), }),
new _ol_style_Style_({ new Style({
stroke: new _ol_style_Stroke_({width: 45, color: 'white'}) stroke: new _ol_style_Stroke_({width: 45, color: 'white'})
}) })
]); ]);
@@ -185,10 +185,10 @@ describe('ol.rendering.layer.Vector', function() {
[center[0], center[1] + 1000] [center[0], center[1] + 1000]
])); ]));
smallLine2.setStyle([ smallLine2.setStyle([
new _ol_style_Style_({ new Style({
stroke: new _ol_style_Stroke_({width: 35, color: 'blue'}) stroke: new _ol_style_Stroke_({width: 35, color: 'blue'})
}), }),
new _ol_style_Style_({ new Style({
stroke: new _ol_style_Stroke_({width: 15, color: 'green'}) stroke: new _ol_style_Stroke_({width: 15, color: 'green'})
}) })
]); ]);
@@ -212,7 +212,7 @@ describe('ol.rendering.layer.Vector', function() {
addCircle(500); addCircle(500);
map.addLayer(new VectorLayer({ map.addLayer(new VectorLayer({
source: source, source: source,
style: new _ol_style_Style_({ style: new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
width: 2, width: 2,
color: 'black' color: 'black'
@@ -233,7 +233,7 @@ describe('ol.rendering.layer.Vector', function() {
map.addLayer(new VectorLayer({ map.addLayer(new VectorLayer({
renderMode: 'image', renderMode: 'image',
source: source, source: source,
style: new _ol_style_Style_({ style: new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
width: 2, width: 2,
color: 'black' color: 'black'
@@ -254,7 +254,7 @@ describe('ol.rendering.layer.Vector', function() {
map.addLayer(new VectorLayer({ map.addLayer(new VectorLayer({
renderMode: 'image', renderMode: 'image',
source: source, source: source,
style: new _ol_style_Style_({ style: new Style({
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
color: 'rgba(255,0,0,0.5)' color: 'rgba(255,0,0,0.5)'
}), }),
@@ -285,7 +285,7 @@ describe('ol.rendering.layer.Vector', function() {
addPolygon(720); addPolygon(720);
map.addLayer(new VectorLayer({ map.addLayer(new VectorLayer({
source: source, source: source,
style: new _ol_style_Style_({ style: new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: '#3399CC', color: '#3399CC',
width: 1.25 width: 1.25
@@ -309,7 +309,7 @@ describe('ol.rendering.layer.Vector', function() {
addLineString(720); addLineString(720);
map.addLayer(new VectorLayer({ map.addLayer(new VectorLayer({
source: source, source: source,
style: new _ol_style_Style_({ style: new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: '#3399CC', color: '#3399CC',
width: 1.25 width: 1.25
@@ -350,7 +350,7 @@ describe('ol.rendering.layer.Vector', function() {
source: createSource(true), source: createSource(true),
style: function(feature) { style: function(feature) {
alternateColor(); alternateColor();
return new _ol_style_Style_({ return new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: alternateColor(), color: alternateColor(),
width: 1.25 width: 1.25
@@ -401,7 +401,7 @@ describe('ol.rendering.layer.Vector', function() {
source: createSource(true), source: createSource(true),
style: function(feature) { style: function(feature) {
alternateColor(); alternateColor();
return new _ol_style_Style_({ return new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: alternateColor(), color: alternateColor(),
width: 1.25 width: 1.25
@@ -470,7 +470,7 @@ describe('ol.rendering.layer.Vector', function() {
source: new VectorSource({ source: new VectorSource({
features: [feature] features: [feature]
}), }),
style: new _ol_style_Style_({ style: new Style({
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
color: 'blue' color: 'blue'
}) })
@@ -534,7 +534,7 @@ describe('ol.rendering.layer.Vector', function() {
}); });
it('renders partially out-of-view polygons with a fill and stroke', function(done) { it('renders partially out-of-view polygons with a fill and stroke', function(done) {
layer.setStyle(new _ol_style_Style_({ layer.setStyle(new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: [0, 0, 0, 1], color: [0, 0, 0, 1],
width: 2 width: 2
@@ -550,7 +550,7 @@ describe('ol.rendering.layer.Vector', function() {
}); });
it('renders partially out-of-view polygons with a fill', function(done) { it('renders partially out-of-view polygons with a fill', function(done) {
layer.setStyle(new _ol_style_Style_({ layer.setStyle(new Style({
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
color: [0, 0, 0, 1] color: [0, 0, 0, 1]
}) })
@@ -562,7 +562,7 @@ describe('ol.rendering.layer.Vector', function() {
}); });
it('renders partially out-of-view polygons with a stroke', function(done) { it('renders partially out-of-view polygons with a stroke', function(done) {
layer.setStyle(new _ol_style_Style_({ layer.setStyle(new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: [0, 0, 0, 1], color: [0, 0, 0, 1],
width: 2 width: 2
@@ -605,7 +605,7 @@ describe('ol.rendering.layer.Vector', function() {
layer.setDeclutter(true); layer.setDeclutter(true);
layer.setStyle(function(feature) { layer.setStyle(function(feature) {
return new _ol_style_Style_({ return new Style({
text: new _ol_style_Text_({ text: new _ol_style_Text_({
text: feature.get('text'), text: feature.get('text'),
font: '12px sans-serif' font: '12px sans-serif'
@@ -646,7 +646,7 @@ describe('ol.rendering.layer.Vector', function() {
layer.setDeclutter(true); layer.setDeclutter(true);
layer.setStyle(function(feature) { layer.setStyle(function(feature) {
return new _ol_style_Style_({ return new Style({
text: new _ol_style_Text_({ text: new _ol_style_Text_({
text: feature.get('text'), text: feature.get('text'),
font: '12px sans-serif' font: '12px sans-serif'
@@ -688,7 +688,7 @@ describe('ol.rendering.layer.Vector', function() {
layer.setDeclutter(true); layer.setDeclutter(true);
layer.setStyle(function(feature) { layer.setStyle(function(feature) {
return new _ol_style_Style_({ return new Style({
zIndex: feature.get('zIndex'), zIndex: feature.get('zIndex'),
text: new _ol_style_Text_({ text: new _ol_style_Text_({
text: feature.get('text'), text: feature.get('text'),
@@ -723,7 +723,7 @@ describe('ol.rendering.layer.Vector', function() {
layer.setDeclutter(true); layer.setDeclutter(true);
layer.setStyle(function(feature) { layer.setStyle(function(feature) {
return new _ol_style_Style_({ return new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
radius: 15, radius: 15,
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
@@ -763,7 +763,7 @@ describe('ol.rendering.layer.Vector', function() {
layer.setDeclutter(true); layer.setDeclutter(true);
layer.setStyle(function(feature) { layer.setStyle(function(feature) {
return new _ol_style_Style_({ return new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
radius: 15, radius: 15,
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
@@ -804,7 +804,7 @@ describe('ol.rendering.layer.Vector', function() {
layer.setDeclutter(true); layer.setDeclutter(true);
layer.setStyle(function(feature) { layer.setStyle(function(feature) {
return new _ol_style_Style_({ return new Style({
zIndex: feature.get('zIndex'), zIndex: feature.get('zIndex'),
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
radius: 15, radius: 15,
@@ -843,7 +843,7 @@ describe('ol.rendering.layer.Vector', function() {
layer.setDeclutter(true); layer.setDeclutter(true);
layer.setStyle(function(feature) { layer.setStyle(function(feature) {
return new _ol_style_Style_({ return new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
radius: 5, radius: 5,
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
@@ -873,7 +873,7 @@ describe('ol.rendering.layer.Vector', function() {
map.addLayer(layer); map.addLayer(layer);
var point = new Feature(new Point(center)); var point = new Feature(new Point(center));
point.setStyle(new _ol_style_Style_({ point.setStyle(new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
radius: 8, radius: 8,
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
@@ -885,7 +885,7 @@ describe('ol.rendering.layer.Vector', function() {
[center[0] - 650, center[1] - 200], [center[0] - 650, center[1] - 200],
[center[0] + 650, center[1] - 200] [center[0] + 650, center[1] - 200]
])); ]));
line.setStyle(new _ol_style_Style_({ line.setStyle(new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: '#CCC', color: '#CCC',
width: 12 width: 12
@@ -916,7 +916,7 @@ describe('ol.rendering.layer.Vector', function() {
map.addLayer(layer); map.addLayer(layer);
var point = new Feature(new Point(center)); var point = new Feature(new Point(center));
point.setStyle(new _ol_style_Style_({ point.setStyle(new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
radius: 8, radius: 8,
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
@@ -928,7 +928,7 @@ describe('ol.rendering.layer.Vector', function() {
[center[0] - 650, center[1] - 200], [center[0] - 650, center[1] - 200],
[center[0] + 650, center[1] - 200] [center[0] + 650, center[1] - 200]
])); ]));
line.setStyle(new _ol_style_Style_({ line.setStyle(new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: '#CCC', color: '#CCC',
width: 12 width: 12
@@ -959,7 +959,7 @@ describe('ol.rendering.layer.Vector', function() {
map.addLayer(layer); map.addLayer(layer);
var point = new Feature(new Point(center)); var point = new Feature(new Point(center));
point.setStyle(new _ol_style_Style_({ point.setStyle(new Style({
zIndex: 2, zIndex: 2,
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
radius: 8, radius: 8,
@@ -972,7 +972,7 @@ describe('ol.rendering.layer.Vector', function() {
[center[0] - 650, center[1] - 200], [center[0] - 650, center[1] - 200],
[center[0] + 650, center[1] - 200] [center[0] + 650, center[1] - 200]
])); ]));
line.setStyle(new _ol_style_Style_({ line.setStyle(new Style({
zIndex: 1, zIndex: 1,
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: '#CCC', color: '#CCC',
+3 -3
View File
@@ -10,7 +10,7 @@ import VectorSource from '../../../../src/ol/source/Vector.js';
import VectorTileSource from '../../../../src/ol/source/VectorTile.js'; import VectorTileSource from '../../../../src/ol/source/VectorTile.js';
import _ol_style_Circle_ from '../../../../src/ol/style/Circle.js'; import _ol_style_Circle_ from '../../../../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../../../../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../../../../src/ol/style/Fill.js';
import _ol_style_Style_ from '../../../../src/ol/style/Style.js'; import Style from '../../../../src/ol/style/Style.js';
import _ol_style_Text_ from '../../../../src/ol/style/Text.js'; import _ol_style_Text_ from '../../../../src/ol/style/Text.js';
import _ol_tilegrid_ from '../../../../src/ol/tilegrid.js'; import _ol_tilegrid_ from '../../../../src/ol/tilegrid.js';
@@ -104,7 +104,7 @@ describe('ol.rendering.layer.VectorTile', function() {
map.addLayer(new VectorLayer({ map.addLayer(new VectorLayer({
zIndex: 1, zIndex: 1,
source: vectorSource, source: vectorSource,
style: new _ol_style_Style_({ style: new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
radius: 10, radius: 10,
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
@@ -143,7 +143,7 @@ describe('ol.rendering.layer.VectorTile', function() {
var style = function(feature, resolution) { var style = function(feature, resolution) {
var geom = feature.getGeometry(); var geom = feature.getGeometry();
if (geom.getType() == 'Point') { if (geom.getType() == 'Point') {
return new _ol_style_Style_({ return new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
radius: 7, radius: 7,
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
+8 -8
View File
@@ -7,7 +7,7 @@ import CanvasImmediateRenderer from '../../../src/ol/render/canvas/Immediate.js'
import _ol_style_Circle_ from '../../../src/ol/style/Circle.js'; import _ol_style_Circle_ from '../../../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../../../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../../../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../../../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../../../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../../../src/ol/style/Style.js'; import Style from '../../../src/ol/style/Style.js';
function getContext() { function getContext() {
return document.createElement('canvas').getContext('2d'); return document.createElement('canvas').getContext('2d');
@@ -33,7 +33,7 @@ describe('ol.render', function() {
size: [100, 100] size: [100, 100]
}); });
var style = new _ol_style_Style_({ var style = new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
color: 'green' color: 'green'
@@ -57,7 +57,7 @@ describe('ol.render', function() {
size: [100, 100] size: [100, 100]
}); });
var style = new _ol_style_Style_({ var style = new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: 'red', color: 'red',
width: 14 width: 14
@@ -81,7 +81,7 @@ describe('ol.render', function() {
size: [100, 100] size: [100, 100]
}); });
var style = new _ol_style_Style_({ var style = new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
lineCap: 'butt', lineCap: 'butt',
color: 'red', color: 'red',
@@ -106,7 +106,7 @@ describe('ol.render', function() {
size: [100, 100] size: [100, 100]
}); });
var style = new _ol_style_Style_({ var style = new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
lineJoin: 'bevel', lineJoin: 'bevel',
color: 'red', color: 'red',
@@ -131,7 +131,7 @@ describe('ol.render', function() {
size: [100, 100] size: [100, 100]
}); });
var style = new _ol_style_Style_({ var style = new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: 'blue', color: 'blue',
width: 8 width: 8
@@ -160,7 +160,7 @@ describe('ol.render', function() {
size: [100, 100] size: [100, 100]
}); });
var style = new _ol_style_Style_({ var style = new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
lineDash: [10, 5] lineDash: [10, 5]
}) })
@@ -185,7 +185,7 @@ describe('ol.render', function() {
size: [100, 100] size: [100, 100]
}); });
var style = new _ol_style_Style_({ var style = new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
lineDash: [10, 5], lineDash: [10, 5],
lineDashOffset: 5 lineDashOffset: 5
+10 -10
View File
@@ -7,7 +7,7 @@ import VectorLayer from '../../../../src/ol/layer/Vector.js';
import VectorSource from '../../../../src/ol/source/Vector.js'; import VectorSource from '../../../../src/ol/source/Vector.js';
import _ol_style_Circle_ from '../../../../src/ol/style/Circle.js'; import _ol_style_Circle_ from '../../../../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../../../../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../../../../src/ol/style/Fill.js';
import _ol_style_Style_ from '../../../../src/ol/style/Style.js'; import Style from '../../../../src/ol/style/Style.js';
import _ol_style_Stroke_ from '../../../../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../../../../src/ol/style/Stroke.js';
@@ -48,7 +48,7 @@ describe('ol.rendering.style.Circle', function() {
feature = new Feature({ feature = new Feature({
geometry: multi ? new MultiPoint([[-20, 18]]) : new Point([-20, 18]) geometry: multi ? new MultiPoint([[-20, 18]]) : new Point([-20, 18])
}); });
feature.setStyle(new _ol_style_Style_({ feature.setStyle(new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
radius: 2, radius: 2,
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
@@ -61,7 +61,7 @@ describe('ol.rendering.style.Circle', function() {
feature = new Feature({ feature = new Feature({
geometry: multi ? new MultiPoint([[-10, 18]]) : new Point([-10, 18]) geometry: multi ? new MultiPoint([[-10, 18]]) : new Point([-10, 18])
}); });
feature.setStyle(new _ol_style_Style_({ feature.setStyle(new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
radius: 4, radius: 4,
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
@@ -74,7 +74,7 @@ describe('ol.rendering.style.Circle', function() {
feature = new Feature({ feature = new Feature({
geometry: multi ? new MultiPoint([[4, 18]]) : new Point([4, 18]) geometry: multi ? new MultiPoint([[4, 18]]) : new Point([4, 18])
}); });
feature.setStyle(new _ol_style_Style_({ feature.setStyle(new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
radius: 6, radius: 6,
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
@@ -87,7 +87,7 @@ describe('ol.rendering.style.Circle', function() {
feature = new Feature({ feature = new Feature({
geometry: multi ? new MultiPoint([[-20, 3]]) : new Point([-20, 3]) geometry: multi ? new MultiPoint([[-20, 3]]) : new Point([-20, 3])
}); });
feature.setStyle(new _ol_style_Style_({ feature.setStyle(new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
radius: 2, radius: 2,
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
@@ -104,7 +104,7 @@ describe('ol.rendering.style.Circle', function() {
feature = new Feature({ feature = new Feature({
geometry: multi ? new MultiPoint([[-10, 3]]) : new Point([-10, 3]) geometry: multi ? new MultiPoint([[-10, 3]]) : new Point([-10, 3])
}); });
feature.setStyle(new _ol_style_Style_({ feature.setStyle(new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
radius: 4, radius: 4,
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
@@ -121,7 +121,7 @@ describe('ol.rendering.style.Circle', function() {
feature = new Feature({ feature = new Feature({
geometry: multi ? new MultiPoint([[4, 3]]) : new Point([4, 3]) geometry: multi ? new MultiPoint([[4, 3]]) : new Point([4, 3])
}); });
feature.setStyle(new _ol_style_Style_({ feature.setStyle(new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
radius: 6, radius: 6,
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
@@ -138,7 +138,7 @@ describe('ol.rendering.style.Circle', function() {
feature = new Feature({ feature = new Feature({
geometry: multi ? new MultiPoint([[-20, -15]]) : new Point([-20, -15]) geometry: multi ? new MultiPoint([[-20, -15]]) : new Point([-20, -15])
}); });
feature.setStyle(new _ol_style_Style_({ feature.setStyle(new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
radius: 2, radius: 2,
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
@@ -152,7 +152,7 @@ describe('ol.rendering.style.Circle', function() {
feature = new Feature({ feature = new Feature({
geometry: multi ? new MultiPoint([[-10, -15]]) : new Point([-10, -15]) geometry: multi ? new MultiPoint([[-10, -15]]) : new Point([-10, -15])
}); });
feature.setStyle(new _ol_style_Style_({ feature.setStyle(new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
radius: 4, radius: 4,
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
@@ -169,7 +169,7 @@ describe('ol.rendering.style.Circle', function() {
feature = new Feature({ feature = new Feature({
geometry: multi ? new MultiPoint([[4, -15]]) : new Point([4, -15]) geometry: multi ? new MultiPoint([[4, -15]]) : new Point([4, -15])
}); });
feature.setStyle(new _ol_style_Style_({ feature.setStyle(new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
radius: 6, radius: 6,
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
+2 -2
View File
@@ -5,7 +5,7 @@ import View from '../../../../src/ol/View.js';
import VectorLayer from '../../../../src/ol/layer/Vector.js'; import VectorLayer from '../../../../src/ol/layer/Vector.js';
import VectorSource from '../../../../src/ol/source/Vector.js'; import VectorSource from '../../../../src/ol/source/Vector.js';
import _ol_style_Icon_ from '../../../../src/ol/style/Icon.js'; import _ol_style_Icon_ from '../../../../src/ol/style/Icon.js';
import _ol_style_Style_ from '../../../../src/ol/style/Style.js'; import Style from '../../../../src/ol/style/Style.js';
describe('ol.rendering.style.Icon', function() { describe('ol.rendering.style.Icon', function() {
@@ -58,7 +58,7 @@ describe('ol.rendering.style.Icon', function() {
var img = new Image(); var img = new Image();
img.onload = function() { img.onload = function() {
imgInfo.img = img; imgInfo.img = img;
feature.setStyle(new _ol_style_Style_({ feature.setStyle(new Style({
image: new _ol_style_Icon_(/** @type {olx.style.IconOptions} */ (imgInfo)) image: new _ol_style_Icon_(/** @type {olx.style.IconOptions} */ (imgInfo))
})); }));
vectorSource.addFeature(feature); vectorSource.addFeature(feature);
+7 -7
View File
@@ -4,7 +4,7 @@ import Map from '../../../../src/ol/Map.js';
import View from '../../../../src/ol/View.js'; import View from '../../../../src/ol/View.js';
import VectorLayer from '../../../../src/ol/layer/Vector.js'; import VectorLayer from '../../../../src/ol/layer/Vector.js';
import VectorSource from '../../../../src/ol/source/Vector.js'; import VectorSource from '../../../../src/ol/source/Vector.js';
import _ol_style_Style_ from '../../../../src/ol/style/Style.js'; import Style from '../../../../src/ol/style/Style.js';
import _ol_style_Stroke_ from '../../../../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../../../../src/ol/style/Stroke.js';
@@ -48,7 +48,7 @@ describe('ol.rendering.style.LineString', function() {
[[-20, 20], [15, 20]] [[-20, 20], [15, 20]]
) )
}); });
feature.setStyle(new _ol_style_Style_({ feature.setStyle(new Style({
stroke: new _ol_style_Stroke_({color: '#DE213A', width: 3}) stroke: new _ol_style_Stroke_({color: '#DE213A', width: 3})
})); }));
vectorSource.addFeature(feature); vectorSource.addFeature(feature);
@@ -58,7 +58,7 @@ describe('ol.rendering.style.LineString', function() {
[[-20, 15], [15, 15]] [[-20, 15], [15, 15]]
) )
}); });
feature.setStyle(new _ol_style_Style_({ feature.setStyle(new Style({
stroke: new _ol_style_Stroke_({color: '#9696EB', width: 1}) stroke: new _ol_style_Stroke_({color: '#9696EB', width: 1})
})); }));
vectorSource.addFeature(feature); vectorSource.addFeature(feature);
@@ -68,9 +68,9 @@ describe('ol.rendering.style.LineString', function() {
[[-20, 10], [15, 10]] [[-20, 10], [15, 10]]
) )
}); });
feature.setStyle([new _ol_style_Style_({ feature.setStyle([new Style({
stroke: new _ol_style_Stroke_({color: '#F2F211', width: 5}) stroke: new _ol_style_Stroke_({color: '#F2F211', width: 5})
}), new _ol_style_Style_({ }), new Style({
stroke: new _ol_style_Stroke_({color: '#292921', width: 1}) stroke: new _ol_style_Stroke_({color: '#292921', width: 1})
})]); })]);
vectorSource.addFeature(feature); vectorSource.addFeature(feature);
@@ -80,7 +80,7 @@ describe('ol.rendering.style.LineString', function() {
[[-20, -20], [-2, 0], [15, -20]] [[-20, -20], [-2, 0], [15, -20]]
) )
}); });
feature.setStyle(new _ol_style_Style_({ feature.setStyle(new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: '#000000', color: '#000000',
width: 2, width: 2,
@@ -96,7 +96,7 @@ describe('ol.rendering.style.LineString', function() {
[[-20, -15], [-2, 5], [15, -15]] [[-20, -15], [-2, 5], [15, -15]]
) )
}); });
feature.setStyle(new _ol_style_Style_({ feature.setStyle(new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: '#000000', color: '#000000',
width: 2, width: 2,
+14 -14
View File
@@ -5,7 +5,7 @@ import View from '../../../../src/ol/View.js';
import VectorLayer from '../../../../src/ol/layer/Vector.js'; import VectorLayer from '../../../../src/ol/layer/Vector.js';
import VectorSource from '../../../../src/ol/source/Vector.js'; import VectorSource from '../../../../src/ol/source/Vector.js';
import _ol_style_Fill_ from '../../../../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../../../../src/ol/style/Fill.js';
import _ol_style_Style_ from '../../../../src/ol/style/Style.js'; import Style from '../../../../src/ol/style/Style.js';
import _ol_style_Stroke_ from '../../../../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../../../../src/ol/style/Stroke.js';
@@ -53,7 +53,7 @@ describe('ol.rendering.style.Polygon', function() {
[[-20, 10], [-20, 20], [-5, 20], [-5, 10], [-20, 10]] [[-20, 10], [-20, 20], [-5, 20], [-5, 10], [-20, 10]]
]) ])
}); });
feature.setStyle(new _ol_style_Style_({ feature.setStyle(new Style({
fill: fill fill: fill
})); }));
vectorSource.addFeature(feature); vectorSource.addFeature(feature);
@@ -66,7 +66,7 @@ describe('ol.rendering.style.Polygon', function() {
]) ])
}); });
feature.setStyle(new _ol_style_Style_({ feature.setStyle(new Style({
fill: fill fill: fill
})); }));
vectorSource.addFeature(feature); vectorSource.addFeature(feature);
@@ -80,7 +80,7 @@ describe('ol.rendering.style.Polygon', function() {
]) ])
}); });
feature.setStyle(new _ol_style_Style_({ feature.setStyle(new Style({
fill: fill fill: fill
})); }));
vectorSource.addFeature(feature); vectorSource.addFeature(feature);
@@ -118,7 +118,7 @@ describe('ol.rendering.style.Polygon', function() {
[[-20, 10], [-20, 20], [-5, 20], [-5, 10], [-20, 10]] [[-20, 10], [-20, 20], [-5, 20], [-5, 10], [-20, 10]]
]) ])
}); });
feature.setStyle(new _ol_style_Style_({ feature.setStyle(new Style({
stroke: stroke stroke: stroke
})); }));
vectorSource.addFeature(feature); vectorSource.addFeature(feature);
@@ -131,7 +131,7 @@ describe('ol.rendering.style.Polygon', function() {
]) ])
}); });
feature.setStyle(new _ol_style_Style_({ feature.setStyle(new Style({
stroke: stroke stroke: stroke
})); }));
vectorSource.addFeature(feature); vectorSource.addFeature(feature);
@@ -145,7 +145,7 @@ describe('ol.rendering.style.Polygon', function() {
]) ])
}); });
feature.setStyle(new _ol_style_Style_({ feature.setStyle(new Style({
stroke: stroke stroke: stroke
})); }));
vectorSource.addFeature(feature); vectorSource.addFeature(feature);
@@ -178,7 +178,7 @@ describe('ol.rendering.style.Polygon', function() {
[[-20, 10], [-20, 20], [-0, 20], [-0, 10], [-20, 10]] [[-20, 10], [-20, 20], [-0, 20], [-0, 10], [-20, 10]]
]) ])
}); });
feature.setStyle(new _ol_style_Style_({ feature.setStyle(new Style({
fill: new _ol_style_Fill_({color: '#E31E10'}), fill: new _ol_style_Fill_({color: '#E31E10'}),
zIndex: 2 zIndex: 2
})); }));
@@ -190,7 +190,7 @@ describe('ol.rendering.style.Polygon', function() {
[[-15, 5], [-15, 15], [5, 15], [5, 5], [-15, 5]] [[-15, 5], [-15, 15], [5, 15], [5, 5], [-15, 5]]
]) ])
}); });
feature.setStyle(new _ol_style_Style_({ feature.setStyle(new Style({
fill: new _ol_style_Fill_({color: '#1A5E42'}), fill: new _ol_style_Fill_({color: '#1A5E42'}),
zIndex: 3 zIndex: 3
})); }));
@@ -202,7 +202,7 @@ describe('ol.rendering.style.Polygon', function() {
[[-10, 0], [-10, 10], [10, 10], [10, 0], [-10, 0]] [[-10, 0], [-10, 10], [10, 10], [10, 0], [-10, 0]]
]) ])
}); });
feature.setStyle(new _ol_style_Style_({ feature.setStyle(new Style({
fill: new _ol_style_Fill_({color: '#DEDE21'}), fill: new _ol_style_Fill_({color: '#DEDE21'}),
zIndex: 1 zIndex: 1
})); }));
@@ -235,7 +235,7 @@ describe('ol.rendering.style.Polygon', function() {
[[-20, 10], [-20, 20], [-5, 20], [-5, 10], [-20, 10]] [[-20, 10], [-20, 20], [-5, 20], [-5, 10], [-20, 10]]
]) ])
}); });
feature.setStyle(new _ol_style_Style_({ feature.setStyle(new Style({
fill: new _ol_style_Fill_({color: '#9696EB'}), fill: new _ol_style_Fill_({color: '#9696EB'}),
stroke: new _ol_style_Stroke_({color: '#9696EB', width: 1}) stroke: new _ol_style_Stroke_({color: '#9696EB', width: 1})
})); }));
@@ -247,7 +247,7 @@ describe('ol.rendering.style.Polygon', function() {
[[0, 10], [0, 20], [15, 20], [15, 10], [0, 10]] [[0, 10], [0, 20], [15, 20], [15, 10], [0, 10]]
]) ])
}); });
feature.setStyle(new _ol_style_Style_({ feature.setStyle(new Style({
fill: new _ol_style_Fill_({color: 'rgba(255, 0, 0, 0.1)'}), fill: new _ol_style_Fill_({color: 'rgba(255, 0, 0, 0.1)'}),
stroke: new _ol_style_Stroke_({color: '#DE213A', width: 3}) stroke: new _ol_style_Stroke_({color: '#DE213A', width: 3})
})); }));
@@ -259,7 +259,7 @@ describe('ol.rendering.style.Polygon', function() {
[[-20, -20], [-20, 5], [15, 5], [15, -20], [-20, -20]] [[-20, -20], [-20, 5], [15, 5], [15, -20], [-20, -20]]
]) ])
}); });
feature.setStyle(new _ol_style_Style_({ feature.setStyle(new Style({
fill: new _ol_style_Fill_({color: 'rgba(18, 204, 105, 0.3)'}), fill: new _ol_style_Fill_({color: 'rgba(18, 204, 105, 0.3)'}),
stroke: new _ol_style_Stroke_({color: '#032E17', width: 2}) stroke: new _ol_style_Stroke_({color: '#032E17', width: 2})
})); }));
@@ -321,7 +321,7 @@ describe('ol.rendering.style.Polygon', function() {
[[-20, -20], [-20, 20], [18, 20], [-20, -20]] [[-20, -20], [-20, 20], [18, 20], [-20, -20]]
]) ])
}); });
feature.setStyle(new _ol_style_Style_({ feature.setStyle(new Style({
fill: new _ol_style_Fill_({color: createPattern()}), fill: new _ol_style_Fill_({color: createPattern()}),
stroke: new _ol_style_Stroke_({color: createRainbowGradient(), width: 3}) stroke: new _ol_style_Stroke_({color: createRainbowGradient(), width: 3})
})); }));
+5 -5
View File
@@ -6,7 +6,7 @@ import VectorLayer from '../../../../src/ol/layer/Vector.js';
import VectorSource from '../../../../src/ol/source/Vector.js'; import VectorSource from '../../../../src/ol/source/Vector.js';
import _ol_style_Fill_ from '../../../../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../../../../src/ol/style/Fill.js';
import _ol_style_RegularShape_ from '../../../../src/ol/style/RegularShape.js'; import _ol_style_RegularShape_ from '../../../../src/ol/style/RegularShape.js';
import _ol_style_Style_ from '../../../../src/ol/style/Style.js'; import Style from '../../../../src/ol/style/Style.js';
import _ol_style_Stroke_ from '../../../../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../../../../src/ol/style/Stroke.js';
@@ -46,7 +46,7 @@ describe('ol.rendering.style.RegularShape', function() {
geometry: new Point([-15, 15]) geometry: new Point([-15, 15])
}); });
// square // square
feature.setStyle(new _ol_style_Style_({ feature.setStyle(new Style({
image: new _ol_style_RegularShape_({ image: new _ol_style_RegularShape_({
fill: fill, fill: fill,
stroke: stroke, stroke: stroke,
@@ -61,7 +61,7 @@ describe('ol.rendering.style.RegularShape', function() {
geometry: new Point([8, 15]) geometry: new Point([8, 15])
}); });
// triangle // triangle
feature.setStyle(new _ol_style_Style_({ feature.setStyle(new Style({
image: new _ol_style_RegularShape_({ image: new _ol_style_RegularShape_({
fill: fill, fill: fill,
stroke: stroke, stroke: stroke,
@@ -77,7 +77,7 @@ describe('ol.rendering.style.RegularShape', function() {
geometry: new Point([-10, -8]) geometry: new Point([-10, -8])
}); });
// star // star
feature.setStyle(new _ol_style_Style_({ feature.setStyle(new Style({
image: new _ol_style_RegularShape_({ image: new _ol_style_RegularShape_({
fill: fill, fill: fill,
stroke: stroke, stroke: stroke,
@@ -93,7 +93,7 @@ describe('ol.rendering.style.RegularShape', function() {
geometry: new Point([12, -8]) geometry: new Point([12, -8])
}); });
// cross // cross
feature.setStyle(new _ol_style_Style_({ feature.setStyle(new Style({
image: new _ol_style_RegularShape_({ image: new _ol_style_RegularShape_({
fill: fill, fill: fill,
stroke: stroke, stroke: stroke,
+16 -16
View File
@@ -10,7 +10,7 @@ import VectorLayer from '../../../../src/ol/layer/Vector.js';
import VectorSource from '../../../../src/ol/source/Vector.js'; import VectorSource from '../../../../src/ol/source/Vector.js';
import _ol_style_Text_ from '../../../../src/ol/style/Text.js'; import _ol_style_Text_ from '../../../../src/ol/style/Text.js';
import _ol_style_Fill_ from '../../../../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../../../../src/ol/style/Fill.js';
import _ol_style_Style_ from '../../../../src/ol/style/Style.js'; import Style from '../../../../src/ol/style/Style.js';
import _ol_style_Stroke_ from '../../../../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../../../../src/ol/style/Stroke.js';
describe('ol.rendering.style.Text', function() { describe('ol.rendering.style.Text', function() {
@@ -52,7 +52,7 @@ describe('ol.rendering.style.Text', function() {
feature = new Feature({ feature = new Feature({
geometry: new Point([-20, 18]) geometry: new Point([-20, 18])
}); });
feature.setStyle(new _ol_style_Style_({ feature.setStyle(new Style({
text: new _ol_style_Text_({ text: new _ol_style_Text_({
scale: scale, scale: scale,
text: 'hello', text: 'hello',
@@ -64,7 +64,7 @@ describe('ol.rendering.style.Text', function() {
feature = new Feature({ feature = new Feature({
geometry: new Point([-10, 0]) geometry: new Point([-10, 0])
}); });
feature.setStyle(new _ol_style_Style_({ feature.setStyle(new Style({
text: new _ol_style_Text_({ text: new _ol_style_Text_({
scale: scale, scale: scale,
text: 'hello', text: 'hello',
@@ -83,7 +83,7 @@ describe('ol.rendering.style.Text', function() {
feature = new Feature({ feature = new Feature({
geometry: new Point([20, 10]) geometry: new Point([20, 10])
}); });
feature.setStyle(new _ol_style_Style_({ feature.setStyle(new Style({
text: new _ol_style_Text_({ text: new _ol_style_Text_({
scale: scale, scale: scale,
rotateWithView: true, rotateWithView: true,
@@ -107,7 +107,7 @@ describe('ol.rendering.style.Text', function() {
function createLineString(coords, textAlign, maxAngle, strokeColor, strokeWidth, scale) { function createLineString(coords, textAlign, maxAngle, strokeColor, strokeWidth, scale) {
var geom = new LineString(); var geom = new LineString();
geom.setFlatCoordinates('XY', coords); geom.setFlatCoordinates('XY', coords);
var style = new _ol_style_Style_({ var style = new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: 'red' color: 'red'
}), }),
@@ -176,7 +176,7 @@ describe('ol.rendering.style.Text', function() {
createMap('canvas'); createMap('canvas');
var feature; var feature;
feature = new Feature(new Point([25, 0])); feature = new Feature(new Point([25, 0]));
feature.setStyle(new _ol_style_Style_({ feature.setStyle(new Style({
text: new _ol_style_Text_({ text: new _ol_style_Text_({
text: 'Hello world\nleft', text: 'Hello world\nleft',
font: 'bold 14px sans-serif', font: 'bold 14px sans-serif',
@@ -185,7 +185,7 @@ describe('ol.rendering.style.Text', function() {
})); }));
vectorSource.addFeature(feature); vectorSource.addFeature(feature);
feature = new Feature(new Point([-25, 0])); feature = new Feature(new Point([-25, 0]));
feature.setStyle(new _ol_style_Style_({ feature.setStyle(new Style({
text: new _ol_style_Text_({ text: new _ol_style_Text_({
text: 'Hello world\nright', text: 'Hello world\nright',
font: 'bold 14px sans-serif', font: 'bold 14px sans-serif',
@@ -194,7 +194,7 @@ describe('ol.rendering.style.Text', function() {
})); }));
vectorSource.addFeature(feature); vectorSource.addFeature(feature);
feature = new Feature(new Point([0, 25])); feature = new Feature(new Point([0, 25]));
feature.setStyle(new _ol_style_Style_({ feature.setStyle(new Style({
text: new _ol_style_Text_({ text: new _ol_style_Text_({
text: 'Hello world\nbottom', text: 'Hello world\nbottom',
font: 'bold 14px sans-serif', font: 'bold 14px sans-serif',
@@ -203,7 +203,7 @@ describe('ol.rendering.style.Text', function() {
})); }));
vectorSource.addFeature(feature); vectorSource.addFeature(feature);
feature = new Feature(new Point([0, -25])); feature = new Feature(new Point([0, -25]));
feature.setStyle(new _ol_style_Style_({ feature.setStyle(new Style({
text: new _ol_style_Text_({ text: new _ol_style_Text_({
text: 'top\nHello world', text: 'top\nHello world',
font: 'bold 14px sans-serif', font: 'bold 14px sans-serif',
@@ -218,7 +218,7 @@ describe('ol.rendering.style.Text', function() {
createMap('canvas'); createMap('canvas');
var feature; var feature;
feature = new Feature(new Point([0, 0])); feature = new Feature(new Point([0, 0]));
feature.setStyle(new _ol_style_Style_({ feature.setStyle(new Style({
text: new _ol_style_Text_({ text: new _ol_style_Text_({
text: 'Hello world\nleft', text: 'Hello world\nleft',
font: 'bold 14px sans-serif', font: 'bold 14px sans-serif',
@@ -228,7 +228,7 @@ describe('ol.rendering.style.Text', function() {
})); }));
vectorSource.addFeature(feature); vectorSource.addFeature(feature);
feature = new Feature(new Point([0, 0])); feature = new Feature(new Point([0, 0]));
feature.setStyle(new _ol_style_Style_({ feature.setStyle(new Style({
text: new _ol_style_Text_({ text: new _ol_style_Text_({
text: 'Hello world\nright', text: 'Hello world\nright',
font: 'bold 14px sans-serif', font: 'bold 14px sans-serif',
@@ -238,7 +238,7 @@ describe('ol.rendering.style.Text', function() {
})); }));
vectorSource.addFeature(feature); vectorSource.addFeature(feature);
feature = new Feature(new Point([0, 0])); feature = new Feature(new Point([0, 0]));
feature.setStyle(new _ol_style_Style_({ feature.setStyle(new Style({
text: new _ol_style_Text_({ text: new _ol_style_Text_({
text: 'Hello world\nbottom', text: 'Hello world\nbottom',
font: 'bold 14px sans-serif', font: 'bold 14px sans-serif',
@@ -248,7 +248,7 @@ describe('ol.rendering.style.Text', function() {
})); }));
vectorSource.addFeature(feature); vectorSource.addFeature(feature);
feature = new Feature(new Point([0, 0])); feature = new Feature(new Point([0, 0]));
feature.setStyle(new _ol_style_Style_({ feature.setStyle(new Style({
text: new _ol_style_Text_({ text: new _ol_style_Text_({
text: 'top\nHello world', text: 'top\nHello world',
font: 'bold 14px sans-serif', font: 'bold 14px sans-serif',
@@ -273,7 +273,7 @@ describe('ol.rendering.style.Text', function() {
line.translate(0, -100); line.translate(0, -100);
geom.appendLineString(line); geom.appendLineString(line);
var feature = new Feature(geom); var feature = new Feature(geom);
feature.setStyle(new _ol_style_Style_({ feature.setStyle(new Style({
text: new _ol_style_Text_({ text: new _ol_style_Text_({
text: 'Hello world', text: 'Hello world',
placement: 'line', placement: 'line',
@@ -290,7 +290,7 @@ describe('ol.rendering.style.Text', function() {
var geom = new Polygon(null); var geom = new Polygon(null);
geom.setFlatCoordinates('XY', polygon, [polygon.length]); geom.setFlatCoordinates('XY', polygon, [polygon.length]);
var feature = new Feature(geom); var feature = new Feature(geom);
feature.setStyle(new _ol_style_Style_({ feature.setStyle(new Style({
text: new _ol_style_Text_({ text: new _ol_style_Text_({
text: 'Hello world', text: 'Hello world',
font: 'bold 24px sans-serif', font: 'bold 24px sans-serif',
@@ -316,7 +316,7 @@ describe('ol.rendering.style.Text', function() {
geom.translate(0, -60); geom.translate(0, -60);
multiPolygon.appendPolygon(geom); multiPolygon.appendPolygon(geom);
var feature = new Feature(multiPolygon); var feature = new Feature(multiPolygon);
feature.setStyle(new _ol_style_Style_({ feature.setStyle(new Style({
text: new _ol_style_Text_({ text: new _ol_style_Text_({
text: 'Hello world', text: 'Hello world',
font: 'bold 24px sans-serif', font: 'bold 24px sans-serif',
+5 -5
View File
@@ -1,7 +1,7 @@
import Feature from '../../../src/ol/Feature.js'; import Feature from '../../../src/ol/Feature.js';
import Point from '../../../src/ol/geom/Point.js'; import Point from '../../../src/ol/geom/Point.js';
import _ol_obj_ from '../../../src/ol/obj.js'; import _ol_obj_ from '../../../src/ol/obj.js';
import _ol_style_Style_ from '../../../src/ol/style/Style.js'; import Style from '../../../src/ol/style/Style.js';
describe('ol.Feature', function() { describe('ol.Feature', function() {
@@ -298,7 +298,7 @@ describe('ol.Feature', function() {
describe('#setStyle()', function() { describe('#setStyle()', function() {
var style = new _ol_style_Style_(); var style = new Style();
var styleFunction = function(feature, resolution) { var styleFunction = function(feature, resolution) {
return resolution; return resolution;
@@ -355,7 +355,7 @@ describe('ol.Feature', function() {
describe('#getStyle()', function() { describe('#getStyle()', function() {
var style = new _ol_style_Style_(); var style = new Style();
var styleFunction = function(resolution) { var styleFunction = function(resolution) {
return null; return null;
@@ -403,7 +403,7 @@ describe('ol.Feature', function() {
feature.setGeometryName('geom'); feature.setGeometryName('geom');
var geometry = new Point([1, 2]); var geometry = new Point([1, 2]);
feature.setGeometry(geometry); feature.setGeometry(geometry);
var style = new _ol_style_Style_({}); var style = new Style({});
feature.setStyle(style); feature.setStyle(style);
feature.set('barkey', 'barval'); feature.set('barkey', 'barval');
@@ -448,7 +448,7 @@ describe('ol.Feature', function() {
}); });
describe('ol.Feature.createStyleFunction()', function() { describe('ol.Feature.createStyleFunction()', function() {
var style = new _ol_style_Style_(); var style = new Style();
it('creates a feature style function from a single style', function() { it('creates a feature style function from a single style', function() {
var styleFunction = Feature.createStyleFunction(style); var styleFunction = Feature.createStyleFunction(style);
+32 -32
View File
@@ -19,7 +19,7 @@ import _ol_style_Icon_ from '../../../../src/ol/style/Icon.js';
import IconAnchorUnits from '../../../../src/ol/style/IconAnchorUnits.js'; import IconAnchorUnits from '../../../../src/ol/style/IconAnchorUnits.js';
import IconOrigin from '../../../../src/ol/style/IconOrigin.js'; import IconOrigin from '../../../../src/ol/style/IconOrigin.js';
import _ol_style_Stroke_ from '../../../../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../../../../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../../../../src/ol/style/Style.js'; import Style from '../../../../src/ol/style/Style.js';
import _ol_style_Text_ from '../../../../src/ol/style/Text.js'; import _ol_style_Text_ from '../../../../src/ol/style/Text.js';
import _ol_xml_ from '../../../../src/ol/xml.js'; import _ol_xml_ from '../../../../src/ol/xml.js';
@@ -30,7 +30,7 @@ describe('ol.format.KML', function() {
describe('using defaultStyle', function() { describe('using defaultStyle', function() {
var dfltStyle = new _ol_style_Style_(); var dfltStyle = new Style();
beforeEach(function() { beforeEach(function() {
format = new KML({ format = new KML({
@@ -61,7 +61,7 @@ describe('ol.format.KML', function() {
expect(styleArray).to.be.an(Array); expect(styleArray).to.be.an(Array);
expect(styleArray).to.have.length(1); expect(styleArray).to.have.length(1);
var style = styleArray[0]; var style = styleArray[0];
expect(style).to.be.an(_ol_style_Style_); expect(style).to.be.an(Style);
expect(style).to.be(dfltStyle); expect(style).to.be(dfltStyle);
}); });
}); });
@@ -1719,7 +1719,7 @@ describe('ol.format.KML', function() {
expect(styleArray).to.be.an(Array); expect(styleArray).to.be.an(Array);
expect(styleArray).to.have.length(1); expect(styleArray).to.have.length(1);
var style = styleArray[0]; var style = styleArray[0];
expect(style).to.be.an(_ol_style_Style_); expect(style).to.be.an(Style);
expect(style.getFill()).to.be(KML.DEFAULT_FILL_STYLE_); expect(style.getFill()).to.be(KML.DEFAULT_FILL_STYLE_);
expect(style.getFill().getColor()).to.eql([255, 255, 255, 1]); expect(style.getFill().getColor()).to.eql([255, 255, 255, 1]);
expect(style.getImage()).to.be(KML.DEFAULT_IMAGE_STYLE_); expect(style.getImage()).to.be(KML.DEFAULT_IMAGE_STYLE_);
@@ -1752,7 +1752,7 @@ describe('ol.format.KML', function() {
expect(styleArray).to.be.an(Array); expect(styleArray).to.be.an(Array);
expect(styleArray).to.have.length(1); expect(styleArray).to.have.length(1);
var style = styleArray[0]; var style = styleArray[0];
expect(style).to.be.an(_ol_style_Style_); expect(style).to.be.an(Style);
expect(style.getFill()).to.be(KML.DEFAULT_FILL_STYLE_); expect(style.getFill()).to.be(KML.DEFAULT_FILL_STYLE_);
expect(style.getStroke()).to.be(KML.DEFAULT_STROKE_STYLE_); expect(style.getStroke()).to.be(KML.DEFAULT_STROKE_STYLE_);
var imageStyle = style.getImage(); var imageStyle = style.getImage();
@@ -1832,7 +1832,7 @@ describe('ol.format.KML', function() {
expect(styleArray).to.be.an(Array); expect(styleArray).to.be.an(Array);
expect(styleArray).to.have.length(1); expect(styleArray).to.have.length(1);
var style = styleArray[0]; var style = styleArray[0];
expect(style).to.be.an(_ol_style_Style_); expect(style).to.be.an(Style);
expect(style.getFill()).to.be(KML.DEFAULT_FILL_STYLE_); expect(style.getFill()).to.be(KML.DEFAULT_FILL_STYLE_);
expect(style.getStroke()).to.be(KML.DEFAULT_STROKE_STYLE_); expect(style.getStroke()).to.be(KML.DEFAULT_STROKE_STYLE_);
var imageStyle = style.getImage(); var imageStyle = style.getImage();
@@ -1903,7 +1903,7 @@ describe('ol.format.KML', function() {
expect(styleArray).to.be.an(Array); expect(styleArray).to.be.an(Array);
expect(styleArray).to.have.length(1); expect(styleArray).to.have.length(1);
var style = styleArray[0]; var style = styleArray[0];
expect(style).to.be.an(_ol_style_Style_); expect(style).to.be.an(Style);
expect(style.getFill()).to.be(KML.DEFAULT_FILL_STYLE_); expect(style.getFill()).to.be(KML.DEFAULT_FILL_STYLE_);
expect(style.getStroke()).to.be(KML.DEFAULT_STROKE_STYLE_); expect(style.getStroke()).to.be(KML.DEFAULT_STROKE_STYLE_);
var imageStyle = style.getImage(); var imageStyle = style.getImage();
@@ -1939,7 +1939,7 @@ describe('ol.format.KML', function() {
expect(styleArray).to.be.an(Array); expect(styleArray).to.be.an(Array);
expect(styleArray).to.have.length(1); expect(styleArray).to.have.length(1);
var style = styleArray[0]; var style = styleArray[0];
expect(style).to.be.an(_ol_style_Style_); expect(style).to.be.an(Style);
expect(style.getFill()).to.be(KML.DEFAULT_FILL_STYLE_); expect(style.getFill()).to.be(KML.DEFAULT_FILL_STYLE_);
expect(style.getImage()).to.be(KML.DEFAULT_IMAGE_STYLE_); expect(style.getImage()).to.be(KML.DEFAULT_IMAGE_STYLE_);
expect(style.getStroke()).to.be(KML.DEFAULT_STROKE_STYLE_); expect(style.getStroke()).to.be(KML.DEFAULT_STROKE_STYLE_);
@@ -1974,7 +1974,7 @@ describe('ol.format.KML', function() {
expect(styleArray).to.be.an(Array); expect(styleArray).to.be.an(Array);
expect(styleArray).to.have.length(1); expect(styleArray).to.have.length(1);
var style = styleArray[0]; var style = styleArray[0];
expect(style).to.be.an(_ol_style_Style_); expect(style).to.be.an(Style);
expect(style.getFill()).to.be(KML.DEFAULT_FILL_STYLE_); expect(style.getFill()).to.be(KML.DEFAULT_FILL_STYLE_);
expect(style.getImage()).to.be(KML.DEFAULT_IMAGE_STYLE_); expect(style.getImage()).to.be(KML.DEFAULT_IMAGE_STYLE_);
var strokeStyle = style.getStroke(); var strokeStyle = style.getStroke();
@@ -2006,7 +2006,7 @@ describe('ol.format.KML', function() {
expect(styleArray).to.be.an(Array); expect(styleArray).to.be.an(Array);
expect(styleArray).to.have.length(1); expect(styleArray).to.have.length(1);
var style = styleArray[0]; var style = styleArray[0];
expect(style).to.be.an(_ol_style_Style_); expect(style).to.be.an(Style);
var fillStyle = style.getFill(); var fillStyle = style.getFill();
expect(fillStyle).to.be.an(_ol_style_Fill_); expect(fillStyle).to.be.an(_ol_style_Fill_);
expect(fillStyle.getColor()).to.eql([0x78, 0x56, 0x34, 0x12 / 255]); expect(fillStyle.getColor()).to.eql([0x78, 0x56, 0x34, 0x12 / 255]);
@@ -2043,7 +2043,7 @@ describe('ol.format.KML', function() {
expect(styleArray).to.be.an(Array); expect(styleArray).to.be.an(Array);
expect(styleArray).to.have.length(1); expect(styleArray).to.have.length(1);
var style = styleArray[0]; var style = styleArray[0];
expect(style).to.be.an(_ol_style_Style_); expect(style).to.be.an(Style);
var fillStyle = style.getFill(); var fillStyle = style.getFill();
expect(fillStyle).to.be.an(_ol_style_Fill_); expect(fillStyle).to.be.an(_ol_style_Fill_);
expect(fillStyle.getColor()).to.eql([0x78, 0x56, 0x34, 0x12 / 255]); expect(fillStyle.getColor()).to.eql([0x78, 0x56, 0x34, 0x12 / 255]);
@@ -2082,7 +2082,7 @@ describe('ol.format.KML', function() {
expect(styleArray).to.be.an(Array); expect(styleArray).to.be.an(Array);
expect(styleArray).to.have.length(1); expect(styleArray).to.have.length(1);
var style = styleArray[0]; var style = styleArray[0];
expect(style).to.be.an(_ol_style_Style_); expect(style).to.be.an(Style);
expect(style.getFill()).to.be(null); expect(style.getFill()).to.be(null);
expect(style.getImage()).to.be(KML.DEFAULT_IMAGE_STYLE_); expect(style.getImage()).to.be(KML.DEFAULT_IMAGE_STYLE_);
var strokeStyle = style.getStroke(); var strokeStyle = style.getStroke();
@@ -2119,7 +2119,7 @@ describe('ol.format.KML', function() {
expect(styleArray).to.be.an(Array); expect(styleArray).to.be.an(Array);
expect(styleArray).to.have.length(1); expect(styleArray).to.have.length(1);
var style = styleArray[0]; var style = styleArray[0];
expect(style).to.be.an(_ol_style_Style_); expect(style).to.be.an(Style);
var fillStyle = style.getFill(); var fillStyle = style.getFill();
expect(fillStyle).to.be.an(_ol_style_Fill_); expect(fillStyle).to.be.an(_ol_style_Fill_);
expect(fillStyle.getColor()).to.eql([0x78, 0x56, 0x34, 0x12 / 255]); expect(fillStyle.getColor()).to.eql([0x78, 0x56, 0x34, 0x12 / 255]);
@@ -2157,7 +2157,7 @@ describe('ol.format.KML', function() {
expect(styleArray).to.be.an(Array); expect(styleArray).to.be.an(Array);
expect(styleArray).to.have.length(1); expect(styleArray).to.have.length(1);
var style = styleArray[0]; var style = styleArray[0];
expect(style).to.be.an(_ol_style_Style_); expect(style).to.be.an(Style);
expect(style.getFill()).to.be(null); expect(style.getFill()).to.be(null);
expect(style.getImage()).to.be(KML.DEFAULT_IMAGE_STYLE_); expect(style.getImage()).to.be(KML.DEFAULT_IMAGE_STYLE_);
expect(style.getStroke()).to.be(null); expect(style.getStroke()).to.be(null);
@@ -2210,7 +2210,7 @@ describe('ol.format.KML', function() {
expect(styleArray).to.be.an(Array); expect(styleArray).to.be.an(Array);
expect(styleArray).to.have.length(2); expect(styleArray).to.have.length(2);
var style = styleArray[1]; var style = styleArray[1];
expect(style).to.be.an(_ol_style_Style_); expect(style).to.be.an(Style);
expect(style.getText().getText()).to.eql(f.getProperties()['name']); expect(style.getText().getText()).to.eql(f.getProperties()['name']);
}); });
@@ -2259,12 +2259,12 @@ describe('ol.format.KML', function() {
expect(styleArray).to.be.an(Array); expect(styleArray).to.be.an(Array);
expect(styleArray).to.have.length(2); expect(styleArray).to.have.length(2);
var style = styleArray[1]; var style = styleArray[1];
expect(style).to.be.an(_ol_style_Style_); expect(style).to.be.an(Style);
expect(style.getText().getText()).to.eql(f.getProperties()['name']); expect(style.getText().getText()).to.eql(f.getProperties()['name']);
}); });
it('can write an feature\'s icon style', function() { it('can write an feature\'s icon style', function() {
var style = new _ol_style_Style_({ var style = new Style({
image: new _ol_style_Icon_({ image: new _ol_style_Icon_({
anchor: [0.25, 36], anchor: [0.25, 36],
anchorOrigin: 'top-left', anchorOrigin: 'top-left',
@@ -2313,7 +2313,7 @@ describe('ol.format.KML', function() {
it('does not write styles when writeStyles option is false', function() { it('does not write styles when writeStyles option is false', function() {
format = new KML({writeStyles: false}); format = new KML({writeStyles: false});
var style = new _ol_style_Style_({ var style = new Style({
image: new _ol_style_Icon_({ image: new _ol_style_Icon_({
src: 'http://foo.png' src: 'http://foo.png'
}) })
@@ -2334,7 +2334,7 @@ describe('ol.format.KML', function() {
}); });
it('skips image styles that are not icon styles', function() { it('skips image styles that are not icon styles', function() {
var style = new _ol_style_Style_({ var style = new Style({
image: new _ol_style_Circle_({ image: new _ol_style_Circle_({
radius: 4, radius: 4,
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
@@ -2360,7 +2360,7 @@ describe('ol.format.KML', function() {
}); });
it('can write an feature\'s text style', function() { it('can write an feature\'s text style', function() {
var style = new _ol_style_Style_({ var style = new Style({
text: new _ol_style_Text_({ text: new _ol_style_Text_({
scale: 0.5, scale: 0.5,
text: 'foo', text: 'foo',
@@ -2392,7 +2392,7 @@ describe('ol.format.KML', function() {
}); });
it('can write an feature\'s stroke style', function() { it('can write an feature\'s stroke style', function() {
var style = new _ol_style_Style_({ var style = new Style({
stroke: new _ol_style_Stroke_({ stroke: new _ol_style_Stroke_({
color: '#112233', color: '#112233',
width: 2 width: 2
@@ -2420,7 +2420,7 @@ describe('ol.format.KML', function() {
}); });
it('can write an feature\'s fill style', function() { it('can write an feature\'s fill style', function() {
var style = new _ol_style_Style_({ var style = new Style({
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
color: 'rgba(12, 34, 223, 0.7)' color: 'rgba(12, 34, 223, 0.7)'
}) })
@@ -2446,7 +2446,7 @@ describe('ol.format.KML', function() {
}); });
it('can write multiple features with Style', function() { it('can write multiple features with Style', function() {
var style = new _ol_style_Style_({ var style = new Style({
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
color: 'rgba(12, 34, 223, 0.7)' color: 'rgba(12, 34, 223, 0.7)'
}) })
@@ -2513,7 +2513,7 @@ describe('ol.format.KML', function() {
expect(styleArray).to.be.an(Array); expect(styleArray).to.be.an(Array);
expect(styleArray).to.have.length(1); expect(styleArray).to.have.length(1);
var s = styleArray[0]; var s = styleArray[0];
expect(s).to.be.an(_ol_style_Style_); expect(s).to.be.an(Style);
expect(s.getFill()).not.to.be(null); expect(s.getFill()).not.to.be(null);
expect(s.getFill().getColor()).to.eql([0, 0, 0, 0]); expect(s.getFill().getColor()).to.eql([0, 0, 0, 0]);
}); });
@@ -2546,7 +2546,7 @@ describe('ol.format.KML', function() {
expect(styleArray).to.be.an(Array); expect(styleArray).to.be.an(Array);
expect(styleArray).to.have.length(1); expect(styleArray).to.have.length(1);
var s = styleArray[0]; var s = styleArray[0];
expect(s).to.be.an(_ol_style_Style_); expect(s).to.be.an(Style);
expect(s).to.be(KML.DEFAULT_STYLE_); expect(s).to.be(KML.DEFAULT_STYLE_);
}); });
@@ -2587,7 +2587,7 @@ describe('ol.format.KML', function() {
expect(styleArray).to.be.an(Array); expect(styleArray).to.be.an(Array);
expect(styleArray).to.have.length(1); expect(styleArray).to.have.length(1);
var s = styleArray[0]; var s = styleArray[0];
expect(s).to.be.an(_ol_style_Style_); expect(s).to.be.an(Style);
expect(s.getFill()).not.to.be(null); expect(s.getFill()).not.to.be(null);
expect(s.getFill().getColor()).to.eql([0, 0, 0, 0]); expect(s.getFill().getColor()).to.eql([0, 0, 0, 0]);
}); });
@@ -2621,7 +2621,7 @@ describe('ol.format.KML', function() {
expect(styleArray).to.be.an(Array); expect(styleArray).to.be.an(Array);
expect(styleArray).to.have.length(1); expect(styleArray).to.have.length(1);
var s = styleArray[0]; var s = styleArray[0];
expect(s).to.be.an(_ol_style_Style_); expect(s).to.be.an(Style);
expect(s.getFill()).not.to.be(null); expect(s.getFill()).not.to.be(null);
expect(s.getFill().getColor()).to.eql([0, 0, 0, 0]); expect(s.getFill().getColor()).to.eql([0, 0, 0, 0]);
}); });
@@ -2655,7 +2655,7 @@ describe('ol.format.KML', function() {
expect(styleArray).to.be.an(Array); expect(styleArray).to.be.an(Array);
expect(styleArray).to.have.length(1); expect(styleArray).to.have.length(1);
var s = styleArray[0]; var s = styleArray[0];
expect(s).to.be.an(_ol_style_Style_); expect(s).to.be.an(Style);
expect(s).to.be(KML.DEFAULT_STYLE_); expect(s).to.be(KML.DEFAULT_STYLE_);
}); });
@@ -2689,7 +2689,7 @@ describe('ol.format.KML', function() {
expect(styleArray).to.be.an(Array); expect(styleArray).to.be.an(Array);
expect(styleArray).to.have.length(1); expect(styleArray).to.have.length(1);
var s = styleArray[0]; var s = styleArray[0];
expect(s).to.be.an(_ol_style_Style_); expect(s).to.be.an(Style);
expect(s.getFill()).not.to.be(null); expect(s.getFill()).not.to.be(null);
expect(s.getFill().getColor()).to.eql([120, 86, 52, 18 / 255]); expect(s.getFill().getColor()).to.eql([120, 86, 52, 18 / 255]);
}); });
@@ -2722,7 +2722,7 @@ describe('ol.format.KML', function() {
expect(styleArray).to.be.an(Array); expect(styleArray).to.be.an(Array);
expect(styleArray).to.have.length(1); expect(styleArray).to.have.length(1);
var style = styleArray[0]; var style = styleArray[0];
expect(style).to.be.an(_ol_style_Style_); expect(style).to.be.an(Style);
var fillStyle = style.getFill(); var fillStyle = style.getFill();
expect(fillStyle).to.be.an(_ol_style_Fill_); expect(fillStyle).to.be.an(_ol_style_Fill_);
expect(fillStyle.getColor()).to.eql([0x78, 0x56, 0x34, 0x12 / 255]); expect(fillStyle.getColor()).to.eql([0x78, 0x56, 0x34, 0x12 / 255]);
@@ -2754,7 +2754,7 @@ describe('ol.format.KML', function() {
expect(styleArray).to.be.an(Array); expect(styleArray).to.be.an(Array);
expect(styleArray).to.have.length(1); expect(styleArray).to.have.length(1);
var style = styleArray[0]; var style = styleArray[0];
expect(style).to.be.an(_ol_style_Style_); expect(style).to.be.an(Style);
var fillStyle = style.getFill(); var fillStyle = style.getFill();
expect(fillStyle).to.be.an(_ol_style_Fill_); expect(fillStyle).to.be.an(_ol_style_Fill_);
expect(fillStyle.getColor()).to.eql([0x78, 0x56, 0x34, 0x12 / 255]); expect(fillStyle.getColor()).to.eql([0x78, 0x56, 0x34, 0x12 / 255]);
@@ -3207,7 +3207,7 @@ describe('ol.format.KML', function() {
var styleArray = styleFunction.call(f, 0); var styleArray = styleFunction.call(f, 0);
expect(styleArray).to.be.an(Array); expect(styleArray).to.be.an(Array);
var style = styleArray[0]; var style = styleArray[0];
expect(style).to.be.an(_ol_style_Style_); expect(style).to.be.an(Style);
var imageStyle = style.getImage(); var imageStyle = style.getImage();
expect(imageStyle).to.be.an(_ol_style_Icon_); expect(imageStyle).to.be.an(_ol_style_Icon_);
expect(imageStyle.getSrc()).to.eql('http://maps.google.com/mapfiles/kml/shapes/star.png'); expect(imageStyle.getSrc()).to.eql('http://maps.google.com/mapfiles/kml/shapes/star.png');
+9 -9
View File
@@ -1,14 +1,14 @@
import Layer from '../../../../src/ol/layer/Layer.js'; import Layer from '../../../../src/ol/layer/Layer.js';
import VectorLayer from '../../../../src/ol/layer/Vector.js'; import VectorLayer from '../../../../src/ol/layer/Vector.js';
import VectorSource from '../../../../src/ol/source/Vector.js'; import VectorSource from '../../../../src/ol/source/Vector.js';
import _ol_style_Style_ from '../../../../src/ol/style/Style.js'; import Style from '../../../../src/ol/style/Style.js';
describe('ol.layer.Vector', function() { describe('ol.layer.Vector', function() {
describe('constructor', function() { describe('constructor', function() {
var source = new VectorSource(); var source = new VectorSource();
var style = new _ol_style_Style_(); var style = new Style();
it('creates a new layer', function() { it('creates a new layer', function() {
var layer = new VectorLayer({source: source}); var layer = new VectorLayer({source: source});
@@ -58,7 +58,7 @@ describe('ol.layer.Vector', function() {
layer = new VectorLayer({ layer = new VectorLayer({
source: new VectorSource() source: new VectorSource()
}); });
style = new _ol_style_Style_(); style = new Style();
}); });
it('allows the style to be set after construction', function() { it('allows the style to be set after construction', function() {
@@ -74,10 +74,10 @@ describe('ol.layer.Vector', function() {
}); });
it('updates the internal style function', function() { it('updates the internal style function', function() {
expect(layer.getStyleFunction()).to.be(_ol_style_Style_.defaultFunction); expect(layer.getStyleFunction()).to.be(Style.defaultFunction);
layer.setStyle(style); layer.setStyle(style);
expect(layer.getStyleFunction()).not.to.be( expect(layer.getStyleFunction()).not.to.be(
_ol_style_Style_.defaultFunction); Style.defaultFunction);
}); });
it('allows setting an null style', function() { it('allows setting an null style', function() {
@@ -89,8 +89,8 @@ describe('ol.layer.Vector', function() {
it('sets the default style when passing undefined', function() { it('sets the default style when passing undefined', function() {
layer.setStyle(style); layer.setStyle(style);
layer.setStyle(undefined); layer.setStyle(undefined);
expect(layer.getStyle()).to.be(_ol_style_Style_.defaultFunction); expect(layer.getStyle()).to.be(Style.defaultFunction);
expect(layer.getStyleFunction()).to.be(_ol_style_Style_.defaultFunction); expect(layer.getStyleFunction()).to.be(Style.defaultFunction);
}); });
}); });
@@ -98,14 +98,14 @@ describe('ol.layer.Vector', function() {
describe('#getStyle()', function() { describe('#getStyle()', function() {
var source = new VectorSource(); var source = new VectorSource();
var style = new _ol_style_Style_(); var style = new Style();
it('returns what is provided to setStyle', function() { it('returns what is provided to setStyle', function() {
var layer = new VectorLayer({ var layer = new VectorLayer({
source: source source: source
}); });
expect(layer.getStyle()).to.be(_ol_style_Style_.defaultFunction); expect(layer.getStyle()).to.be(Style.defaultFunction);
layer.setStyle(style); layer.setStyle(style);
expect(layer.getStyle()).to.be(style); expect(layer.getStyle()).to.be(style);
+2 -2
View File
@@ -11,7 +11,7 @@ import CanvasImmediateRenderer from '../../../../../src/ol/render/canvas/Immedia
import _ol_style_Circle_ from '../../../../../src/ol/style/Circle.js'; import _ol_style_Circle_ from '../../../../../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../../../../../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../../../../../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../../../../../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../../../../../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../../../../../src/ol/style/Style.js'; import Style from '../../../../../src/ol/style/Style.js';
import _ol_style_Text_ from '../../../../../src/ol/style/Text.js'; import _ol_style_Text_ from '../../../../../src/ol/style/Text.js';
@@ -46,7 +46,7 @@ describe('ol.render.canvas.Immediate', function() {
var stroke = new _ol_style_Stroke_({}); var stroke = new _ol_style_Stroke_({});
var text = new _ol_style_Text_({}); var text = new _ol_style_Text_({});
var image = new _ol_style_Circle_({}); var image = new _ol_style_Circle_({});
var style = new _ol_style_Style_({ var style = new Style({
fill: fill, fill: fill,
stroke: stroke, stroke: stroke,
image: image, image: image,
+2 -2
View File
@@ -15,13 +15,13 @@ import _ol_render_webgl_PolygonReplay_ from '../../../../../src/ol/render/webgl/
import _ol_style_Circle_ from '../../../../../src/ol/style/Circle.js'; import _ol_style_Circle_ from '../../../../../src/ol/style/Circle.js';
import _ol_style_Fill_ from '../../../../../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../../../../../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../../../../../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../../../../../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../../../../../src/ol/style/Style.js'; import Style from '../../../../../src/ol/style/Style.js';
describe('ol.render.webgl.Immediate', function() { describe('ol.render.webgl.Immediate', function() {
var context, style, circle, line, multiLine, point, multiPoint, polygon, multiPolygon; var context, style, circle, line, multiLine, point, multiPoint, polygon, multiPolygon;
beforeEach(function() { beforeEach(function() {
context = new _ol_render_webgl_Immediate_({}, [0, 0], 0, 0, [0, 0], [-180, -90, 180, 90], 1); context = new _ol_render_webgl_Immediate_({}, [0, 0], 0, 0, [0, 0], [-180, -90, 180, 90], 1);
style = new _ol_style_Style_({ style = new Style({
image: new _ol_style_Circle_(), image: new _ol_style_Circle_(),
fill: new _ol_style_Fill_(), fill: new _ol_style_Fill_(),
stroke: new _ol_style_Stroke_() stroke: new _ol_style_Stroke_()
+2 -2
View File
@@ -9,7 +9,7 @@ import CanvasLayerRenderer from '../../../../../src/ol/renderer/canvas/Layer.js'
import CanvasMapRenderer from '../../../../../src/ol/renderer/canvas/Map.js'; import CanvasMapRenderer from '../../../../../src/ol/renderer/canvas/Map.js';
import VectorSource from '../../../../../src/ol/source/Vector.js'; import VectorSource from '../../../../../src/ol/source/Vector.js';
import _ol_style_Icon_ from '../../../../../src/ol/style/Icon.js'; import _ol_style_Icon_ from '../../../../../src/ol/style/Icon.js';
import _ol_style_Style_ from '../../../../../src/ol/style/Style.js'; import Style from '../../../../../src/ol/style/Style.js';
describe('ol.renderer.canvas.Map', function() { describe('ol.renderer.canvas.Map', function() {
@@ -58,7 +58,7 @@ describe('ol.renderer.canvas.Map', function() {
}) })
] ]
}), }),
style: new _ol_style_Style_({ style: new Style({
image: new _ol_style_Icon_({ image: new _ol_style_Icon_({
img: img, img: img,
imgSize: [1, 1] imgSize: [1, 1]
+6 -6
View File
@@ -14,7 +14,7 @@ import _ol_render_canvas_ReplayGroup_ from '../../../../../src/ol/render/canvas/
import _ol_renderer_vector_ from '../../../../../src/ol/renderer/vector.js'; import _ol_renderer_vector_ from '../../../../../src/ol/renderer/vector.js';
import _ol_style_Fill_ from '../../../../../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../../../../../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../../../../../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../../../../../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../../../../../src/ol/style/Style.js'; import Style from '../../../../../src/ol/style/Style.js';
import _ol_transform_ from '../../../../../src/ol/transform.js'; import _ol_transform_ from '../../../../../src/ol/transform.js';
describe('ol.render.canvas.ReplayGroup', function() { describe('ol.render.canvas.ReplayGroup', function() {
@@ -37,17 +37,17 @@ describe('ol.render.canvas.ReplayGroup', function() {
[[[90, 45], [90, 0], [0, 0], [0, 45], [90, 45]]])); [[[90, 45], [90, 0], [0, 0], [0, 45], [90, 45]]]));
feature3 = new Feature(new Polygon( feature3 = new Feature(new Polygon(
[[[-90, -45], [-90, 45], [90, 45], [90, -45], [-90, -45]]])); [[[-90, -45], [-90, 45], [90, 45], [90, -45], [-90, -45]]]));
fill0 = new _ol_style_Style_({ fill0 = new Style({
fill: new _ol_style_Fill_({color: 'black'}) fill: new _ol_style_Fill_({color: 'black'})
}); });
fill1 = new _ol_style_Style_({ fill1 = new Style({
fill: new _ol_style_Fill_({color: 'red'}) fill: new _ol_style_Fill_({color: 'red'})
}); });
style1 = new _ol_style_Style_({ style1 = new Style({
fill: new _ol_style_Fill_({color: 'black'}), fill: new _ol_style_Fill_({color: 'black'}),
stroke: new _ol_style_Stroke_({color: 'white', width: 1}) stroke: new _ol_style_Stroke_({color: 'white', width: 1})
}); });
style2 = new _ol_style_Style_({ style2 = new Style({
fill: new _ol_style_Fill_({color: 'white'}), fill: new _ol_style_Fill_({color: 'white'}),
stroke: new _ol_style_Stroke_({color: 'black', width: 1, lineDash: [3, 6], stroke: new _ol_style_Stroke_({color: 'black', width: 1, lineDash: [3, 6],
lineDashOffset: 2}) lineDashOffset: 2})
@@ -216,7 +216,7 @@ describe('ol.render.canvas.ReplayGroup', function() {
it('calls the renderer function configured for the style', function() { it('calls the renderer function configured for the style', function() {
var calls = []; var calls = [];
var style = new _ol_style_Style_({ var style = new Style({
renderer: function(coords, state) { renderer: function(coords, state) {
calls.push({ calls.push({
coords: coords, coords: coords,
@@ -10,7 +10,7 @@ import {get as getProjection} from '../../../../../src/ol/proj.js';
import _ol_render_canvas_ from '../../../../../src/ol/render/canvas.js'; import _ol_render_canvas_ from '../../../../../src/ol/render/canvas.js';
import CanvasVectorLayerRenderer from '../../../../../src/ol/renderer/canvas/VectorLayer.js'; import CanvasVectorLayerRenderer from '../../../../../src/ol/renderer/canvas/VectorLayer.js';
import VectorSource from '../../../../../src/ol/source/Vector.js'; import VectorSource from '../../../../../src/ol/source/Vector.js';
import _ol_style_Style_ from '../../../../../src/ol/style/Style.js'; import Style from '../../../../../src/ol/style/Style.js';
import _ol_style_Text_ from '../../../../../src/ol/style/Text.js'; import _ol_style_Text_ from '../../../../../src/ol/style/Text.js';
@@ -56,12 +56,12 @@ describe('ol.renderer.canvas.VectorLayer', function() {
}), }),
target: target target: target
}); });
var layerStyle = [new _ol_style_Style_({ var layerStyle = [new Style({
text: new _ol_style_Text_({ text: new _ol_style_Text_({
text: 'layer' text: 'layer'
}) })
})]; })];
var featureStyle = [new _ol_style_Style_({ var featureStyle = [new Style({
text: new _ol_style_Text_({ text: new _ol_style_Text_({
text: 'feature' text: 'feature'
}) })
@@ -93,7 +93,7 @@ describe('ol.renderer.canvas.VectorLayer', function() {
}), }),
target: target target: target
}); });
var layerStyle = new _ol_style_Style_({ var layerStyle = new Style({
text: new _ol_style_Text_({ text: new _ol_style_Text_({
text: 'layer', text: 'layer',
font: '12px "Unavailable Font",sans-serif' font: '12px "Unavailable Font",sans-serif'
@@ -124,7 +124,7 @@ describe('ol.renderer.canvas.VectorLayer', function() {
}), }),
target: target target: target
}); });
var layerStyle = new _ol_style_Style_({ var layerStyle = new Style({
text: new _ol_style_Text_({ text: new _ol_style_Text_({
text: 'layer', text: 'layer',
font: '12px sans-serif' font: '12px sans-serif'
@@ -156,7 +156,7 @@ describe('ol.renderer.canvas.VectorLayer', function() {
}), }),
target: target target: target
}); });
var layerStyle = new _ol_style_Style_({ var layerStyle = new Style({
text: new _ol_style_Text_({ text: new _ol_style_Text_({
text: 'layer', text: 'layer',
font: '12px "Droid Sans",sans-serif' font: '12px "Droid Sans",sans-serif'
@@ -16,7 +16,7 @@ import _ol_render_canvas_ from '../../../../../src/ol/render/canvas.js';
import _ol_render_Feature_ from '../../../../../src/ol/render/Feature.js'; import _ol_render_Feature_ from '../../../../../src/ol/render/Feature.js';
import CanvasVectorTileLayerRenderer from '../../../../../src/ol/renderer/canvas/VectorTileLayer.js'; import CanvasVectorTileLayerRenderer from '../../../../../src/ol/renderer/canvas/VectorTileLayer.js';
import VectorTileSource from '../../../../../src/ol/source/VectorTile.js'; import VectorTileSource from '../../../../../src/ol/source/VectorTile.js';
import _ol_style_Style_ from '../../../../../src/ol/style/Style.js'; import Style from '../../../../../src/ol/style/Style.js';
import _ol_style_Text_ from '../../../../../src/ol/style/Text.js'; import _ol_style_Text_ from '../../../../../src/ol/style/Text.js';
import _ol_tilegrid_ from '../../../../../src/ol/tilegrid.js'; import _ol_tilegrid_ from '../../../../../src/ol/tilegrid.js';
@@ -45,12 +45,12 @@ describe('ol.renderer.canvas.VectorTileLayer', function() {
}), }),
target: target target: target
}); });
layerStyle = [new _ol_style_Style_({ layerStyle = [new Style({
text: new _ol_style_Text_({ text: new _ol_style_Text_({
text: 'layer' text: 'layer'
}) })
})]; })];
var featureStyle = [new _ol_style_Style_({ var featureStyle = [new Style({
text: new _ol_style_Text_({ text: new _ol_style_Text_({
text: 'feature' text: 'feature'
}) })
@@ -133,7 +133,7 @@ describe('ol.renderer.canvas.VectorTileLayer', function() {
it('renders replays with custom renderers as direct replays', function() { it('renders replays with custom renderers as direct replays', function() {
layer.renderMode_ = 'image'; layer.renderMode_ = 'image';
layer.setStyle(new _ol_style_Style_({ layer.setStyle(new Style({
renderer: function() {} renderer: function() {}
})); }));
var spy = sinon.spy(CanvasVectorTileLayerRenderer.prototype, var spy = sinon.spy(CanvasVectorTileLayerRenderer.prototype,
@@ -216,7 +216,7 @@ describe('ol.renderer.canvas.VectorTileLayer', function() {
it('works for multiple layers that use the same source', function() { it('works for multiple layers that use the same source', function() {
var layer2 = new VectorTileLayer({ var layer2 = new VectorTileLayer({
source: source, source: source,
style: new _ol_style_Style_({ style: new Style({
text: new _ol_style_Text_({ text: new _ol_style_Text_({
text: 'layer2' text: 'layer2'
}) })
+2 -2
View File
@@ -11,7 +11,7 @@ import _ol_renderer_vector_ from '../../../../src/ol/renderer/vector.js';
import _ol_style_Fill_ from '../../../../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../../../../src/ol/style/Fill.js';
import _ol_style_Icon_ from '../../../../src/ol/style/Icon.js'; import _ol_style_Icon_ from '../../../../src/ol/style/Icon.js';
import _ol_style_Stroke_ from '../../../../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../../../../src/ol/style/Stroke.js';
import _ol_style_Style_ from '../../../../src/ol/style/Style.js'; import Style from '../../../../src/ol/style/Style.js';
import Feature from '../../../../src/ol/Feature.js'; import Feature from '../../../../src/ol/Feature.js';
@@ -27,7 +27,7 @@ describe('ol.renderer.vector', function() {
iconStyle = new _ol_style_Icon_({ iconStyle = new _ol_style_Icon_({
src: 'http://example.com/icon.png' src: 'http://example.com/icon.png'
}); });
style = new _ol_style_Style_({ style = new Style({
image: iconStyle, image: iconStyle,
fill: new _ol_style_Fill_({}), fill: new _ol_style_Fill_({}),
stroke: new _ol_style_Stroke_({}) stroke: new _ol_style_Stroke_({})
+21 -21
View File
@@ -1,6 +1,6 @@
import Feature from '../../../../src/ol/Feature.js'; import Feature from '../../../../src/ol/Feature.js';
import Point from '../../../../src/ol/geom/Point.js'; import Point from '../../../../src/ol/geom/Point.js';
import _ol_style_Style_ from '../../../../src/ol/style/Style.js'; import Style from '../../../../src/ol/style/Style.js';
import _ol_style_Fill_ from '../../../../src/ol/style/Fill.js'; import _ol_style_Fill_ from '../../../../src/ol/style/Fill.js';
import _ol_style_Circle_ from '../../../../src/ol/style/Circle.js'; import _ol_style_Circle_ from '../../../../src/ol/style/Circle.js';
import _ol_style_Stroke_ from '../../../../src/ol/style/Stroke.js'; import _ol_style_Stroke_ from '../../../../src/ol/style/Stroke.js';
@@ -36,14 +36,14 @@ describe('ol.style.Style', function() {
describe('#clone', function() { describe('#clone', function() {
it('creates a new ol.style.Style', function() { it('creates a new ol.style.Style', function() {
var original = new _ol_style_Style_(); var original = new Style();
var clone = original.clone(); var clone = original.clone();
expect(clone).to.be.an(_ol_style_Style_); expect(clone).to.be.an(Style);
expect(clone).to.not.be(original); expect(clone).to.not.be(original);
}); });
it('copies all values', function() { it('copies all values', function() {
var original = new _ol_style_Style_({ var original = new Style({
geometry: new Point([0, 0, 0]), geometry: new Point([0, 0, 0]),
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
color: '#319FD3' color: '#319FD3'
@@ -69,7 +69,7 @@ describe('ol.style.Style', function() {
}); });
it('the clone does not reference the same objects as the original', function() { it('the clone does not reference the same objects as the original', function() {
var original = new _ol_style_Style_({ var original = new Style({
geometry: new Point([0, 0, 0]), geometry: new Point([0, 0, 0]),
fill: new _ol_style_Fill_({ fill: new _ol_style_Fill_({
color: '#319FD3' color: '#319FD3'
@@ -107,7 +107,7 @@ describe('ol.style.Style', function() {
describe('#setZIndex', function() { describe('#setZIndex', function() {
it('sets the zIndex', function() { it('sets the zIndex', function() {
var style = new _ol_style_Style_(); var style = new Style();
style.setZIndex(0.7); style.setZIndex(0.7);
expect(style.getZIndex()).to.be(0.7); expect(style.getZIndex()).to.be(0.7);
@@ -115,7 +115,7 @@ describe('ol.style.Style', function() {
}); });
describe('#getFill', function() { describe('#getFill', function() {
var style = new _ol_style_Style_({ var style = new Style({
fill: testFill fill: testFill
}); });
@@ -125,7 +125,7 @@ describe('ol.style.Style', function() {
}); });
describe('#setFill', function() { describe('#setFill', function() {
var style = new _ol_style_Style_(); var style = new Style();
it('sets the fill style of a style', function() { it('sets the fill style of a style', function() {
style.setFill(testFill); style.setFill(testFill);
@@ -134,7 +134,7 @@ describe('ol.style.Style', function() {
}); });
describe('#getImage', function() { describe('#getImage', function() {
var style = new _ol_style_Style_({ var style = new Style({
image: testImage image: testImage
}); });
@@ -144,7 +144,7 @@ describe('ol.style.Style', function() {
}); });
describe('#setImage', function() { describe('#setImage', function() {
var style = new _ol_style_Style_(); var style = new Style();
it('sets the image style of a style', function() { it('sets the image style of a style', function() {
style.setImage(testImage); style.setImage(testImage);
@@ -153,7 +153,7 @@ describe('ol.style.Style', function() {
}); });
describe('#getStroke', function() { describe('#getStroke', function() {
var style = new _ol_style_Style_({ var style = new Style({
stroke: testStroke stroke: testStroke
}); });
@@ -163,7 +163,7 @@ describe('ol.style.Style', function() {
}); });
describe('#setStroke', function() { describe('#setStroke', function() {
var style = new _ol_style_Style_(); var style = new Style();
it('sets the stroke style of a style', function() { it('sets the stroke style of a style', function() {
style.setStroke(testStroke); style.setStroke(testStroke);
@@ -172,7 +172,7 @@ describe('ol.style.Style', function() {
}); });
describe('#getText', function() { describe('#getText', function() {
var style = new _ol_style_Style_({ var style = new Style({
text: testText text: testText
}); });
@@ -182,7 +182,7 @@ describe('ol.style.Style', function() {
}); });
describe('#setText', function() { describe('#setText', function() {
var style = new _ol_style_Style_(); var style = new Style();
it('sets the text style of a style', function() { it('sets the text style of a style', function() {
style.setText(testText); style.setText(testText);
@@ -191,7 +191,7 @@ describe('ol.style.Style', function() {
}); });
describe('#setGeometry', function() { describe('#setGeometry', function() {
var style = new _ol_style_Style_(); var style = new Style();
it('creates a geometry function from a string', function() { it('creates a geometry function from a string', function() {
var feature = new Feature(); var feature = new Feature();
@@ -221,7 +221,7 @@ describe('ol.style.Style', function() {
describe('#getGeometry', function() { describe('#getGeometry', function() {
it('returns whatever was passed to setGeometry', function() { it('returns whatever was passed to setGeometry', function() {
var style = new _ol_style_Style_(); var style = new Style();
style.setGeometry('foo'); style.setGeometry('foo');
expect(style.getGeometry()).to.eql('foo'); expect(style.getGeometry()).to.eql('foo');
var geom = new Point([1, 2]); var geom = new Point([1, 2]);
@@ -241,15 +241,15 @@ describe('ol.style.Style', function() {
}); });
describe('ol.style.Style.createFunction()', function() { describe('ol.style.Style.createFunction()', function() {
var style = new _ol_style_Style_(); var style = new Style();
it('creates a style function from a single style', function() { it('creates a style function from a single style', function() {
var styleFunction = _ol_style_Style_.createFunction(style); var styleFunction = Style.createFunction(style);
expect(styleFunction()).to.eql([style]); expect(styleFunction()).to.eql([style]);
}); });
it('creates a style function from an array of styles', function() { it('creates a style function from an array of styles', function() {
var styleFunction = _ol_style_Style_.createFunction([style]); var styleFunction = Style.createFunction([style]);
expect(styleFunction()).to.eql([style]); expect(styleFunction()).to.eql([style]);
}); });
@@ -257,13 +257,13 @@ describe('ol.style.Style.createFunction()', function() {
var original = function() { var original = function() {
return [style]; return [style];
}; };
var styleFunction = _ol_style_Style_.createFunction(original); var styleFunction = Style.createFunction(original);
expect(styleFunction).to.be(original); expect(styleFunction).to.be(original);
}); });
it('throws on (some) unexpected input', function() { it('throws on (some) unexpected input', function() {
expect(function() { expect(function() {
_ol_style_Style_.createFunction({bogus: 'input'}); Style.createFunction({bogus: 'input'});
}).to.throwException(); }).to.throwException();
}); });