esri-loader-hooks icon indicating copy to clipboard operation
esri-loader-hooks copied to clipboard

Can't pass JSON object to useWebMap

Open gavinr opened this issue 5 years ago • 0 comments

In order to specify a portalUrl, I want to pass a JSON object to useWebMap like this:

const [ref, view] = useWebMap({
    portalItem: {
      id: '123abc',
      portal: {
        url: 'https://my.portal.url'
      }
    },
  }, { .... });

As it seems like I can do here: https://github.com/tomwayson/esri-loader-hooks/blob/a3196b7f33e237f572607a463415393dbc4a3c86/src/utils/arcgis.ts#L46

But the code never gets into loadItem() since I'm passing in an object (not a string), isItem is always false here, and always goes into loadMap (where I want it instead to go into loadItem)

gavinr avatar Sep 22 '20 15:09 gavinr