GULERTOLGA / tile_crawler

A Flutter package that downloads map tiles for offline using
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

Unable to download #2

Open jesussmile opened 1 year ago

jesussmile commented 1 year ago

so, this is the code , trying to download openstreetmap in x y z

  TileCrawler crawler = TileCrawler(DownloadOptions(
        tileUrlFormat: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
        topLeft: LatLng(latitude: 30.448027, longitude: 80.058577),
        bottomRight: LatLng(latitude: 26.347162, longitude: 88.194040),
        minZoomLevel: 10,
        downloadFolder: dir.path,
        client: HttpClient(),
        maxZoomLevel: 19));
    print(dir.path);

I get this error

Reloaded 1 of 1004 libraries in 633ms (compile: 50 ms, reload: 295 ms, reassemble: 274 ms).
Restarted application in 2,197ms.
flutter: /Users/pannam/Library/Containers/com.example.example/Data/Documents
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: FormatException: %7Bs%7D.tile.openstreetmap.org is not a valid link-local address but contains %. Scope id should be used as part of link-local address. (at character 1)
%7Bs%7D.tile.openstreetmap.org
^

#0      _NativeSocket.escapeLinkLocalAddress (dart:io-patch/socket_patch.dart:582:9)
#1      _NativeSocket.startConnect (dart:io-patch/socket_patch.dart:694:14)
#2      _RawSocket.startConnect (dart:io-patch/socket_patch.dart:1877:26)
#3      RawSocket.startConnect (dart:io-patch/socket_patch.dart:27:23)
#4      RawSecureSocket.startConnect (dart:io/secure_socket.dart:297:22)
#5      SecureSocket.startConnect (dart:io/secure_socket.dart:77:28)
#6      _ConnectionTarget.connect (dart:_http/http_impl.dart:2482:26)
#7      _HttpClient._getConnection.connect (dart:_http/http_impl.dart:2924:12)
#8      _HttpClient._getConnection (dart:_http/http_impl.dart:2929:12)
#9      _HttpClient._openUrl (dart:_http/http_impl.dart:2784:12)
#10     _HttpClient.getUrl (dart:_http/http_impl.dart:2627:48)
#11     TileCrawler._downloadCurrent (package:tile_crawler/tile_crawler.dart:99:42)
#12     TileCrawler.download (package:tile_crawler/tile_crawler.dart:38:13)
#13     _MyHomePageState._incrementCounter (package:example/main.dart:56:13)
<asynchronous suspension>
jesussmile commented 1 year ago

can you provide a working link of a tile address ?