Package org.locationtech.udig.catalog.internal.wmt.wmtsource

Examples of org.locationtech.udig.catalog.internal.wmt.wmtsource.WMTSource


    }
    //endregion
   
    //region Updates to the GUI when another layer was selected
    private void updateZoomLevels() {
        WMTSource wmtSource = getWMTSourceOfSelectedLayer();
       
        if (wmtSource == null) {
            cvZoomLevels.setInput(null);
        } else {
            int minZoomLevel = wmtSource.getMinZoomLevel();
            int maxZoomLevel = wmtSource.getMaxZoomLevel();
           
            generateZoomLevels(minZoomLevel, maxZoomLevel);
           
            cvZoomLevels.setInput(zoomLevels);
        }
View Full Code Here


    //endregion
   
    //region Updates to the GUI regarding the scale
    private void updateGUIFromScale() {
        try {
            WMTSource wmtSource = getWMTSourceOfSelectedLayer();

            if (wmtSource != null) {
                // get the zoom-level for this scale
                WMTScaleZoomLevelMatcher zoomLevelMatcher = getZoomLevelMatcher(wmtSource);

                int zoomLevel = wmtSource.getZoomLevelFromMapScale(zoomLevelMatcher,
                        WMTRenderJob.getScaleFactor());

                setSelectedZoomLevel(zoomLevel);
                updateZoomButtons(zoomLevel);
            } else {
View Full Code Here

       
        IGeoResource resource = layer.findGeoResource(WMTSource.class);
        if (resource == null) return null;
       
        try {
            WMTSource wmtSource = resource.resolve(WMTSource.class, null);
           
            return wmtSource;
        } catch (IOException e) {
            return null;
        }
View Full Code Here

        }
    }
   
    private void zoomToZoomLevel(int zoomLevel) {
        try {
            WMTSource wmtSource = getWMTSourceOfSelectedLayer();
           
            if (wmtSource != null) {               
                WMTScaleZoomLevelMatcher zoomLevelMatcher = getZoomLevelMatcher(wmtSource);
                double scale = zoomLevelMatcher.getOptimumScaleFromZoomLevel(zoomLevel,
                        wmtSource);
View Full Code Here

            layer = getContext().getLayer();
            // assume everything will work fine
            layer.setStatus(ILayer.DONE);
            layer.setStatusMessage(""); //$NON-NLS-1$

            WMTSource wmtSource = getWmtSourceFromLayer(layer);

            if (wmtSource == null)
                throw new UnsupportedOperationException(Messages.Render_Error_NoSource);

            // Layer properties
            WMTLayerProperties layerProperties = new WMTLayerProperties((StyleBlackboard) layer
                    .getStyleBlackboard());

            // Get map extent, which should be drawn
            ReferencedEnvelope mapExtent = getRenderBounds();
            if (mapExtent == null) {
                mapExtent = context.getViewportModel().getBounds();
            }

            // Scale
            double scale = getContext().getViewportModel().getScaleDenominator();
            WMTPlugin.trace("[BasicWMTRender.render] Scale: " + scale); //$NON-NLS-1$
           
            WMTRenderJob renderJob = null;
            try {
                renderJob = WMTRenderJob.createRenderJob(mapExtent, scale, wmtSource);
            } catch (Exception exc) {
                throw new UnsupportedOperationException(Messages.Render_Error_Projection);
            }
           
            int tileLimitWarning = WMTRenderJob.getTileLimitWarning();
            // Find tiles
            Map<String, Tile> tileList = wmtSource.cutExtentIntoTiles(renderJob,
                    WMTRenderJob.getScaleFactor(), false, layerProperties, tileLimitWarning);

            // if we have nothing to display, return
            if (tileList.isEmpty()) {
                throw new UnsupportedOperationException(Messages.Render_Error_NoData);
View Full Code Here

   
    private WMTSource getWmtSourceFromLayer(ILayer layer) {
        IGeoResource resource = layer.findGeoResource(WMTSource.class);
       
        if (resource != null) {
            WMTSource wmtSource = null;
            try {           
                wmtSource = resource.resolve(WMTSource.class, null);
               
                return wmtSource;
            } catch (Exception e) {}
View Full Code Here

TOP

Related Classes of org.locationtech.udig.catalog.internal.wmt.wmtsource.WMTSource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.