getTileUrl method

String getTileUrl(
  1. TileCoordinates coordinates,
  2. TileLayer options
)
inherited

Generate a primary URL for a tile, based on its coordinates and the TileLayer


When creating a specialized TileProvider, prefer overriding URL generation related methods in the following order:

  1. populateTemplatePlaceholders
  2. generateReplacementMap
  3. getTileUrl and/or getTileFallbackUrl

Note to implementors: it is not safe to assume that at least one of wmsOptions or urlTemplate will be non-null.

Implementation

String getTileUrl(TileCoordinates coordinates, TileLayer options) =>
    populateTemplatePlaceholders(
      options.wmsOptions?.getUrl(
            coordinates,
            options.tileSize.toInt(),
            options.resolvedRetinaMode == RetinaMode.simulation,
          ) ??
          options.urlTemplate ??
          (throw ArgumentError(
              '`wmsOptions` or `urlTemplate` must be provided to generate a tile URL')),
      coordinates,
      options,
    );