Skip to content

Commit

Permalink
(wip) Fix test issue
Browse files Browse the repository at this point in the history
  • Loading branch information
adube committed Apr 25, 2016
1 parent 9fd0ed5 commit 03d32f7
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions src/ol-ext/format/featurehash.js
Original file line number Diff line number Diff line change
Expand Up @@ -647,9 +647,28 @@ ngeo.format.FeatureHash.setStyleInFeature_ = function(text, feature) {
ngeo.format.FeatureHash.setStyleProperties_ = function(text, feature) {

var properties = ngeo.format.FeatureHash.getStyleProperties_(text, feature);
var geometry = feature.getGeometry();
var clone = {};

// convert legacy properties
// Deal with legacy properties
if (geometry instanceof ol.geom.Point) {
if (properties['isLabel'] ||
properties[ngeo.FeatureProperties.IS_TEXT]) {
delete properties['strokeColor'];
delete properties['fillColor'];
} else {
delete properties['fontColor'];
}
} else {
delete properties['fontColor'];

if (geometry instanceof ol.geom.LineString) {
delete properties['fillColor'];
delete properties['fillOpacity'];
}
}

// Convert legacy properties
for (var key in properties) {
var value = properties[key];
if (ngeo.format.FeatureHashLegacyProperties_[key]) {
Expand All @@ -660,7 +679,6 @@ ngeo.format.FeatureHash.setStyleProperties_ = function(text, feature) {
}

feature.setProperties(clone);

};


Expand All @@ -678,7 +696,6 @@ ngeo.format.FeatureHash.setStyleProperties_ = function(text, feature) {
ngeo.format.FeatureHash.getStyleProperties_ = function(text, feature) {
var parts = text.split('\'');
var properties = {};
var geometry = feature.getGeometry();

var numProperties = [
ngeo.FeatureProperties.ANGLE,
Expand Down Expand Up @@ -715,18 +732,6 @@ ngeo.format.FeatureHash.getStyleProperties_ = function(text, feature) {
}
}

if (geometry instanceof ol.geom.Point) {
if (properties['isLabel'] ||
properties[ngeo.FeatureProperties.IS_TEXT]) {
delete properties['strokeColor'];
delete properties['fillColor'];
} else {
delete properties['fontColor'];
}
} else {
delete properties['fontColor'];
}

return properties;
};

Expand Down

0 comments on commit 03d32f7

Please sign in to comment.