Select to view content in your preferred language

use defaultPopupTemplateEnabled but with custom template for one specific layer?

09-10-2020 01:04 PM
New Contributor III

I have a function that gets fields and values from a node service from a REST request. I put it in its own IdentifyTask and it works fine to create a popup.  (JSAPI 4.17)

I also enabled defaultPopupTemplateEnabled = true for my app.  I turned on popups for all layers in the webmap.  So the basic default popup works fine for all layers, (showing all fields) and the node popup works fine, each by themselves.

Objective: default popup for all layers; except one layer where I get data from a node service.

update: I solved this by pushing the results to the popup array:

view.popup.features.push(response1); from original post... which led me to this solution.....  ...

Except the default popup for all the other layers gets replaced with the special Node identify's popup's 'content' for the popup template.  The parcels which I use the Node popup on, only appear when I zoom in to neighborhood scale. Once I do that, the Node popup shows up, but the defaultpopup gets killed.

Interestingly, the defaultPopup actually does show up at first.... I added breakpoints in F12 and I see that it opens just fine from a click on the View. For example if I turn Zoning on, shows all its fields fine. Or Wetlands, etc.  But... then the node IdentifyTask kicks in, and removes any and all Default popups, and then displays its own popup. 

Tags (1)
0 Kudos
0 Replies