CustomTile constructor

CustomTile({
  1. required List<TileURLs> urlsServers,
  2. required String tileExtension,
  3. required String sourceName,
  4. int tileSize = 256,
  5. int minZoomLevel = 2,
  6. int maxZoomLevel = 19,
  7. MapEntry<String, String>? keyApi,
})

Implementation

CustomTile({
  required this.urlsServers,
  required this.tileExtension,
  required this.sourceName,
  this.tileSize = 256,
  this.minZoomLevel = 2,
  this.maxZoomLevel = 19,
  this.keyApi,
})  : assert(urlsServers.isNotEmpty),
      assert(
        urlsServers.where((element) => element.url.isEmpty).isEmpty,
      ),
      assert([128, 256, 512, 1024].contains(tileSize)),
      assert(minZoomLevel < maxZoomLevel),
      assert(minZoomLevel >= 2 && minZoomLevel < maxZoomLevel),
      assert(maxZoomLevel > minZoomLevel && maxZoomLevel > 0),
      assert(
        keyApi == null || (keyApi.key.isNotEmpty && keyApi.value.isNotEmpty),
        "if your own server use key access,you should provide the right key name and key api",
      );