コード例 #1
0
  /**
   * Creates a cached tile layer from the given Layer Group
   *
   * @param info the layer group to cache
   * @param defaults default configuration
   */
  public static GeoServerTileLayerInfoImpl loadOrCreate(
      final LayerGroupInfo groupInfo, final GWCConfig defaults) {

    GeoServerTileLayerInfoImpl info = LegacyTileLayerInfoLoader.load(groupInfo);
    if (info == null) {
      info = create(defaults);
      checkAutomaticStyles(groupInfo, info);
    }
    info.setName(tileLayerName(groupInfo));
    info.setId(groupInfo.getId());
    return info;
  }
コード例 #2
0
  /**
   * Creates a cached tile layer from the given Layer
   *
   * @param info the layer to cache
   * @param defaults default configuration
   */
  public static GeoServerTileLayerInfoImpl loadOrCreate(
      final LayerInfo layerInfo, final GWCConfig defaults) {
    GeoServerTileLayerInfoImpl info = LegacyTileLayerInfoLoader.load(layerInfo);
    if (info == null) {
      info = create(defaults);
      final ResourceInfo resource = layerInfo.getResource();
      if (resource instanceof FeatureTypeInfo) {
        info.getMimeFormats().clear();
        info.getMimeFormats().addAll(defaults.getDefaultVectorCacheFormats());
      } else if (resource instanceof CoverageInfo) {
        info.getMimeFormats().clear();
        info.getMimeFormats().addAll(defaults.getDefaultCoverageCacheFormats());
      }

      checkAutomaticStyles(layerInfo, info);
    }
    info.setName(tileLayerName(layerInfo));
    info.setId(layerInfo.getId());
    return info;
  }