private static void insertMaxFeatures( String layer, MapOptionsMaps options, MapOptions layerDefaults, MapOptions globalDefaults ) { if ( options.getMaxFeatures( layer ) == -1 ) { if ( layerDefaults != null ) { options.setMaxFeatures( layer, layerDefaults.getMaxFeatures() ); } if ( options.getMaxFeatures( layer ) == -1 ) { options.setMaxFeatures( layer, globalDefaults.getMaxFeatures() ); } } }
public MapOptionsMaps( Map<String, Quality> qualities, Map<String, Interpolation> interpolations, Map<String, Antialias> antialiases, Map<String, Integer> maxFeatures ) { options = new HashMap<String, MapOptions>(); for ( Entry<String, Quality> e : qualities.entrySet() ) { options.put( e.getKey(), new MapOptions( e.getValue(), null, null, -1, -1 ) ); } for ( Entry<String, Interpolation> e : interpolations.entrySet() ) { if ( options.get( e.getKey() ) != null ) { options.get( e.getKey() ).setInterpolation( e.getValue() ); } else { options.put( e.getKey(), new MapOptions( null, e.getValue(), null, -1, -1 ) ); } } for ( Entry<String, Antialias> e : antialiases.entrySet() ) { if ( options.get( e.getKey() ) != null ) { options.get( e.getKey() ).setAntialias( e.getValue() ); } else { options.put( e.getKey(), new MapOptions( null, null, e.getValue(), -1, -1 ) ); } } for ( Entry<String, Integer> e : maxFeatures.entrySet() ) { setMaxFeatures( e.getKey(), e.getValue() ); } }
LOG.debug( "Using global max features setting of {}.", max ); extensions.setMaxFeatures( l.getName(), max ); try { Integer val = Integer.valueOf( mfs[i] ); extensions.setMaxFeatures( cur.getName(), def == null ? val : min( def, val ) ); } catch ( NumberFormatException e ) { LOG.info( "The value '{}' for MAX_FEATURES can not be parsed as a number.", mfs[i] ); extensions.setMaxFeatures( cur.getName(), def == null ? 10000 : def ); try { Integer val = Integer.valueOf( mfs[i] ); extensions.setMaxFeatures( cur.getName(), def == null ? val : min( def, val ) ); } catch ( NumberFormatException e ) { LOG.info( "The value '{}' for MAX_FEATURES can not be parsed as a number.", mfs[i] ); extensions.setMaxFeatures( cur.getName(), def == null ? 10000 : def ); extensions.setMaxFeatures( cur.getName(), def == null ? 10000 : def );