POST
|
In my case, I look only at polygons with a single ring, and I have observed the error there (as the returned point in not a centroid, sometimes being totaly out of a convex pologon.) But in your case, I wonder what the largest ring is: is it the largest in surface, or in number of vertexes? In the second case, you may have an small island with more vertexes that the big land body...
... View more
05-17-2019
09:45 AM
|
0
|
1
|
167
|
POST
|
We made the Parcel layer public. You should be able to open it now without credentials.
... View more
04-16-2019
09:15 AM
|
0
|
0
|
167
|
POST
|
I’ve completed a short demo for the getCentroid issue. You may find the code at: https://github.com/Horiatu/Test_GetCentroid/ and execute the application at: https://horiatu.github.io/Test_GetCentroid/ You may need credentials to see our layer service – let us know. When running the “get Centroid” button there is a 50/50 chance to get a(n almost) correct centroid, so, give it a chance: inspect more than one parcel…
... View more
04-15-2019
08:54 AM
|
0
|
2
|
167
|
POST
|
Yes, but what am I supposed to do? The map is not mine!
... View more
04-12-2019
06:25 AM
|
0
|
0
|
167
|
POST
|
I get that the code was OK. Now here is some data (one of the center of an extent): geometry : spatialReference : latestWkid : 3857 wkid : 102100 __proto__ : Object x : -8986538.660101335 y : 5333501.101999095
... View more
04-11-2019
11:37 AM
|
0
|
2
|
167
|
POST
|
I have this pice of code: parcels.forEach(parcel => { const centroid = parcel.geometry.getCentroid(); //getExtent().getCenter(); //getCentroid(); const feature = new Graphic(centroid, myUtils.NEW_ADDRESS_SYMBOL); this .map.graphics.add(feature); and I'm getting this result: The centroids are not in center of parcels, and some are outside their parcels. There is no point in publishing all code (I can do that on request), but changing this line: const centroid = parcel.geometry.getExtent().getCenter(); //getCentroid(); for ilustrating the center of the extent of the parcel instead of the centroid give better results: Note that this is not a good solution: I have added the extent for the last two parcels to show that the centre of the extent is not the desired solution, but this is a lot better solution that the getCentroid function the way I got it.
... View more
04-09-2019
07:32 AM
|
0
|
11
|
1634
|
POST
|
Yes, is about JsApi - but 3.x This is the closest post I've found related to my issue. Is not about a Graphic in a graphic layer, but the geometry of a feature. I've found in the mean time a solution, which seems to work well: feature . _layer. suspend (); feature . geometry . update ( centroid . x , centroid . y ); feature . _layer . resume (); feature._layer.refresh() however does nothing! for the graphic in the graphic layer, the suggested solution works well: const selectedAddress = this . _getMarker ( "selectedAddress" ); selectedAddress . geometry = centroid ; this . map . graphics . refresh (); Tx, for your reply.
... View more
03-12-2019
09:33 PM
|
0
|
0
|
496
|
POST
|
I see refreshing the layer - alright, however, the feature geometry I've just changed does not show in another position until I zoom in (and out.)
... View more
03-12-2019
09:41 AM
|
0
|
2
|
496
|
POST
|
looks like Kristian Ekenes' replay bellow gives the answer.
... View more
01-31-2019
08:24 AM
|
0
|
0
|
132
|
POST
|
Is it any indication that esri will ever fully updates popup and popupTemplate funcitonality to what we see in 3.x?
... View more
01-31-2019
07:12 AM
|
0
|
1
|
132
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|