private GetLegendGraphicRequest runGetLegendGraphics(String requestURL) throws Exception { Map rawKvp = (Map) caseInsensitiveKvp(KvpUtils.parseQueryString(requestURL)); Map kvp = parseKvp(rawKvp); GetLegendGraphicKvpReader reader = new GetLegendGraphicKvpReader(getWMS()); GetLegendGraphicRequest request = reader.read(reader.createRequest(), kvp, rawKvp); legendProducer.buildLegendGraphic(request); this.lastRequest = request; return request; } }
public void testScaleDependent(String bboxSpecification, String expectedLabel) throws Exception { // around 4k String requestURL = "wms?service=WMS&version=1.1.1&request=GetLegendGraphic&format=image/png" + "&layer=" + getLayerId(SF_STATES) + "&style=scaleDependent&width=20&height=20&srs=EPSG:4326" // + "&bbox=" + bboxSpecification + "&legend_options=" + GetLegendGraphicRequest.COUNT_MATCHED_KEY + ":true" + "&srcwidht=768&srcheight=300"; Map rawKvp = (Map) caseInsensitiveKvp(KvpUtils.parseQueryString(requestURL)); Map kvp = parseKvp(rawKvp); GetLegendGraphicKvpReader reader = new GetLegendGraphicKvpReader(getWMS()); GetLegendGraphicRequest request = reader.read(reader.createRequest(), kvp, rawKvp); // run legendProducer.buildLegendGraphic(request); this.lastRequest = request; assertEquals(1, ruleSets.size()); Rule[] rules = ruleSets.get(0); logLabels(rules); assertEquals(1, rules.length); assertLabel(expectedLabel, rules[0]); }
+ "&CQL_FILTER=PERSONS < 2000000"; Map rawKvp = (Map) caseInsensitiveKvp(KvpUtils.parseQueryString(requestURL)); Map kvp = parseKvp(rawKvp); GetLegendGraphicKvpReader reader = new GetLegendGraphicKvpReader(getWMS());