use of org.geotoolkit.wmts.WebMapTileClient in project geotoolkit by Geomatys.
the class WMTSClientDemo method createContext.
public static MapLayers createContext() throws Exception {
final MapLayers context = MapBuilder.createContext(CommonCRS.WGS84.normalizedGeographic());
final WebMapTileClient server = new WebMapTileClient(new URL("http://localhost:8080/constellation/WS/wmts/test"), WMTSVersion.v100);
for (final Resource ref : DataStores.flatten(server, false)) {
final GenericName n = ref.getIdentifier().get();
System.out.println(n);
final MapLayer layer = MapBuilder.createCoverageLayer(ref, new DefaultStyleFactory().style(StyleConstants.DEFAULT_RASTER_SYMBOLIZER));
TiledResource model = (TiledResource) ref;
System.out.println(model);
layer.setTitle(n.tip().toString());
context.getComponents().add(layer);
}
return context;
}
Aggregations