wokring off of the Feature Widget sample.
I was trying to do the same thing with a diffrent layer, Polygon or otherwise.
the code dosent work when any other layer is used and I am not sure what is the diffreance between them.
code with a diffrent layer:
https://codepen.io/segev-salman/pen/JqmrWw?editors=1000
code with original layer:
https://codepen.io/segev-salman/pen/GawqoN?&editable=true&editors=100
The widget responds to the mouse movement and hit test but the popup template doesn't update
I am not sure where to add the template and why the original code doesn't require one. does it come with the layer itself?
Solved! Go to Solution.
It isn't working because your different layer doesn't have it's popupTemplate defined. Here is an example log of a graphic produced from the hit test:
Notice how the popupTemplate property is null?
It needs to be defined to show up in the feature widget.
Check out this jsbin. I have modified your original example:
It isn't working because your different layer doesn't have it's popupTemplate defined. Here is an example log of a graphic produced from the hit test:
Notice how the popupTemplate property is null?
It needs to be defined to show up in the feature widget.
Check out this jsbin. I have modified your original example:
thank you this is it!
Just to make sure, the original example didn't have a template in the code, does that mean that the service comes with a built in template? or am I missing something.
Yep. The service is published with the popup template in the renderer already.
See this link:
Notice this text:
HTML Popup Type: esriServerHTMLPopupTypeAsHTMLText
This means that the popup was configured on the server when the service was published. The other layer doen't have that setup:
HTML Popup Type: esriServerHTMLPopupTypeNone
Here is the rest feature service documentation on HTML server popups:
https://developers.arcgis.com/rest/services-reference/html-popup-feature-service-.htm