Mercurial > dive4elements > river
changeset 6705:f3d0aac478cd
issue766: Minimal fix for doubled RiverAxis.
Ceterum autem censeo river_wms esse delendam
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Mon, 29 Jul 2013 19:21:07 +0200 |
parents | ed9cff319479 |
children | 7e5122514b37 |
files | artifacts/src/main/java/org/dive4elements/river/artifacts/RiverAxisArtifact.java |
diffstat | 1 files changed, 17 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/RiverAxisArtifact.java Mon Jul 29 17:27:48 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/RiverAxisArtifact.java Mon Jul 29 19:21:07 2013 +0200 @@ -91,6 +91,10 @@ super(artifact); } + private boolean isUnofficial() { + return getIdPart(2) != null && !getIdPart(2).equals("1"); + } + @Override protected String getFacetType() { return FLOODMAP_RIVERAXIS; @@ -98,12 +102,24 @@ @Override protected String getLayer() { + if (isUnofficial()) { + return super.getLayer(); + } return RiverFactory.getRiver(getRiverId()).getName(); } @Override protected String getUrl() { - return RiverUtils.getRiverWMSUrl(); + String kind = getIdPart(2); + logger.debug("Andre get url of river axis " + kind); + + if (isUnofficial()) { + logger.debug("Returning as url: " + RiverUtils.getUserWMSUrl(artifact.identifier())); + + return RiverUtils.getUserWMSUrl(artifact.identifier()); + } else { + return RiverUtils.getRiverWMSUrl(); + } } @Override