getTileUrl method
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:
populateTemplatePlaceholders
generateReplacementMap
getTileUrl
and/orgetTileFallbackUrl
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,
);