I am creating a layer in ArcGIS JavaScript API.

I am looking for the best way to have a feature layer with popups and unique markers.

This layer has hundreds of markers at a time.

The markers are unique.

I have attempted to use a uniqueValueRenderer, but discovered that the unique values are assumed to be predefined.

My markers are customized based on the values in the data, but there are too many variations to create predefined unique values.

  • To clarify, there are hundreds of markers visible on the screen. There are thousands of markers total. I only want to download and place the markers as they are needed. FeatureLayers using mode=MODE_ONDEMAND do this automatically, I believe. – Trent Mar 16 '16 at 15:55

This depends a lot on the details of how you're doing this, and what kind of markers you want to use. I've done the following to create proportional circle markers. You could also conceivably do something similar using the value you want to symbolize on to compute the RGB values for the color of your marker:

for (var i = 0; i < features.length; i++) {
    if (features[i].attributes[selectedField] > maxValue) {
        maxValue = features[i].attributes[selectedField];
    if (features[i].attributes[selectedField] < minValue) {
        minValue = features[i].attributes[selectedField];

for (var i = 0; i < features.length; i++) {
    var feature = features[i];
    var size = (feature.attributes[selectedField] - minValue) * ((150 - 5) / (maxValue - minValue)) + 5;
    var symbol = new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_CIRCLE, size,
        new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,
        new dojo.Color([255, 0, 0]), 1), new dojo.Color([0, 255, 0, 0.25]));
    var latlong = LatLonToWebMercator(feature.geometry.x, feature.geometry.y);
    var geometry = new esri.geometry.Point(latlong[0], latlong[1], spatialReference);
    var graphic = new esri.Graphic(geometry, symbol);

featureLayer.applyEdits(pointFeatures, null, null);
  • Of course, this assumes a numeric value for the attribute you want to symbolize by. – karl Mar 10 '16 at 17:02
  • They are numeric values. I use multiple parameters, azimuth, size, color, etc. for each icon. – Trent Mar 12 '16 at 0:34
  • I think drawing the individual Graphics are the way this has to be done. I was hoping ArcGIS had a renderer that would allow the markers to be created as the points were loaded. There are too many points to load them all at once. I need to load only the ones on the screen. – Trent Mar 12 '16 at 0:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.