@Deprecated // use GridSetBroker(Collections.singletonList(new DefaultGridset(useEPSG900913, // boolean useGWC11xNames))) public GridSetBroker(boolean useEPSG900913, boolean useGWC11xNames) { configurations = new LinkedList<>(); defaults = new DefaultGridsets(useEPSG900913, useGWC11xNames); configurations.add(defaults); }
public GridSet getWorldEpsg4326() { // get the internal default. We need it's name, if nothing else. final GridSet internalDefault4326GridSet = getDefaults().worldEpsg4326(); // get the name of the internal default as it may not always be "EPSG:4326" final String internalDefault4326Name = internalDefault4326GridSet.getName(); // Use the highest priority EPSG:4326 gridset we have (either an overriden one, or the // defaults) Optional<GridSet> gridSet = getGridSet(internalDefault4326Name); if (gridSet.isPresent()) { return gridSet.get(); } // probably won't ever hit this, but if 4326 isn't in the configuration at this point, just // return the internal // defaults. return internalDefault4326GridSet; }
/** @return the names of the gridsets that are internally defined */ public Set<String> getEmbeddedNames() { return defaults.getGridSetNames(); }
final DefaultGridsets defaultGridSets = new DefaultGridsets(true, true); gridSetBroker = new GridSetBroker(Arrays.asList(defaultGridSets)); config2.setGridSetBroker(gridSetBroker); assertEquals(override4326, worldEpsg4326); GridSet internal4326 = defaultGridSets.worldEpsg4326();
+ "over the vertical axis and each subsequent zoom level is calculated by half " + "the resolution of its previous one."); addInternal(WORLD_EPSG4326); BoundingBox.WORLD3857, false, commonPractice900913Resolutions(), null, 1.0D, addInternal(WORLD_EPSG3857); BoundingBox.WORLD4326, true, scalesCRS84PixelResolutions(), null, null, addInternal(GlobalCRS84Pixel); true, null, scalesCRS84ScaleDenominators(), null, GridSetFactory.DEFAULT_PIXEL_SIZE_METER, addInternal(GlobalCRS84Scale); true,
GridSetBroker gridSetBroker = new GridSetBroker(); gridSetBroker.setApplicationContext(extensions.getMockContext()); DefaultGridsets defaultGridsets = new DefaultGridsets(true, true); extensions.addBean( "DefaultGridSets", ((XMLConfiguration) config).setGridSetBroker(gridSetBroker); config.afterPropertiesSet(); defaultGridsets.afterPropertiesSet(); gridSetBroker.afterPropertiesSet(); return config;
@Override protected GridSetConfiguration getConfig() throws Exception { return new DefaultGridsets(true, true); }
@Override public List<GridSetConfiguration> getGridSetConfigurations() { return Arrays.asList(new DefaultGridsets(true, true), config); }
/** List containing a DefaultGridsets and a MockGridSetConfiguration */ public static List<GridSetConfiguration> withDefaults( boolean useEPSG900913, boolean useGWC11xNames, GridSet... mocks) { return Arrays.asList( new DefaultGridsets(useEPSG900913, useGWC11xNames), new MockGridSetConfiguration(mocks)); }
/** List containing a DefaultGridsets and a MockGridSetConfiguration */ public static List<GridSetConfiguration> withDefaults(GridSet... mocks) { return Arrays.asList(new DefaultGridsets(true, true), new MockGridSetConfiguration(mocks)); }
private XMLConfiguration loadConfig(String fileName) throws Exception { try (InputStream is = XMLConfiguration.class.getResourceAsStream(fileName); ) { Node root = XMLConfiguration.loadDocument(is); print(root.getOwnerDocument()); } XMLConfiguration xmlConfig = new XMLConfiguration( null, new MockConfigurationResourceProvider( () -> XMLConfiguration.class.getResourceAsStream(fileName))); GridSetBroker gsb = new GridSetBroker(Arrays.asList(new DefaultGridsets(true, true), xmlConfig)); xmlConfig.setGridSetBroker(gsb); xmlConfig.afterPropertiesSet(); Iterator<TileLayer> iter = xmlConfig.getLayers().iterator(); while (iter.hasNext()) { TileLayer layer = iter.next(); layer.initialize(gsb); } return xmlConfig; }
context.addBean( "DefaultGridsets", new DefaultGridsets(true, true), DefaultGridsets.class, GridSetConfiguration.class,
new GridSetBroker( Arrays.asList( new DefaultGridsets(true, true), (GridSetConfiguration) config2)); config2.setGridSetBroker(gridSetBroker2); config2.afterPropertiesSet();
new DefaultGridsets(true, true), GridSetConfiguration.class, DefaultGridsets.class);
@Test public void testDefaultMercatorGridSet() throws Exception { // setup GridSet defaults that use legacy names (i.e. use EPSG:######) final DefaultGridsets defaultGridSets = new DefaultGridsets(false, true); // create a GirdSetBroker with the defaults final GridSetBroker broker = new GridSetBroker(Arrays.asList(defaultGridSets)); // make sure EPSG:3857 is available and is the mercator default GridSet epsg3857GridSet = broker.get("EPSG:3857"); assertNotNull("GridSetBroker missing EPSG:3857 GridSet", epsg3857GridSet); // make sure GoogleMapsCompatible is NOT in the defaults GridSet googleMapsCompatible = broker.get("GoogleMapsCompatible"); assertNull("Unexpected GoogleMapsCompatible GridSet found", googleMapsCompatible); // make sure EPSG:900913 is NOT in the defaults GridSet epsg900913GridSet = broker.get("EPSG:900913"); assertNull("Unexpected EPSG:900913 GridSet found", epsg900913GridSet); // get the default mercator gridset and make sure it matches the EPSG:3857 gridset GridSet defaultMercatorGridSet = broker.getWorldEpsg3857(); assertNotNull("GridSetBroker missing default mercator GridSet", defaultMercatorGridSet); assertEquals( "Unexpected default mercator GridSet", epsg3857GridSet, defaultMercatorGridSet); }
final DefaultGridsets defaultGridSets = new DefaultGridsets(false, false);