Rename _ol_style_Style_ to Style
This commit is contained in:
@@ -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_Fill_ from '../src/ol/style/Fill.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.
|
||||
@@ -18,7 +18,7 @@ var redLayer = new VectorLayer({
|
||||
source: new VectorSource({
|
||||
features: [new Feature(new Point([0, 0]))]
|
||||
}),
|
||||
style: new _ol_style_Style_({
|
||||
style: new Style({
|
||||
image: new _ol_style_Circle_({
|
||||
fill: new _ol_style_Fill_({
|
||||
color: 'rgba(255,0,0,0.8)'
|
||||
@@ -36,7 +36,7 @@ var greenLayer = new VectorLayer({
|
||||
// 433.013 is roughly 250 * Math.sqrt(3)
|
||||
features: [new Feature(new Point([250, 433.013]))]
|
||||
}),
|
||||
style: new _ol_style_Style_({
|
||||
style: new Style({
|
||||
image: new _ol_style_Circle_({
|
||||
fill: new _ol_style_Fill_({
|
||||
color: 'rgba(0,255,0,0.8)'
|
||||
@@ -53,7 +53,7 @@ var blueLayer = new VectorLayer({
|
||||
source: new VectorSource({
|
||||
features: [new Feature(new Point([500, 0]))]
|
||||
}),
|
||||
style: new _ol_style_Style_({
|
||||
style: new Style({
|
||||
image: new _ol_style_Circle_({
|
||||
fill: new _ol_style_Fill_({
|
||||
color: 'rgba(0,0,255,0.8)'
|
||||
|
||||
@@ -8,7 +8,7 @@ import {fromLonLat} from '../src/ol/proj.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.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 context = canvas.getContext('2d');
|
||||
@@ -58,7 +58,7 @@ var pattern = (function() {
|
||||
|
||||
// Generate style for gradient or pattern fill
|
||||
var fill = new _ol_style_Fill_();
|
||||
var style = new _ol_style_Style_({
|
||||
var style = new Style({
|
||||
fill: fill,
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: '#333',
|
||||
|
||||
@@ -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_Fill_ from '../src/ol/style/Fill.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({
|
||||
url: 'data/geojson/switzerland.geojson',
|
||||
format: new GeoJSON()
|
||||
});
|
||||
var style = new _ol_style_Style_({
|
||||
var style = new Style({
|
||||
fill: new _ol_style_Fill_({
|
||||
color: 'rgba(255, 255, 255, 0.6)'
|
||||
}),
|
||||
|
||||
@@ -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_Fill_ from '../src/ol/style/Fill.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';
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ var clusters = new VectorLayer({
|
||||
var size = feature.get('features').length;
|
||||
var style = styleCache[size];
|
||||
if (!style) {
|
||||
style = new _ol_style_Style_({
|
||||
style = new Style({
|
||||
image: new _ol_style_Circle_({
|
||||
radius: 10,
|
||||
stroke: new _ol_style_Stroke_({
|
||||
|
||||
@@ -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_Icon_ from '../src/ol/style/Icon.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({
|
||||
features: [pointFeature, lineFeature, polygonFeature]
|
||||
}),
|
||||
style: new _ol_style_Style_({
|
||||
style: new Style({
|
||||
image: new _ol_style_Icon_(/** @type {olx.style.IconOptions} */ ({
|
||||
anchor: [0.5, 46],
|
||||
anchorXUnits: 'fraction',
|
||||
|
||||
@@ -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_Fill_ from '../src/ol/style/Fill.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 = {
|
||||
'Point': new _ol_style_Style_({
|
||||
'Point': new Style({
|
||||
image: new _ol_style_Circle_({
|
||||
fill: new _ol_style_Fill_({
|
||||
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_({
|
||||
color: '#f00',
|
||||
width: 3
|
||||
})
|
||||
}),
|
||||
'Polygon': new _ol_style_Style_({
|
||||
'Polygon': new Style({
|
||||
fill: new _ol_style_Fill_({
|
||||
color: 'rgba(0,255,255,0.5)'
|
||||
}),
|
||||
@@ -45,7 +45,7 @@ var defaultStyle = {
|
||||
width: 1
|
||||
})
|
||||
}),
|
||||
'MultiPoint': new _ol_style_Style_({
|
||||
'MultiPoint': new Style({
|
||||
image: new _ol_style_Circle_({
|
||||
fill: new _ol_style_Fill_({
|
||||
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_({
|
||||
color: '#0f0',
|
||||
width: 3
|
||||
})
|
||||
}),
|
||||
'MultiPolygon': new _ol_style_Style_({
|
||||
'MultiPolygon': new Style({
|
||||
fill: new _ol_style_Fill_({
|
||||
color: 'rgba(0,0,255,0.5)'
|
||||
}),
|
||||
|
||||
@@ -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_Fill_ from '../src/ol/style/Fill.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 = {
|
||||
'Point': new _ol_style_Style_({
|
||||
'Point': new Style({
|
||||
image: new _ol_style_Circle_({
|
||||
fill: new _ol_style_Fill_({
|
||||
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_({
|
||||
color: '#f00',
|
||||
width: 3
|
||||
})
|
||||
}),
|
||||
'Polygon': new _ol_style_Style_({
|
||||
'Polygon': new Style({
|
||||
fill: new _ol_style_Fill_({
|
||||
color: 'rgba(0,255,255,0.5)'
|
||||
}),
|
||||
@@ -45,7 +45,7 @@ var defaultStyle = {
|
||||
width: 1
|
||||
})
|
||||
}),
|
||||
'MultiPoint': new _ol_style_Style_({
|
||||
'MultiPoint': new Style({
|
||||
image: new _ol_style_Circle_({
|
||||
fill: new _ol_style_Fill_({
|
||||
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_({
|
||||
color: '#0f0',
|
||||
width: 3
|
||||
})
|
||||
}),
|
||||
'MultiPolygon': new _ol_style_Style_({
|
||||
'MultiPolygon': new Style({
|
||||
fill: new _ol_style_Fill_({
|
||||
color: 'rgba(0,0,255,0.5)'
|
||||
}),
|
||||
|
||||
@@ -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_Fill_ from '../src/ol/style/Fill.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({
|
||||
source: new OSM()
|
||||
@@ -19,7 +19,7 @@ var raster = new TileLayer({
|
||||
var source = new VectorSource();
|
||||
var vector = new VectorLayer({
|
||||
source: source,
|
||||
style: new _ol_style_Style_({
|
||||
style: new Style({
|
||||
fill: new _ol_style_Fill_({
|
||||
color: 'rgba(255, 255, 255, 0.2)'
|
||||
}),
|
||||
|
||||
@@ -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_Fill_ from '../src/ol/style/Fill.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({
|
||||
@@ -23,7 +23,7 @@ var map = new Map({
|
||||
})
|
||||
});
|
||||
|
||||
var imageStyle = new _ol_style_Style_({
|
||||
var imageStyle = new Style({
|
||||
image: new _ol_style_Circle_({
|
||||
radius: 5,
|
||||
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_({
|
||||
radius: 2,
|
||||
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_({
|
||||
radius: 5,
|
||||
snapToPixel: false,
|
||||
|
||||
@@ -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_RegularShape_ from '../src/ol/style/RegularShape.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';
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ function createEarthquakeStyle(feature) {
|
||||
var magnitude = parseFloat(name.substr(2));
|
||||
var radius = 5 + 20 * (magnitude - 5);
|
||||
|
||||
return new _ol_style_Style_({
|
||||
return new Style({
|
||||
geometry: feature.getGeometry(),
|
||||
image: new _ol_style_RegularShape_({
|
||||
radius1: radius,
|
||||
@@ -85,7 +85,7 @@ function styleFunction(feature, resolution) {
|
||||
var style;
|
||||
var size = feature.get('features').length;
|
||||
if (size > 1) {
|
||||
style = new _ol_style_Style_({
|
||||
style = new Style({
|
||||
image: new _ol_style_Circle_({
|
||||
radius: feature.get('radius'),
|
||||
fill: new _ol_style_Fill_({
|
||||
@@ -106,7 +106,7 @@ function styleFunction(feature, resolution) {
|
||||
}
|
||||
|
||||
function selectStyleFunction(feature) {
|
||||
var styles = [new _ol_style_Style_({
|
||||
var styles = [new Style({
|
||||
image: new _ol_style_Circle_({
|
||||
radius: feature.get('radius'),
|
||||
fill: invisibleFill
|
||||
|
||||
@@ -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_Icon_ from '../src/ol/style/Icon.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]];
|
||||
@@ -35,12 +35,12 @@ var styleFunction = function(feature) {
|
||||
var vectorContext = _ol_render_.toContext(
|
||||
/** @type {CanvasRenderingContext2D} */ (canvas.getContext('2d')),
|
||||
{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)'}),
|
||||
stroke: new _ol_style_Stroke_({color: 'rgba(255, 204, 0, 0.2)', width: 2})
|
||||
}));
|
||||
vectorContext.drawGeometry(new Polygon([symbol.map(scaleFunction)]));
|
||||
style = new _ol_style_Style_({
|
||||
style = new Style({
|
||||
image: new _ol_style_Icon_({
|
||||
img: canvas,
|
||||
imgSize: [size, size],
|
||||
|
||||
@@ -12,7 +12,7 @@ import OSM from '../src/ol/source/OSM.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Circle_ from '../src/ol/style/Circle.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({
|
||||
@@ -66,7 +66,7 @@ function flash(feature) {
|
||||
var radius = easeOut(elapsedRatio) * 25 + 5;
|
||||
var opacity = easeOut(1 - elapsedRatio);
|
||||
|
||||
var style = new _ol_style_Style_({
|
||||
var style = new Style({
|
||||
image: new _ol_style_Circle_({
|
||||
radius: radius,
|
||||
snapToPixel: false,
|
||||
|
||||
@@ -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_Icon_ from '../src/ol/style/Icon.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.
|
||||
// It is usually loaded with AJAX.
|
||||
@@ -85,18 +85,18 @@ var endMarker = new Feature({
|
||||
});
|
||||
|
||||
var styles = {
|
||||
'route': new _ol_style_Style_({
|
||||
'route': new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
width: 6, color: [237, 212, 0, 0.8]
|
||||
})
|
||||
}),
|
||||
'icon': new _ol_style_Style_({
|
||||
'icon': new Style({
|
||||
image: new _ol_style_Icon_({
|
||||
anchor: [0.5, 1],
|
||||
src: 'data/icon.png'
|
||||
})
|
||||
}),
|
||||
'geoMarker': new _ol_style_Style_({
|
||||
'geoMarker': new Style({
|
||||
image: new _ol_style_Circle_({
|
||||
radius: 7,
|
||||
snapToPixel: false,
|
||||
|
||||
@@ -8,7 +8,7 @@ import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import Stamen from '../src/ol/source/Stamen.js';
|
||||
import VectorSource from '../src/ol/source/Vector.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({
|
||||
layers: [
|
||||
@@ -25,7 +25,7 @@ var map = new Map({
|
||||
})
|
||||
});
|
||||
|
||||
var style = new _ol_style_Style_({
|
||||
var style = new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: '#EAE911',
|
||||
width: 2
|
||||
|
||||
@@ -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_Fill_ from '../src/ol/style/Fill.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_({
|
||||
@@ -21,25 +21,25 @@ var image = new _ol_style_Circle_({
|
||||
});
|
||||
|
||||
var styles = {
|
||||
'Point': new _ol_style_Style_({
|
||||
'Point': new Style({
|
||||
image: image
|
||||
}),
|
||||
'LineString': new _ol_style_Style_({
|
||||
'LineString': new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: 'green',
|
||||
width: 1
|
||||
})
|
||||
}),
|
||||
'MultiLineString': new _ol_style_Style_({
|
||||
'MultiLineString': new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: 'green',
|
||||
width: 1
|
||||
})
|
||||
}),
|
||||
'MultiPoint': new _ol_style_Style_({
|
||||
'MultiPoint': new Style({
|
||||
image: image
|
||||
}),
|
||||
'MultiPolygon': new _ol_style_Style_({
|
||||
'MultiPolygon': new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: 'yellow',
|
||||
width: 1
|
||||
@@ -48,7 +48,7 @@ var styles = {
|
||||
color: 'rgba(255, 255, 0, 0.1)'
|
||||
})
|
||||
}),
|
||||
'Polygon': new _ol_style_Style_({
|
||||
'Polygon': new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: 'blue',
|
||||
lineDash: [4],
|
||||
@@ -58,7 +58,7 @@ var styles = {
|
||||
color: 'rgba(0, 0, 255, 0.1)'
|
||||
})
|
||||
}),
|
||||
'GeometryCollection': new _ol_style_Style_({
|
||||
'GeometryCollection': new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: 'magenta',
|
||||
width: 2
|
||||
@@ -74,7 +74,7 @@ var styles = {
|
||||
})
|
||||
})
|
||||
}),
|
||||
'Circle': new _ol_style_Style_({
|
||||
'Circle': new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: 'red',
|
||||
width: 2
|
||||
|
||||
@@ -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_Fill_ from '../src/ol/style/Fill.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({
|
||||
center: [0, 0],
|
||||
@@ -67,7 +67,7 @@ geolocation.on('change:accuracyGeometry', function() {
|
||||
});
|
||||
|
||||
var positionFeature = new Feature();
|
||||
positionFeature.setStyle(new _ol_style_Style_({
|
||||
positionFeature.setStyle(new Style({
|
||||
image: new _ol_style_Circle_({
|
||||
radius: 6,
|
||||
fill: new _ol_style_Fill_({
|
||||
|
||||
@@ -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_Fill_ from '../src/ol/style/Fill.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({
|
||||
source: new BingMaps({
|
||||
@@ -18,7 +18,7 @@ var raster = new TileLayer({
|
||||
});
|
||||
|
||||
var style = {
|
||||
'Point': new _ol_style_Style_({
|
||||
'Point': new Style({
|
||||
image: new _ol_style_Circle_({
|
||||
fill: new _ol_style_Fill_({
|
||||
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_({
|
||||
color: '#f00',
|
||||
width: 3
|
||||
})
|
||||
}),
|
||||
'MultiLineString': new _ol_style_Style_({
|
||||
'MultiLineString': new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: '#0f0',
|
||||
width: 3
|
||||
|
||||
@@ -6,14 +6,14 @@ import OSM from '../src/ol/source/OSM.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import Feature from '../src/ol/Feature.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';
|
||||
|
||||
var raster = new TileLayer({
|
||||
source: new OSM()
|
||||
});
|
||||
|
||||
var style = new _ol_style_Style_({
|
||||
var style = new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: 'black',
|
||||
width: 1
|
||||
|
||||
@@ -8,7 +8,7 @@ import {fromLonLat} from '../src/ol/proj.js';
|
||||
import TileJSON from '../src/ol/source/TileJSON.js';
|
||||
import VectorSource from '../src/ol/source/Vector.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({
|
||||
@@ -23,7 +23,7 @@ var madrid = new Feature({
|
||||
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} */ ({
|
||||
color: '#8959A8',
|
||||
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} */ ({
|
||||
color: '#4271AE',
|
||||
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} */ ({
|
||||
color: [113, 140, 0],
|
||||
crossOrigin: 'anonymous',
|
||||
|
||||
@@ -8,11 +8,11 @@ import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import Stamen from '../src/ol/source/Stamen.js';
|
||||
import VectorSource from '../src/ol/source/Vector.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) {
|
||||
return new _ol_style_Style_({
|
||||
return new Style({
|
||||
image: new _ol_style_Icon_(/** @type {olx.style.IconOptions} */ ({
|
||||
anchor: [0.5, 0.96],
|
||||
crossOrigin: 'anonymous',
|
||||
|
||||
@@ -5,7 +5,7 @@ import Point from '../src/ol/geom/Point.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import VectorSource from '../src/ol/source/Vector.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 = [{
|
||||
@@ -65,7 +65,7 @@ for (i = 0; i < featureCount; ++i) {
|
||||
[2 * e * Math.random() - e, 2 * e * Math.random() - e]);
|
||||
feature = new Feature(geometry);
|
||||
feature.setStyle(
|
||||
new _ol_style_Style_({
|
||||
new Style({
|
||||
image: icons[i % (iconCount - 1)]
|
||||
})
|
||||
);
|
||||
@@ -101,7 +101,7 @@ new VectorLayer({
|
||||
source: new VectorSource({
|
||||
features: overlayFeatures
|
||||
}),
|
||||
style: new _ol_style_Style_({
|
||||
style: new Style({
|
||||
image: icons[iconCount - 1]
|
||||
})
|
||||
});
|
||||
|
||||
@@ -8,7 +8,7 @@ import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import TileJSON from '../src/ol/source/TileJSON.js';
|
||||
import VectorSource from '../src/ol/source/Vector.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({
|
||||
@@ -18,7 +18,7 @@ var iconFeature = new Feature({
|
||||
rainfall: 500
|
||||
});
|
||||
|
||||
var iconStyle = new _ol_style_Style_({
|
||||
var iconStyle = new Style({
|
||||
image: new _ol_style_Icon_(/** @type {olx.style.IconOptions} */ ({
|
||||
anchor: [0.5, 46],
|
||||
anchorXUnits: 'fraction',
|
||||
|
||||
@@ -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_Fill_ from '../src/ol/style/Fill.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 = {
|
||||
@@ -28,7 +28,7 @@ var styleFunction = function(feature) {
|
||||
var color = colors[feature.get('PLT')];
|
||||
var style = styleCache[color];
|
||||
if (!style) {
|
||||
style = new _ol_style_Style_({
|
||||
style = new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: color,
|
||||
width: 3
|
||||
@@ -156,7 +156,7 @@ var stroke = new _ol_style_Stroke_({
|
||||
color: 'rgba(255,0,0,0.9)',
|
||||
width: 1
|
||||
});
|
||||
var style = new _ol_style_Style_({
|
||||
var style = new Style({
|
||||
stroke: stroke,
|
||||
image: new _ol_style_Circle_({
|
||||
radius: 5,
|
||||
@@ -178,7 +178,7 @@ map.on('postcompose', function(evt) {
|
||||
var featureOverlay = new VectorLayer({
|
||||
source: new VectorSource(),
|
||||
map: map,
|
||||
style: new _ol_style_Style_({
|
||||
style: new Style({
|
||||
image: new _ol_style_Circle_({
|
||||
radius: 5,
|
||||
fill: new _ol_style_Fill_({
|
||||
|
||||
@@ -5,11 +5,11 @@ import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.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';
|
||||
|
||||
|
||||
var style = new _ol_style_Style_({
|
||||
var style = new Style({
|
||||
fill: new _ol_style_Fill_({
|
||||
color: 'rgba(255, 255, 255, 0.6)'
|
||||
}),
|
||||
@@ -44,7 +44,7 @@ var map = new Map({
|
||||
var featureOverlay = new VectorLayer({
|
||||
source: new VectorSource(),
|
||||
map: map,
|
||||
style: new _ol_style_Style_({
|
||||
style: new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: '#f00',
|
||||
width: 1
|
||||
|
||||
@@ -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_Fill_ from '../src/ol/style/Fill.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 = {};
|
||||
@@ -21,7 +21,7 @@ var styleFunction = function(feature) {
|
||||
var radius = 5 + 20 * (magnitude - 5);
|
||||
var style = styleCache[radius];
|
||||
if (!style) {
|
||||
style = new _ol_style_Style_({
|
||||
style = new Style({
|
||||
image: new _ol_style_Circle_({
|
||||
radius: radius,
|
||||
fill: new _ol_style_Fill_({
|
||||
|
||||
@@ -7,7 +7,7 @@ import Stamen from '../src/ol/source/Stamen.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.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;
|
||||
}
|
||||
var opacity = 0.75 * (1 - delta / 12);
|
||||
return new _ol_style_Style_({
|
||||
return new Style({
|
||||
fill: new _ol_style_Fill_({
|
||||
color: [0xff, 0xff, 0x33, opacity]
|
||||
}),
|
||||
|
||||
@@ -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_RegularShape_ from '../src/ol/style/RegularShape.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 styles = {
|
||||
'square': new _ol_style_Style_({
|
||||
'square': new Style({
|
||||
image: new _ol_style_RegularShape_({
|
||||
fill: new _ol_style_Fill_({color: 'blue'}),
|
||||
stroke: stroke,
|
||||
@@ -22,7 +22,7 @@ var styles = {
|
||||
angle: Math.PI / 4
|
||||
})
|
||||
}),
|
||||
'triangle': new _ol_style_Style_({
|
||||
'triangle': new Style({
|
||||
image: new _ol_style_RegularShape_({
|
||||
fill: new _ol_style_Fill_({color: 'red'}),
|
||||
stroke: stroke,
|
||||
@@ -32,7 +32,7 @@ var styles = {
|
||||
angle: 0
|
||||
})
|
||||
}),
|
||||
'star': new _ol_style_Style_({
|
||||
'star': new Style({
|
||||
image: new _ol_style_RegularShape_({
|
||||
fill: new _ol_style_Fill_({color: 'green'}),
|
||||
stroke: stroke,
|
||||
|
||||
@@ -8,7 +8,7 @@ import OSM from '../src/ol/source/OSM.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Icon_ from '../src/ol/style/Icon.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({
|
||||
source: new OSM()
|
||||
@@ -20,7 +20,7 @@ var styleFunction = function(feature) {
|
||||
var geometry = feature.getGeometry();
|
||||
var styles = [
|
||||
// linestring
|
||||
new _ol_style_Style_({
|
||||
new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: '#ffcc33',
|
||||
width: 2
|
||||
@@ -33,7 +33,7 @@ var styleFunction = function(feature) {
|
||||
var dy = end[1] - start[1];
|
||||
var rotation = Math.atan2(dy, dx);
|
||||
// arrows
|
||||
styles.push(new _ol_style_Style_({
|
||||
styles.push(new Style({
|
||||
geometry: new Point(end),
|
||||
image: new _ol_style_Icon_({
|
||||
src: 'data/arrow.png',
|
||||
|
||||
@@ -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_Icon_ from '../src/ol/style/Icon.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 TileGrid from '../src/ol/tilegrid/TileGrid.js';
|
||||
|
||||
@@ -45,7 +45,7 @@ var map = new Map({
|
||||
}),
|
||||
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',
|
||||
|
||||
@@ -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_Icon_ from '../src/ol/style/Icon.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';
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ var map = new Map({
|
||||
url: 'https://{a-d}.tiles.mapbox.com/v4/mapbox.mapbox-streets-v6/' +
|
||||
'{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',
|
||||
|
||||
@@ -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_Fill_ from '../src/ol/style/Fill.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({
|
||||
@@ -24,7 +24,7 @@ var source = new VectorSource();
|
||||
|
||||
var vector = new VectorLayer({
|
||||
source: source,
|
||||
style: new _ol_style_Style_({
|
||||
style: new Style({
|
||||
fill: new _ol_style_Fill_({
|
||||
color: 'rgba(255, 255, 255, 0.2)'
|
||||
}),
|
||||
@@ -180,7 +180,7 @@ function addInteraction() {
|
||||
draw = new Draw({
|
||||
source: source,
|
||||
type: type,
|
||||
style: new _ol_style_Style_({
|
||||
style: new Style({
|
||||
fill: new _ol_style_Fill_({
|
||||
color: 'rgba(255, 255, 255, 0.2)'
|
||||
}),
|
||||
|
||||
@@ -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_Fill_ from '../src/ol/style/Fill.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() {
|
||||
@@ -19,8 +19,8 @@ var styleFunction = (function() {
|
||||
fill: null,
|
||||
stroke: new _ol_style_Stroke_({color: 'orange', width: 2})
|
||||
});
|
||||
styles['Point'] = new _ol_style_Style_({image: image});
|
||||
styles['Polygon'] = new _ol_style_Style_({
|
||||
styles['Point'] = new Style({image: image});
|
||||
styles['Polygon'] = new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: 'blue',
|
||||
width: 3
|
||||
@@ -29,13 +29,13 @@ var styleFunction = (function() {
|
||||
color: 'rgba(0, 0, 255, 0.1)'
|
||||
})
|
||||
});
|
||||
styles['MultiLineString'] = new _ol_style_Style_({
|
||||
styles['MultiLineString'] = new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: 'green',
|
||||
width: 3
|
||||
})
|
||||
});
|
||||
styles['MultiPolygon'] = new _ol_style_Style_({
|
||||
styles['MultiPolygon'] = new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: 'yellow',
|
||||
width: 1
|
||||
@@ -44,7 +44,7 @@ var styleFunction = (function() {
|
||||
color: 'rgba(255, 255, 0, 0.1)'
|
||||
})
|
||||
});
|
||||
styles['default'] = new _ol_style_Style_({
|
||||
styles['default'] = new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: 'red',
|
||||
width: 3
|
||||
@@ -156,18 +156,18 @@ var layer = new VectorLayer({
|
||||
var overlayStyle = (function() {
|
||||
var styles = {};
|
||||
styles['Polygon'] = [
|
||||
new _ol_style_Style_({
|
||||
new Style({
|
||||
fill: new _ol_style_Fill_({
|
||||
color: [255, 255, 255, 0.5]
|
||||
})
|
||||
}),
|
||||
new _ol_style_Style_({
|
||||
new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: [255, 255, 255, 1],
|
||||
width: 5
|
||||
})
|
||||
}),
|
||||
new _ol_style_Style_({
|
||||
new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: [0, 153, 255, 1],
|
||||
width: 3
|
||||
@@ -177,13 +177,13 @@ var overlayStyle = (function() {
|
||||
styles['MultiPolygon'] = styles['Polygon'];
|
||||
|
||||
styles['LineString'] = [
|
||||
new _ol_style_Style_({
|
||||
new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: [255, 255, 255, 1],
|
||||
width: 5
|
||||
})
|
||||
}),
|
||||
new _ol_style_Style_({
|
||||
new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: [0, 153, 255, 1],
|
||||
width: 3
|
||||
@@ -193,7 +193,7 @@ var overlayStyle = (function() {
|
||||
styles['MultiLineString'] = styles['LineString'];
|
||||
|
||||
styles['Point'] = [
|
||||
new _ol_style_Style_({
|
||||
new Style({
|
||||
image: new _ol_style_Circle_({
|
||||
radius: 7,
|
||||
fill: new _ol_style_Fill_({
|
||||
|
||||
@@ -6,7 +6,7 @@ import {fromLonLat} from '../src/ol/proj.js';
|
||||
import VectorTileSource from '../src/ol/source/VectorTile.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.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';
|
||||
|
||||
@@ -16,7 +16,7 @@ var roadColor = {
|
||||
'minor_road': '#ccb',
|
||||
'highway': '#f39'
|
||||
};
|
||||
var buildingStyle = new _ol_style_Style_({
|
||||
var buildingStyle = new Style({
|
||||
fill: new _ol_style_Fill_({
|
||||
color: '#666',
|
||||
opacity: 0.4
|
||||
@@ -26,7 +26,7 @@ var buildingStyle = new _ol_style_Style_({
|
||||
width: 1
|
||||
})
|
||||
});
|
||||
var waterStyle = new _ol_style_Style_({
|
||||
var waterStyle = new Style({
|
||||
fill: new _ol_style_Fill_({
|
||||
color: '#9db9e8'
|
||||
})
|
||||
@@ -46,7 +46,7 @@ var roadStyle = function(feature) {
|
||||
color = roadColor[kind];
|
||||
width = kind == 'highway' ? 1.5 : 1;
|
||||
}
|
||||
style = new _ol_style_Style_({
|
||||
style = new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: color,
|
||||
width: width
|
||||
|
||||
@@ -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_Fill_ from '../src/ol/style/Fill.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 = [
|
||||
/* 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
|
||||
* the style.
|
||||
*/
|
||||
new _ol_style_Style_({
|
||||
new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: 'blue',
|
||||
width: 3
|
||||
@@ -26,7 +26,7 @@ var styles = [
|
||||
color: 'rgba(0, 0, 255, 0.1)'
|
||||
})
|
||||
}),
|
||||
new _ol_style_Style_({
|
||||
new Style({
|
||||
image: new _ol_style_Circle_({
|
||||
radius: 5,
|
||||
fill: new _ol_style_Fill_({
|
||||
|
||||
@@ -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_RegularShape_ from '../src/ol/style/RegularShape.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 fill = new _ol_style_Fill_({color: 'red'});
|
||||
|
||||
var styles = {
|
||||
'square': new _ol_style_Style_({
|
||||
'square': new Style({
|
||||
image: new _ol_style_RegularShape_({
|
||||
fill: fill,
|
||||
stroke: stroke,
|
||||
@@ -23,7 +23,7 @@ var styles = {
|
||||
angle: Math.PI / 4
|
||||
})
|
||||
}),
|
||||
'triangle': new _ol_style_Style_({
|
||||
'triangle': new Style({
|
||||
image: new _ol_style_RegularShape_({
|
||||
fill: fill,
|
||||
stroke: stroke,
|
||||
@@ -33,7 +33,7 @@ var styles = {
|
||||
angle: 0
|
||||
})
|
||||
}),
|
||||
'star': new _ol_style_Style_({
|
||||
'star': new Style({
|
||||
image: new _ol_style_RegularShape_({
|
||||
fill: fill,
|
||||
stroke: stroke,
|
||||
@@ -43,7 +43,7 @@ var styles = {
|
||||
angle: 0
|
||||
})
|
||||
}),
|
||||
'cross': new _ol_style_Style_({
|
||||
'cross': new Style({
|
||||
image: new _ol_style_RegularShape_({
|
||||
fill: fill,
|
||||
stroke: stroke,
|
||||
@@ -53,7 +53,7 @@ var styles = {
|
||||
angle: 0
|
||||
})
|
||||
}),
|
||||
'x': new _ol_style_Style_({
|
||||
'x': new Style({
|
||||
image: new _ol_style_RegularShape_({
|
||||
fill: fill,
|
||||
stroke: stroke,
|
||||
|
||||
@@ -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_Fill_ from '../src/ol/style/Fill.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');
|
||||
@@ -13,7 +13,7 @@ var vectorContext = _ol_render_.toContext(canvas.getContext('2d'), {size: [100,
|
||||
|
||||
var fill = new _ol_style_Fill_({color: 'blue'});
|
||||
var stroke = new _ol_style_Stroke_({color: 'black'});
|
||||
var style = new _ol_style_Style_({
|
||||
var style = new Style({
|
||||
fill: fill,
|
||||
stroke: stroke,
|
||||
image: new _ol_style_Circle_({
|
||||
|
||||
@@ -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_Fill_ from '../src/ol/style/Fill.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({
|
||||
source: new OSM()
|
||||
@@ -19,7 +19,7 @@ var raster = new TileLayer({
|
||||
|
||||
var vector = new VectorLayer({
|
||||
source: new VectorSource(),
|
||||
style: new _ol_style_Style_({
|
||||
style: new Style({
|
||||
fill: new _ol_style_Fill_({
|
||||
color: 'rgba(255, 255, 255, 0.2)'
|
||||
}),
|
||||
|
||||
@@ -7,10 +7,10 @@ import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import BingMaps from '../src/ol/source/BingMaps.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||
import Style from '../src/ol/style/Style.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_({
|
||||
font: 'bold 11px "Open Sans", "Arial Unicode MS", "sans-serif"',
|
||||
placement: 'line',
|
||||
|
||||
@@ -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_RegularShape_ from '../src/ol/style/RegularShape.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({
|
||||
// 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]);
|
||||
feature = new Feature(geometry);
|
||||
feature.setStyle(
|
||||
new _ol_style_Style_({
|
||||
new Style({
|
||||
image: symbols[i % symbolCount]
|
||||
})
|
||||
);
|
||||
|
||||
@@ -5,7 +5,7 @@ import LineString from '../src/ol/geom/LineString.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import VectorSource from '../src/ol/source/Vector.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;
|
||||
@@ -41,7 +41,7 @@ var vector = new VectorLayer({
|
||||
features: features,
|
||||
wrapX: false
|
||||
}),
|
||||
style: new _ol_style_Style_({
|
||||
style: new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: '#666666',
|
||||
width: 1
|
||||
|
||||
@@ -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_Fill_ from '../src/ol/style/Fill.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;
|
||||
@@ -24,14 +24,14 @@ for (var i = 0; i < count; ++i) {
|
||||
}
|
||||
|
||||
var styles = {
|
||||
'10': new _ol_style_Style_({
|
||||
'10': new Style({
|
||||
image: new _ol_style_Circle_({
|
||||
radius: 5,
|
||||
fill: new _ol_style_Fill_({color: '#666666'}),
|
||||
stroke: new _ol_style_Stroke_({color: '#bada55', width: 1})
|
||||
})
|
||||
}),
|
||||
'20': new _ol_style_Style_({
|
||||
'20': new Style({
|
||||
image: new _ol_style_Circle_({
|
||||
radius: 10,
|
||||
fill: new _ol_style_Fill_({color: '#666666'}),
|
||||
@@ -100,7 +100,7 @@ var stroke = new _ol_style_Stroke_({
|
||||
color: 'rgba(255,255,0,0.9)',
|
||||
width: 3
|
||||
});
|
||||
var style = new _ol_style_Style_({
|
||||
var style = new Style({
|
||||
stroke: stroke,
|
||||
image: new _ol_style_Circle_({
|
||||
radius: 10,
|
||||
|
||||
@@ -7,7 +7,7 @@ import TileJSON from '../src/ol/source/TileJSON.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.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({
|
||||
@@ -16,7 +16,7 @@ var raster = new TileLayer({
|
||||
})
|
||||
});
|
||||
|
||||
var style = new _ol_style_Style_({
|
||||
var style = new Style({
|
||||
fill: new _ol_style_Fill_({
|
||||
color: 'rgba(255, 255, 255, 0.6)'
|
||||
}),
|
||||
|
||||
@@ -13,7 +13,7 @@ import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import OSM from '../src/ol/source/OSM.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_Fill_ from '../src/ol/style/Fill.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({
|
||||
source: nodes,
|
||||
style: function(f) {
|
||||
var style = new _ol_style_Style_({
|
||||
var style = new Style({
|
||||
image: new _ol_style_Circle_({
|
||||
radius: 8,
|
||||
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({
|
||||
source: edges,
|
||||
style: function(f) {
|
||||
var style = new _ol_style_Style_({
|
||||
var style = new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: 'blue',
|
||||
width: 1
|
||||
@@ -73,7 +73,7 @@ var faces = new VectorSource({wrapX: false});
|
||||
var facesLayer = new VectorLayer({
|
||||
source: faces,
|
||||
style: function(f) {
|
||||
var style = new _ol_style_Style_({
|
||||
var style = new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: 'black',
|
||||
width: 1
|
||||
|
||||
@@ -9,7 +9,7 @@ import VectorSource from '../src/ol/source/Vector.js';
|
||||
import XYZ from '../src/ol/source/XYZ.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.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';
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ var layer = '0';
|
||||
var esrijsonFormat = new EsriJSON();
|
||||
|
||||
var styleCache = {
|
||||
'ABANDONED': new _ol_style_Style_({
|
||||
'ABANDONED': new Style({
|
||||
fill: new _ol_style_Fill_({
|
||||
color: 'rgba(225, 225, 225, 255)'
|
||||
}),
|
||||
@@ -29,7 +29,7 @@ var styleCache = {
|
||||
width: 0.4
|
||||
})
|
||||
}),
|
||||
'GAS': new _ol_style_Style_({
|
||||
'GAS': new Style({
|
||||
fill: new _ol_style_Fill_({
|
||||
color: 'rgba(255, 0, 0, 255)'
|
||||
}),
|
||||
@@ -38,7 +38,7 @@ var styleCache = {
|
||||
width: 0.4
|
||||
})
|
||||
}),
|
||||
'OIL': new _ol_style_Style_({
|
||||
'OIL': new Style({
|
||||
fill: new _ol_style_Fill_({
|
||||
color: 'rgba(56, 168, 0, 255)'
|
||||
}),
|
||||
@@ -47,7 +47,7 @@ var styleCache = {
|
||||
width: 0
|
||||
})
|
||||
}),
|
||||
'OILGAS': new _ol_style_Style_({
|
||||
'OILGAS': new Style({
|
||||
fill: new _ol_style_Fill_({
|
||||
color: 'rgba(168, 112, 0, 255)'
|
||||
}),
|
||||
|
||||
@@ -6,7 +6,7 @@ import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.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';
|
||||
|
||||
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) {
|
||||
var geometry = feature.getGeometry();
|
||||
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_({
|
||||
color: 'rgba(255, 255, 255, 0.6)'
|
||||
}),
|
||||
|
||||
@@ -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_Fill_ from '../src/ol/style/Fill.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';
|
||||
|
||||
var openSansAdded = false;
|
||||
@@ -128,7 +128,7 @@ var createTextStyle = function(feature, resolution, dom) {
|
||||
|
||||
// Polygons
|
||||
function polygonStyleFunction(feature, resolution) {
|
||||
return new _ol_style_Style_({
|
||||
return new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: 'blue',
|
||||
width: 1
|
||||
@@ -151,7 +151,7 @@ var vectorPolygons = new VectorLayer({
|
||||
|
||||
// Lines
|
||||
function lineStyleFunction(feature, resolution) {
|
||||
return new _ol_style_Style_({
|
||||
return new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: 'green',
|
||||
width: 2
|
||||
@@ -171,7 +171,7 @@ var vectorLines = new VectorLayer({
|
||||
|
||||
// Points
|
||||
function pointStyleFunction(feature, resolution) {
|
||||
return new _ol_style_Style_({
|
||||
return new Style({
|
||||
image: new _ol_style_Circle_({
|
||||
radius: 10,
|
||||
fill: new _ol_style_Fill_({color: 'rgba(255, 0, 0, 0.1)'}),
|
||||
|
||||
@@ -5,11 +5,11 @@ import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import _ol_style_Fill_ from '../src/ol/style/Fill.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';
|
||||
|
||||
|
||||
var style = new _ol_style_Style_({
|
||||
var style = new Style({
|
||||
fill: new _ol_style_Fill_({
|
||||
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_({
|
||||
color: '#f00',
|
||||
width: 1
|
||||
|
||||
@@ -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_Fill_ from '../src/ol/style/Fill.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 styles = {
|
||||
'amenity': {
|
||||
'parking': new _ol_style_Style_({
|
||||
'parking': new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: 'rgba(170, 170, 170, 1.0)',
|
||||
width: 1
|
||||
@@ -28,7 +28,7 @@ var styles = {
|
||||
})
|
||||
},
|
||||
'building': {
|
||||
'.*': new _ol_style_Style_({
|
||||
'.*': new Style({
|
||||
zIndex: 100,
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: 'rgba(246, 99, 79, 1.0)',
|
||||
@@ -40,13 +40,13 @@ var styles = {
|
||||
})
|
||||
},
|
||||
'highway': {
|
||||
'service': new _ol_style_Style_({
|
||||
'service': new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: 'rgba(255, 255, 255, 1.0)',
|
||||
width: 2
|
||||
})
|
||||
}),
|
||||
'.*': new _ol_style_Style_({
|
||||
'.*': new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: 'rgba(255, 255, 255, 1.0)',
|
||||
width: 3
|
||||
@@ -54,7 +54,7 @@ var styles = {
|
||||
})
|
||||
},
|
||||
'landuse': {
|
||||
'forest|grass|allotments': new _ol_style_Style_({
|
||||
'forest|grass|allotments': new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: 'rgba(140, 208, 95, 1.0)',
|
||||
width: 1
|
||||
@@ -65,7 +65,7 @@ var styles = {
|
||||
})
|
||||
},
|
||||
'natural': {
|
||||
'tree': new _ol_style_Style_({
|
||||
'tree': new Style({
|
||||
image: new _ol_style_Circle_({
|
||||
radius: 2,
|
||||
fill: new _ol_style_Fill_({
|
||||
|
||||
@@ -8,13 +8,13 @@ import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
import BingMaps from '../src/ol/source/BingMaps.js';
|
||||
import VectorSource from '../src/ol/source/Vector.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 vector = new VectorLayer({
|
||||
source: vectorSource,
|
||||
style: new _ol_style_Style_({
|
||||
style: new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: 'rgba(0, 0, 255, 1.0)',
|
||||
width: 2
|
||||
|
||||
@@ -7,7 +7,7 @@ import _ol_loadingstrategy_ from '../src/ol/loadingstrategy.js';
|
||||
import BingMaps from '../src/ol/source/BingMaps.js';
|
||||
import VectorSource from '../src/ol/source/Vector.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({
|
||||
@@ -24,7 +24,7 @@ var vectorSource = new VectorSource({
|
||||
|
||||
var vector = new VectorLayer({
|
||||
source: vectorSource,
|
||||
style: new _ol_style_Style_({
|
||||
style: new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: 'rgba(0, 0, 255, 1.0)',
|
||||
width: 2
|
||||
|
||||
Reference in New Issue
Block a user