Issue with BasemapGallery and source autocast
See original GitHub issueHi, with the lastest API version 4.5.0, i have a issue with the autocast for the source parameter of the BasemaGallery component and TypeScript.
Here a sample :
let basemapGallery = new BasemapGallery({
container: this.container.nativeElement,
view: this.mapView
});
const BasemapCollection = Collection.ofType(Basemap);
let collection: Collection<Basemap> = new BasemapCollection();
// fill the collection with some basemaps
basemapGallery.source = collection;
It works but I have this TS error message :
TS2322: Type ‘Collection<Basemap>’ is not assignable to type ‘LocalBasemapsSource | PortalBasemapsSource’. Type ‘Collection<Basemap>’ is not assignable to type ‘PortalBasemapsSource’. Property ‘basemaps’ is missing in type ‘Collection<Basemap>’.
In the documentation, it’s indicate that we can set this property with an array or Collection of Basemaps https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html#source
Is there any feedback about the autocast and TypeScript ?
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
[JSAPI 4.8][BasemapGallery] Local basemap source fetch error
Solved: I'm using BaseMap Gallery Widget with local basemap ... Maybe there is an issue in widget constructor or in basemap source autocast?...
Read more >BasemapGallery | ArcGIS Maps SDK for JavaScript 4.25
The source for basemaps that the widget will display. This property can be autocast with an array or Collection of Basemaps, or a...
Read more >BasemapGallery | API Reference | ArcGIS API for JavaScript 4.9
The source for basemaps that the widget will display. This property can be autocast with an array or Collection of Basemaps, a Portal...
Read more >Arcgis js 4.11: How to add basemap layer to basemap gallery
let basemapGallery = new BasemapGallery({ source: { // autocasts as ... view: view }); view.ui.add(basemapGallery, 'bottom-left');.
Read more >Finding all points from a csvLayer within a circle with ArcGIS ...
... autocasts as new PopupTemplate() title: "Facility Information", ... var basemapGallery = new BasemapGallery({ view: view, source: ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jkieboom it was unintentional. We’ll fix it.
Fixed in 4.6