Custom Cluster Marker For ArcGIS API For JavaScript

3255
2
Jump to solution
09-02-2015 12:54 AM
BruceGreen
New Contributor III

I am following this tutorial to create some Cluster Points.

the result is look like :

cluster_001.png

Can you please let me know how I can update the Markers to custom images or SVG?

Thanks

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
ChrisSmith7
Frequent Contributor

You may not need to do anything in this file, but just so you are aware (they don't make it obvious - I had to find the path using Fiddler when I first saw the example), there is an extra file than what you see in the sample:

http://developers.arcgis.com/javascript/samples/layers_point_clustering//extras/ClusterLayer.js

This is the ClusterLayer that is pulled in by:

"extras/ClusterLayer",

...at the top of the requires. The dojoConfig tells the app where to look for this module. Just wanted you to be aware there were more user-created files than what is readily shown in the sample!

As far as updating the markers - as Tracy mentioned, this should be straight-forward. I went ahead and updated it to something arbitrary in the sandbox:

View solution in original post

2 Replies
TracySchloss
Frequent Contributor

What have you tried already?  Any supported PictureMarkerSymbol should work in place of the example. The one's ESRI provides are just handy and scale well to expand for larger numbers. 

If you're looking for assistance on PictureMarkerSymbols and SVG, you could see if this thread helps:

Creating PictureMarkerSymbols with raw SVG tags or with Dojo GFX

0 Kudos
ChrisSmith7
Frequent Contributor

You may not need to do anything in this file, but just so you are aware (they don't make it obvious - I had to find the path using Fiddler when I first saw the example), there is an extra file than what you see in the sample:

http://developers.arcgis.com/javascript/samples/layers_point_clustering//extras/ClusterLayer.js

This is the ClusterLayer that is pulled in by:

"extras/ClusterLayer",

...at the top of the requires. The dojoConfig tells the app where to look for this module. Just wanted you to be aware there were more user-created files than what is readily shown in the sample!

As far as updating the markers - as Tracy mentioned, this should be straight-forward. I went ahead and updated it to something arbitrary in the sandbox: