esri-loader-hooks
esri-loader-hooks copied to clipboard
Can't pass JSON object to useWebMap
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)