All Implemented Interfaces:
Serializable
Direct Known Subclasses:
OSMSource

public class XYZSource extends TileImageSource
Source for loading tiled images from a map service using the Slippy Map tile numbering scheme, also known as XYZ format.

This is commonly used by OpenStreetMap, as well as other services who have adopted the OSM tile numbering scheme.

See Also:
  • Constructor Details

    • XYZSource

      public XYZSource()
    • XYZSource

      public XYZSource(XYZSource.Options options)
  • Method Details

    • getType

      public String getType()
      Description copied from class: AbstractConfigurationObject
      The unique type name of this class. Used by the client-side synchronization mechanism to determine which OpenLayers class to synchronize into.
      Specified by:
      getType in class AbstractConfigurationObject
    • getUrl

      public String getUrl()
      The URL template in XYZ format (see also Slippy map tilenames) used to load individual image tiles. The URL must include the x, y or -y, and z placeholders, where x and y identify the tile in the tile grid for the zoom level z.

      Example: https://a.tile.openstreetmap.org/{z}/{x}/{y}.png

      Overrides:
      getUrl in class UrlTileSource
      Returns:
      the URL template
    • setUrl

      public void setUrl(String url)
      Sets the URL template in XYZ format.
      Overrides:
      setUrl in class UrlTileSource
      Parameters:
      url - the new URL template