Set properties extending Home Widget

281
2
06-27-2019 05:18 AM
JeremyLyman
New Contributor II

I'm working to extend the Home Widget to add functionality for multiple views.  The reference docs say that "Any properties can be set, retrieved or listened to." But when I try to set iconClass or label properties, either through super() with the properties object or by setting them via my class, I get an error stating that it cannot assign because the property is constant or read-only.

https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html

What gives? Is the doc wrong?

0 Kudos
2 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

It appears the doc needs to be updated to reflect that those properties are read only.

DavidWilson3
Occasional Contributor

Hi Jeremy,

A work around for this could be to embed the Home widget inside the Expand widget. I know for a fact that the IconClass and Label properties are not read only for the Expand widget. You could also use the Bookmark widget instead of Home and also embed that in the Expand Widget. And as a final note if you have multiple layers you can use the LayerList widget and add bookmarks on that as well.

Expand | ArcGIS API for JavaScript 4.11  

Bookmarks | ArcGIS API for JavaScript 4.11 

LayerList | ArcGIS API for JavaScript 4.11 

0 Kudos