Revision 5988d8ff
Added by Andreas Kohlbecker almost 8 years ago
cdmlib-ext/src/main/java/eu/etaxonomy/cdm/ext/geo/EditGeoServiceUtilities.java | ||
---|---|---|
72 | 72 |
|
73 | 73 |
private static IDefinedTermDao termDao; |
74 | 74 |
|
75 |
|
|
76 |
|
|
77 | 75 |
/** |
78 | 76 |
* @param termDao |
79 | 77 |
*/ |
... | ... | |
174 | 172 |
*/ |
175 | 173 |
boolean generateMultipleAreaDataParameters = false; |
176 | 174 |
|
177 |
/* |
|
178 |
* doNotReuseStyles is a workaround for a problem in the EDIT MapService, |
|
179 |
* see https://dev.e-taxonomy.eu/trac/ticket/2707#comment:24 |
|
180 |
* |
|
181 |
* a.kohlbecker 2014-07-02 :This bug in the map service has been |
|
182 |
* fixed now so reusing styles is now possible setting this flag to false. |
|
183 |
*/ |
|
184 |
boolean doNotReuseStyles = false; |
|
185 |
|
|
186 | 175 |
List<String> perLayerAreaData = new ArrayList<String>(); |
187 | 176 |
Map<Integer, String> areaStyles = new HashMap<Integer, String>(); |
188 | 177 |
List<String> legendSortList = new ArrayList<String>(); |
... | ... | |
258 | 247 |
Map<Integer, Set<Distribution>> styleMap = layerMap.get(layerString); |
259 | 248 |
for (int style: styleMap.keySet()){ |
260 | 249 |
// stylesPerLayer |
261 |
if(doNotReuseStyles) { |
|
262 |
if(!styleUsage.containsKey(style)){ |
|
263 |
styleUsage.put(style, 0); |
|
264 |
} else { |
|
265 |
// increment by 1 |
|
266 |
styleUsage.put(style, styleUsage.get(style) + 1); |
|
267 |
} |
|
268 |
Integer styleIncrement = styleUsage.get(style); |
|
269 |
if(styleIncrement > 0){ |
|
270 |
// style code has been used before! |
|
271 |
styleChar = getStyleAbbrev(style + styleIncrement + styleCounter); |
|
272 |
//for debugging sometimes failing test #3831 |
|
273 |
logger.warn("style: " + style + ", styleIncrement: " + styleIncrement + ", styleCounter: " + styleCounter); |
|
274 |
areaStyles.put(style + styleIncrement + styleCounter, areaStyles.get(style)); |
|
275 |
} else { |
|
276 |
styleChar = getStyleAbbrev(style); |
|
277 |
} |
|
278 |
} else { |
|
279 |
styleChar = getStyleAbbrev(style); |
|
280 |
} |
|
250 |
styleChar = getStyleAbbrev(style); |
|
281 | 251 |
Set<Distribution> distributionSet = styleMap.get(style); |
282 | 252 |
areasPerStyle = new ArrayList<String>(); |
283 | 253 |
for (Distribution distribution: distributionSet){ |
Also available in: Unified diff
#4149 workaround implemented for #2707 completely removed