Simplify basic vector layer example
This effectively reverts the changes introduced by 860aa9ff46.
This commit is contained in:
@@ -11,21 +11,6 @@ goog.require('ol.style.Style');
|
|||||||
goog.require('ol.style.Text');
|
goog.require('ol.style.Text');
|
||||||
|
|
||||||
|
|
||||||
var createPattern = function() {
|
|
||||||
var canvas = document.createElement('canvas');
|
|
||||||
var context = canvas.getContext('2d');
|
|
||||||
canvas.width = 4;
|
|
||||||
canvas.height = 4;
|
|
||||||
|
|
||||||
context.fillStyle = 'rgba(255,0,0,0.3)';
|
|
||||||
for (var i = 0; i < canvas.width; i++) {
|
|
||||||
context.fillRect(i, i, 1, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
return context.createPattern(canvas, 'repeat');
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
var style = new ol.style.Style({
|
var style = new ol.style.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)'
|
||||||
@@ -85,7 +70,7 @@ var featureOverlay = new ol.layer.Vector({
|
|||||||
width: 1
|
width: 1
|
||||||
}),
|
}),
|
||||||
fill: new ol.style.Fill({
|
fill: new ol.style.Fill({
|
||||||
color: createPattern()
|
color: 'rgba(255,0,0,0.1)'
|
||||||
}),
|
}),
|
||||||
text: new ol.style.Text({
|
text: new ol.style.Text({
|
||||||
font: '12px Calibri,sans-serif',
|
font: '12px Calibri,sans-serif',
|
||||||
|
|||||||
Reference in New Issue
Block a user