Clustering with picture markers using GeoJsonLayer

809
1
02-22-2023 07:46 AM
RomanUC
New Contributor

Hi guys, we started developing map couple of years ago when clustering wasn't supported but now I see that ArcGIS has native clustering with good performance and I want to migrate. 

But I have a question: lets imagine a map with some bunch of points in different places, points on the map are some kind of buildings, first of all I want have an ability to group these points (buildings) with specific radius and additionally when user "zoom in" to buildings he should see the picture marker (pins like in google) with type of building (residential / business / land). Marker should look like pin with one-letter type R, B, L. So clusters should look like circle with random color, but when user zoom in he should see marked points.

Is it possible to implement using GeoJsonLayer?

geoJsonLayer = new GeoJSONLayer({
url: 'url-to-get-data-in-geojson-format',
copyright: "USGS Earthquakes",
popupTemplate: template,
renderer: renderer2,
outFields: ['buildingNumber', 'buildingType']
});

So data should be clustered by geo json points but when user "zoom in" he should see different picture markers depending on "buildingType"

Greatly thankful for any info or help links how to implement it!

0 Kudos
1 Reply
UndralBatsukh
Esri Regular Contributor

Hi there, 

Not sure if you already found your answers. What you are asking can be done and much more. 

We have tons of samples that show different use cases: https://next.sites.afd.arcgis.com/javascript/latest/sample-code/?tagged=clustering

Clustering is also really well documented including this guide: https://next.sites.afd.arcgis.com/javascript/latest/visualization/high-density-data/clustering/

 

Here is a simple codepen just in case: https://codepen.io/U_B_U/pen/eYLWXpP?editors=100

Hope this helps,

-Undral

0 Kudos