[Help] How can add tiles another provider.
Hi can you help me, that add the tiles from anotter provider? I tried RasterSource and ImageSource, but dont works. the url will be query is like this: "https://example.com.br//radar/tiles/{startDate}{endDate}{x}{y}{z}.png",
Hi @JulioRennan, could you share more details, code you've been trying, errors you've faced etc
Hi i solved this with the following code:
final startDate = DateTime.now().millisecondsSinceEpoch;
final endDate = DateTime.now().millisecondsSinceEpoch;
mgController.style.addSource(
RasterSource(
id: "raster_source",
tiles: ["https://example.com.br//radar/tiles/$startDate_$endDate_{x}_{y}_{z}.png"],
tileSize: 256,
),
);
await mgController.style.addLayer(
RasterLayer(
id: "raster_layer",
sourceId: "raster_source",
),
);
I dont know if is the best pratice to sdk, but was solved. And always the startDate or endDate changes, was added a new Raster Source. Make sense, add an example to this repository with external tiles providers?
Hi i solved this with the following code:
final startDate = DateTime.now().millisecondsSinceEpoch; final endDate = DateTime.now().millisecondsSinceEpoch; mgController.style.addSource( RasterSource( id: "raster_source", tiles: ["https://example.com.br//radar/tiles/$startDate_$endDate_{x}_{y}_{z}.png"], tileSize: 256, ), ); await mgController.style.addLayer( RasterLayer( id: "raster_layer", sourceId: "raster_source", ), );I dont know if is the best pratice to sdk, but was solved. And always the startDate or endDate changes, was added a new Raster Source. Make sense, add an example to this repository with external tiles providers?
This solve my life! Thanks a lot!