liodali / osm_flutter

OpenStreetMap plugin for flutter
https://pub.dev/packages/flutter_osm_plugin
MIT License
240 stars 98 forks source link

Custom Layer Not Working Properly #480

Closed AntonLie closed 12 months ago

AntonLie commented 1 year ago

Hello, I tried to add a custom layer but seems not working.

Code

Screenshot 2023-11-22 at 19 45 31

Result

Screenshot 2023-11-22 at 19 46 21

Expectation

https://tile.opentopomap.org/#map=9/50.2244/17.0178

liodali commented 1 year ago

you should change the url to this

https://tile.opentopomap.org/{z}/{x}/{y}

you can check details on wiki.openstreetmap.org/wiki/OpenTopoMap

AntonLie commented 1 year ago

sorry, nothing change after i change url to https://tile.opentopomap.org/{z}/{x}/{y}

liodali commented 1 year ago

sorry try this :

CustomTile(
        sourceName: "opentopomap",
        tileExtension: ".png",
        minZoomLevel: 2,
        maxZoomLevel: 17
        urlsServers: [
          "https://a.tile.opentopomap.org/",
          "https://b.tile.opentopomap.org/",
          "https://c.tile.opentopomap.org/",
        ],
        tileSize: 256,
      )
AntonLie commented 1 year ago

Hello @liodali , I tried but still not working

cannot use only string because libs have type

Screenshot 2023-11-25 at 17 23 55
liodali commented 1 year ago

dont add /{z}/{x}/{y}.png to the url

AntonLie commented 1 year ago

ok done but still not working

here's my url

https://maps.geoapify.com/v1/tile/klokantech-basic?apiKey=

AntonLie commented 1 year ago
Screenshot 2023-11-25 at 17 40 15
liodali commented 1 year ago

ok done but still not working

here's my url

https://maps.geoapify.com/v1/tile/klokantech-basic?apiKey=

that url doesnt contain z,x,y do you have any docs link that i can check to help you more

AntonLie commented 1 year ago

this one bro @liodali https://apidocs.geoapify.com/

https://www.geoapify.com/map-tiles

so need z,x,y right?

liodali commented 1 year ago
CustomTile(
        sourceName: "geoapify",
        tileExtension: ".png",
        minZoomLevel: 2,
        maxZoomLevel: 19,
        urlsServers: [
          TileURLs(
            url: "https://maps.geoapify.com/v1/tile/osm-carto/",
          )
        ],
        tileSize: 256,
        keyApi: MapEntry(
          "apiKey",
         YOURKEY,
        ),
      )
AntonLie commented 1 year ago

Still not changed bro

Screenshot 2023-11-26 at 00 02 29
liodali commented 12 months ago

i will do a quick fix to night sorry for being late to fix it

liodali commented 12 months ago

check version 0.70.3

AntonLie commented 12 months ago

still not working bro, i try to implement exist code.

liodali commented 12 months ago

its wierd you can check screenshot can you share MapController initialisation again

Screenshot 2023-11-27 at 21 08 21
AntonLie commented 12 months ago

Sorry For Late Reply

Screenshot 2023-11-29 at 12 26 12

here's my Map Controller Code :

Screenshot 2023-11-29 at 12 27 24
liodali commented 12 months ago

but maybe that raster is the same as default did you try another raster type as you can see in my screenshot i used /osm-liberty/..

AntonLie commented 12 months ago

hmm i see,

now it's working

Thanks @liodali really appreciate it