All Implemented Interfaces:
Serializable, Evented, Identifiable, LayerPopupFunctions, LayerTooltipFunctions, ExecutableFunctions

public class TileLayer extends GridLayer
Used to load and display tile layers on the map. Note that most tile servers require attribution, which you can set under Layer. Extends GridLayer.
Since:
2020-03-06
Version:
1.0
Author:
Gabor Kokeny Email: kokeny19@gmail.com
See Also:
  • Constructor Details

    • TileLayer

      public TileLayer(String urlTemplate)
      Instantiates a tile layer object given a URL template and optionally an options object.
      Parameters:
      urlTemplate - the URL template of this tile layer
  • Method Details

    • getSubdomains

      public String[] getSubdomains()
      Returns the subdomains of the tile service.
      Returns:
      the subdomains
    • setSubdomains

      public void setSubdomains(String... subdomains)
      Subdomains of the tile service. Can be passed in the form of one string (where each letter is a subdomain name) or an array of strings.
      Parameters:
      subdomains - the subdomains to set
    • getErrorTileUrl

      public String getErrorTileUrl()
      Returns the URL of the tile image shown in place of tiles that fail to load.
      Returns:
      the errorTileUrl
    • setErrorTileUrl

      public void setErrorTileUrl(String errorTileUrl)
      URL to the tile image to show in place of the tile that failed to load.
      Parameters:
      errorTileUrl - the errorTileUrl to set
    • getZoomOffset

      public int getZoomOffset()
      Returns the offset applied to the zoom number used in tile URLs.
      Returns:
      the zoomOffset
    • setZoomOffset

      public void setZoomOffset(int zoomOffset)
      The zoom number used in tile URLs will be offset with this value.
      Parameters:
      zoomOffset - the zoomOffset to set
    • isTms

      public boolean isTms()
      Returns whether the Y axis numbering for tiles is inverted (TMS services).
      Returns:
      the tms
    • setTms

      public void setTms(boolean tms)
      If true, inverses Y axis numbering for tiles (turn this on for TMS services).
      Parameters:
      tms - the tms to set
    • isZoomReverse

      public boolean isZoomReverse()
      Returns whether the zoom number used in tile URLs is reversed.
      Returns:
      the zoomReverse
    • setZoomReverse

      public void setZoomReverse(boolean zoomReverse)
      If set to true, the zoom number used in tile URLs will be reversed (maxZoom - zoom instead of zoom)
      Parameters:
      zoomReverse - the zoomReverse to set
    • isDetectRetina

      public boolean isDetectRetina()
      Returns whether retina displays are detected to request higher resolution tiles.
      Returns:
      the detectRetina
    • setDetectRetina

      public void setDetectRetina(boolean detectRetina)
      If true and user is on a retina display, it will request four tiles of half the specified size and a bigger zoom level in place of one to utilize the high resolution.
      Parameters:
      detectRetina - the detectRetina to set
    • getCrossOrigin

      public String getCrossOrigin()
      Returns the crossOrigin attribute value applied to the tiles.
      Returns:
      the crossOrigin
    • setCrossOrigin

      public void setCrossOrigin(String crossOrigin)
      Whether the crossOrigin attribute will be added to the tiles. If a String is provided, all tiles will have their crossOrigin attribute set to the String provided. This is needed if you want to access tile pixel data. Refer to CORS Settings for valid String values.
      Parameters:
      crossOrigin - the crossOrigin to set
    • getUrlTemplate

      public String getUrlTemplate()
      Returns the URL template of this tile layer.
      Returns:
      the urlTemplate