Symbolizer defaults for the select renderIntent
This commit is contained in:
@@ -116,10 +116,20 @@ ol.style.Fill.prototype.setOpacity = function(opacity) {
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{fillColor: (string),
|
||||
* fillOpacity: (number)}}
|
||||
* @typedef {{color: (string),
|
||||
* opacity: (number)}}
|
||||
*/
|
||||
ol.style.FillDefaults = {
|
||||
color: '#ffffff',
|
||||
opacity: 0.4
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{color: (string),
|
||||
* opacity: (number)}}
|
||||
*/
|
||||
ol.style.FillDefaultsSelect = {
|
||||
color: '#ffffff',
|
||||
opacity: 0.7
|
||||
};
|
||||
|
||||
@@ -158,12 +158,24 @@ ol.style.Stroke.prototype.setWidth = function(width) {
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{strokeColor: (string),
|
||||
* strokeOpacity: (number),
|
||||
* strokeWidth: (number)}}
|
||||
* @typedef {{color: (string),
|
||||
* opacity: (number),
|
||||
* width: (number)}}
|
||||
*/
|
||||
ol.style.StrokeDefaults = {
|
||||
color: '#696969',
|
||||
opacity: 0.75,
|
||||
width: 1.5
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{color: (string),
|
||||
* opacity: (number),
|
||||
* width: (number)}}
|
||||
*/
|
||||
ol.style.StrokeDefaultsSelect = {
|
||||
color: '#696969',
|
||||
opacity: 0.9,
|
||||
width: 2.0
|
||||
};
|
||||
|
||||
@@ -67,6 +67,19 @@ ol.style.Style.prototype.createLiterals = function(feature) {
|
||||
* @type {ol.style.Style}
|
||||
*/
|
||||
ol.style.Style.defaults = new ol.style.Style({
|
||||
rules: [
|
||||
new ol.style.Rule({
|
||||
filter: 'renderIntent("select")',
|
||||
symbolizers: [
|
||||
new ol.style.Shape({
|
||||
fill: new ol.style.Fill(ol.style.FillDefaultsSelect),
|
||||
stroke: new ol.style.Stroke(ol.style.StrokeDefaultsSelect)
|
||||
}),
|
||||
new ol.style.Fill(ol.style.FillDefaultsSelect),
|
||||
new ol.style.Stroke(ol.style.StrokeDefaultsSelect)
|
||||
]
|
||||
})
|
||||
],
|
||||
symbolizers: [
|
||||
new ol.style.Shape({
|
||||
fill: new ol.style.Fill(),
|
||||
|
||||
Reference in New Issue
Block a user