Select to view content in your preferred language

Renderer polygon rings as points

435
3
07-25-2022 04:58 AM
MariusPikzirnis
New Contributor

Hello,

I have polygons with multiple rings. At some zoom level I am rendering polygons to points, but only one point is rendered to multi polygons.

Is it possible to render points for each ring? 

 

0 Kudos
3 Replies
ReneRubalcava
Honored Contributor

Do you want to render the vertices of the polygon to points? Or the center of the polygons to points?

You would need to break the polygon into polylines and the polylines into points. I have a utility you can use for that.
https://github.com/odoe/explode/

For the render to polygon to points, you can define the renderer to display points and it will use the centroid of the polygon.

https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html

The center can be a little off if it's an oddly shaped polygon, like a horse shoe or something.

0 Kudos
MariusPikzirnis
New Contributor

I have objects with multiple drawn polygons to them.  I am using a feature service. These polygons are all around the city. 

If I change the renderer to simple-marker it only renders one polygon to point and that's it. 

pol.png

0 Kudos
ReneRubalcava
Honored Contributor

That's expected. So you want to show the vertices of the polygon as points? You'll need to break it down to points using something like the explode utility I linked above. Polygons -> Polylines -> Points

0 Kudos