POST
|
Thank you for the explanations, I was able to resolve the issue by following the above pattern : I am pasting the exact pattern I wrote For opening a polyline popup, I needed to fill out the x & y components of geometry, which I can retrieve using the following: var mid: number = selectedResult.geometry.paths[0].length / 2; selectedResult.feature.geometry.x = selectedResult.feature.geometry.paths[0][mid][0]; selectedResult.feature.geometry.y = selectedResult.feature.geometry.paths[0][mid][1]; After assigning x & y values popup.Open worked perfectly. self.mapView.popup.open({ location: selectedResult.feature.geometry, features: [selectedResult.feature], });
... View more
07-28-2016
09:21 AM
|
2
|
0
|
2062
|
POST
|
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. mapView.popup.open ({ location: selectedResult.feature.geometry.extent.center, features: [selectedResult.feature] }); 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.
... View more
07-26-2016
09:12 AM
|
2
|
5
|
4139
|
Title | Kudos | Posted |
---|---|---|
2 | 07-26-2016 09:12 AM | |
2 | 07-28-2016 09:21 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:25 AM
|