I have a scenario I am working on where when I click the sidebar with results, I need to open a popup and highlight the graphic of the selected result from the sidebar.
Although the graphic is always highlighted correctly for the polyline, the popup is not always consistently pointing to the polyline. Most of the time the popup points few inches away or in some case really far away from the highlighted graphic. Since the user is not directly clicking on the map, but on the sidebar, I need to explicitly pass the location for the popUp.
What is the best way to figure out the location of the polyLine for its popUp ?
Currently I am using the following to find the location for polyline. But as you can see in the screenshot, the popUp is displayed away from the polyline.
I am able to correctly point the popUp for point : selectedResult.feature.geometry and for a
polygon : selectedResult.feature.geometry.centroid, but for the polyLine it is not working correctly.