Skip to content
Snippets Groups Projects
Commit 6d342247 authored by zksx's avatar zksx
Browse files

fix bug when a default property is given, global map is now showing diffrent...

fix bug when a default property is given, global map is now showing diffrent styles for different features
parent 0feda6e1
Branches
No related tags found
No related merge requests found
......@@ -29,8 +29,8 @@ class LineSegment{
// default Path style applied if nothing matches
var defaultStyle = {
stroke: true,
color: "#03f",
weight: 5,
color: "#000",
weight: 1,
opacity: 1,
fillOpacity: 1,
fillColor: '#03f',
......@@ -269,25 +269,30 @@ L.SLDStyler = L.Class.extend({
isFilterMatch: function(filter, properties) {
if (filter) {
var operator = filter.operator == null || filter.operator == 'and' ? 'every' : 'some';
if(filter.comparisions.length <= 0){
return false;
}
return filter.comparisions[operator](function(comp) {
var property = properties[comp.property.toLowerCase()];
if (comp.operator == '==') {
return properties[comp.property] == comp.literal;
return property == comp.literal;
} else if (comp.operator == '!=') {
return properties[comp.property] != comp.literal;
return property != comp.literal;
} else if (comp.operator == '<') {
return properties[comp.property] < comp.literal;
return property < comp.literal;
} else if (comp.operator == '>') {
return properties[comp.property] > comp.literal;
return property > comp.literal;
} else if (comp.operator == '<=') {
return properties[comp.property] <= comp.literal;
return property <= comp.literal;
} else if (comp.operator == '>=') {
return properties[comp.property] >= comp.literal;
return property >= comp.literal;
} else {
console.error('Unknown comparision operator', comp.operator);
}
});
} else
} else{
return true;
}
},
matchFn: function (featureTypeStyle, feature) {
var matchingRule = null;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment