Skip to content

Commit

Permalink
GEOS-7305 - Fix compilation with 1.8 source and target
Browse files Browse the repository at this point in the history
  • Loading branch information
bgsmase authored and aaime committed Nov 14, 2015
1 parent d23cc12 commit 4c7c6d8
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/kml/src/main/java/org/geoserver/kml/icons/IconService.java
@@ -1,4 +1,4 @@
/* (c) 2014 Open Source Geospatial Foundation - all rights reserved /* (c) 2014 - 2015 Open Source Geospatial Foundation - all rights reserved
* (c) 2001 - 2013 OpenPlans * (c) 2001 - 2013 OpenPlans
* This code is licensed under the GPL 2.0 license, available at the root * This code is licensed under the GPL 2.0 license, available at the root
* application directory. * application directory.
Expand All @@ -8,6 +8,7 @@
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.io.IOException; import java.io.IOException;
import java.util.Collections; import java.util.Collections;
import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
Expand Down Expand Up @@ -76,10 +77,20 @@ protected ModelAndView handleRequestInternal(
String q = request.getQueryString(); String q = request.getQueryString();
try { try {
Style style = styleInfo.getStyle(); Style style = styleInfo.getStyle();
Map<String,String> properties = Map<String,Object> properties =
q != null ? KvpUtils.parseQueryString("?"+q) : Collections.EMPTY_MAP; q != null ? KvpUtils.parseQueryString("?"+q) : Collections.EMPTY_MAP;
Map<String, String> kvp = new HashMap<String, String>();
for (String key : properties.keySet()) {
Object value = properties.get(key);
if (value instanceof String) {
kvp.put(key, (String) value);
} else {
String[] values = (String[]) value;
kvp.put(key, values[0]);
}
}


Style adjustedStyle = IconPropertyInjector.injectProperties(style, properties); Style adjustedStyle = IconPropertyInjector.injectProperties(style, kvp);


BufferedImage image = IconRenderer.renderIcon(adjustedStyle); BufferedImage image = IconRenderer.renderIcon(adjustedStyle);


Expand Down

0 comments on commit 4c7c6d8

Please sign in to comment.