I would like to access the map object from my console (and maybe also widget objects). So far I could only make that by inserting a breakpoint in some widgets code and use the this.map option to get my maps properties. Is there a way to do that easier? (Exuse me if this is too straightforward...)
You mentioned the browser's console - are you looking for more than this?
Chris,
I think he was asking how to access the map object and its properties from the consoles command line.
That's right, Robert! Could you give me a hint maybe?
The screenshot you have sent is relevant in "native" Javascript API applications, but not in WebApp Builder Applications. But thanks, anyways!
Yeah, my bad - I saw "browser console" and assumed you we're looking for that. I don't develop with the WAB, but it's still JavaScript, so you could certainly debug a deployed app using the browser console, which is what I thought you were trying to do!
I could find window.__viewerMap for the map object!, and that's great! But still don't really know how to refer for widgets in the console...
Benedek,
Sure just use "window._widgetManager.map"
If you use _widgetManager.getWidgetByLabel('Enhanced Search') when you have launched your app (not in the standard builder mode) then you can access the widget object.
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.