question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue with BasemapGallery and source autocast

See original GitHub issue

Hi, 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:closed
  • Created 6 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
ekenescommented, Nov 3, 2017

@jkieboom it was unintentional. We’ll fix it.

0reactions
dasacommented, Jan 2, 2018

these are not documented as actual classes

Fixed in 4.6

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found