Class OsmLayerParam


public final class OsmLayerParam extends AbstractTiledLayerParams
The parameters for configuration an OSM layer.
  • Field Details

    • baseURL

      public String baseURL
      The URL used for the tile requests.

      Supported formats:

      • The base part of the URL, for example 'http://tile.openstreetmap.org'. This results in an URL like 'http://tile.openstreetmap.org/12/123/456.png'.
      • An URL template with the placeholders '{x}', '{y}' or '{-y}', and '{z}'. For example: 'http://tile.openstreetmap.org/{z}/{x}/{y}.png'.
        The placeholder '{-y}' provides support for OSGeo TMS tiles.
    • maxExtent

      public double[] maxExtent
      The maximum extent of the osm layer. Must have 4 coordinates, minX, minY, maxX, maxY

      Default: [-20037508.34, -20037508.34, 20037508.34, 20037508.34]

    • tileSize

      public int[] tileSize
      The size of each tile. Must have 2 values: width, height

      Default: [256, 256]

    • resolutions

      public Double[] resolutions
      The allowed resolutions for this layer.
    • resolutionTolerance

      public double resolutionTolerance
      The amount of difference between a resolution and a target resolution to consider the two equal. The value is a value from 0-1.
    • dpi

      public Double dpi
      The DPI of the OSM tiles.
    • imageExtension

      public String imageExtension
      The image extension. for example png, jpeg, etc...
    • customParams

      public PObject customParams
      Custom query parameters to use when making http requests. customParams.

      The json should look something like:

      
       {
           "param1Name": "value",
           "param2Name": ["value1", "value2"]
       }
       
  • Constructor Details

    • OsmLayerParam

      public OsmLayerParam()
  • Method Details

    • convertToMultiMap

      public static com.google.common.collect.Multimap<String,String> convertToMultiMap(PObject objectParams)
      convert a param object to a multimap.
      Parameters:
      objectParams - the parameters to convert.
      Returns:
      the corresponding Multimap.
    • getCustomParams

      public com.google.common.collect.Multimap<String,String> getCustomParams()
      Read the customParams into a Multimap.
    • setCustomParam

      public void setCustomParam(String name, String value)
      Set a custom parameter.
      Parameters:
      name - the parameter name
      value - the parameter value
    • postConstruct

      public void postConstruct()
      Validate the properties have the correct values.
    • getMaxExtent

      public org.locationtech.jts.geom.Envelope getMaxExtent()
      Get the max extent as a envelop object.
    • getBaseUrl

      public String getBaseUrl()
      Description copied from class: AbstractTiledLayerParams
      Get the base url for all tile requests. For example it might be 'http://server .com/geoserver/gwc/service/wmts'.
      Specified by:
      getBaseUrl in class AbstractTiledLayerParams
    • getTileSize

      public Dimension getTileSize()
    • createCommonUrl

      public String createCommonUrl()
      Description copied from class: AbstractTiledLayerParams
      Create a URL that is common to all image requests for this layer. It will take the base url and append all mergeable and custom params to the base url.
      Specified by:
      createCommonUrl in class AbstractTiledLayerParams
    • validateBaseUrl

      public boolean validateBaseUrl()
      Description copied from class: AbstractTiledLayerParams
      Validates the provided base url.
      Specified by:
      validateBaseUrl in class AbstractTiledLayerParams
      Returns:
      True, if the url is valid.