Search in sources :

Example 1 with WebMapTileClient

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;
}
Also used : GenericName(org.opengis.util.GenericName) TiledResource(org.geotoolkit.storage.multires.TiledResource) MapLayer(org.apache.sis.portrayal.MapLayer) Resource(org.apache.sis.storage.Resource) TiledResource(org.geotoolkit.storage.multires.TiledResource) WebMapTileClient(org.geotoolkit.wmts.WebMapTileClient) URL(java.net.URL) DefaultStyleFactory(org.geotoolkit.style.DefaultStyleFactory) MapLayers(org.apache.sis.portrayal.MapLayers)

Aggregations

URL (java.net.URL)1 MapLayer (org.apache.sis.portrayal.MapLayer)1 MapLayers (org.apache.sis.portrayal.MapLayers)1 Resource (org.apache.sis.storage.Resource)1 TiledResource (org.geotoolkit.storage.multires.TiledResource)1 DefaultStyleFactory (org.geotoolkit.style.DefaultStyleFactory)1 WebMapTileClient (org.geotoolkit.wmts.WebMapTileClient)1 GenericName (org.opengis.util.GenericName)1