We building a map-widget at the moment. You should be able to provide different tile URLs by using the module:
import: [
MapWidgetModule.config('https://stamen-tiles.a.ssl.fastly.net/toner/{z}/{x}/{y}.png'),
MapWidgetModule.config('https://osm.com/{z}/{x}/{y}.png'),
]
We are providing them via an injection token as ModuleWithProviders on the config() method:
{
provide: MAP_TILE_LAYER,
useValue: url
}
However the url is always 'https://osm.com/{z}/{x}/{y}.png' (last imported Module). When reading about providers, this seems to be the natural behavior of non-lazy-loaded modules and providers.
My question is: Is there any way to have a per-module configuration? So I can do this kind of simple configuration already at the module import?
Still not clear?
This Stackblitz (not mine) is exactly showing the issue with the InjectionToken DISPLAY_LIFE_TOKEN: https://stackblitz.com/edit/angular-ivy-r3ctm9?file=src%2Fapp%2Fweb%2Fweb.module.ts
Thanks, Jan