getTileUrl method

String getTileUrl(
  1. Coords<num> coords,
  2. TileLayerOptions options
)

Implementation

String getTileUrl(Coords coords, TileLayerOptions options) {
  var urlTemplate = (options.wmsOptions != null)
      ? options.wmsOptions!
          .getUrl(coords, options.tileSize.toInt(), options.retinaMode)
      : options.urlTemplate;

  var z = _getZoomForUrl(coords, options);

  var data = <String, String>{
    'x': coords.x.round().toString(),
    'y': coords.y.round().toString(),
    'z': z.round().toString(),
    's': getSubdomain(coords, options),
    'r': '@2x',
  };
  if (options.tms) {
    data['y'] = invertY(coords.y.round(), z.round()).toString();
  }
  var allOpts = Map<String, String>.from(data)
    ..addAll(options.additionalOptions);
  return options.templateFunction(urlTemplate!, allOpts);
}