Select to view content in your preferred language

typescript error creating MapView from TypeScript

50
2
yesterday
john_cartwright_noaa
Regular Contributor

Hello All,

Can someone tell me how to address the following TypeScript error:

 

 const view = new MapView({
        container: mapDiv.current,
        // ERROR: "Type 'WebMap' is not assignable to type 'MapProperties'."
        map: webmap
      });

 

JSAPI version 4.33

 

Thanks!

 

 

Tags (2)
0 Kudos
2 Replies
JonathanDawe_BAS
Occasional Contributor

Is your webmap constructed using `new Webmap`? I don't get a typescript error in my application using arcgis 4.33 with equivalent code. 

0 Kudos
john_cartwright_noaa
Regular Contributor

Thanks for your reply. Yes, it looks like this:

const webmap = new WebMap({
  portalItem: {
    id: "43b93cc9be994efbb5a60a2b2d85f151"
  }
})
const view = new MapView({
  container: mapDiv.current,
  // Type 'WebMap' is not assignable to type 'MapProperties'.
  map: map
});

 

I wonder if I'm missing something in my VSCode configuration then?

0 Kudos