Skip to content

Commit

Permalink
Merge pull request mapfish#515 from mapfish/png_svg
Browse files Browse the repository at this point in the history
Fix PNG in SVG layer
  • Loading branch information
Patrick Valsecchi authored Apr 3, 2017
2 parents f8d132d + ee04c29 commit 43e80f6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ dependencies {
compile ('org.apache.xmlgraphics:batik-transcoder:1.7'){
exclude module: 'fop'
}
compile ('org.apache.xmlgraphics:batik-codec:1.7')
providedCompile('com.google.code.findbugs:jsr305:2.0.1')

providedCompile('javax.servlet:servlet-api:2.5')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import org.mapfish.print.config.Configuration;
import org.mapfish.print.http.AbstractMfClientHttpRequestFactoryWrapper;
import org.mapfish.print.http.MfClientHttpRequestFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpMethod;
import org.springframework.http.client.ClientHttpRequest;

Expand All @@ -32,6 +34,7 @@
* [[examples=http_processors,osm_custom_params]]
*/
public final class MapUriProcessor extends AbstractClientHttpRequestFactoryProcessor {
private static final Logger LOGGER = LoggerFactory.getLogger(MapUriProcessor.class);
private final Map<Pattern, String> uriMapping = Maps.newHashMap();

/**
Expand Down Expand Up @@ -61,12 +64,15 @@ protected ClientHttpRequest createRequest(final URI uri,
for (Map.Entry<Pattern, String> entry : MapUriProcessor.this.uriMapping.entrySet()) {
Matcher matcher = entry.getKey().matcher(uriString);
if (matcher.matches()) {
LOGGER.debug("URI {} matched {}", uriString, entry.getKey());
final String finalUri = matcher.replaceAll(entry.getValue());
try {
return requestFactory.createRequest(new URI(finalUri), httpMethod);
} catch (URISyntaxException e) {
throw ExceptionUtils.getRuntimeException(e);
}
} else {
LOGGER.debug("URI {} did not match {}", uriString, entry.getKey());
}
}
return requestFactory.createRequest(uri, httpMethod);
Expand Down

0 comments on commit 43e80f6

Please sign in to comment.