Select to view content in your preferred language

Problems with ClassBreaksRenderer and symbolizing Polygons with SimpleMarkerSymbol

3942
2
05-21-2015 11:19 AM
RyanSellman
Deactivated User

Hello All! 

I'm trying to symbolize a small parcel polygon dataset on the client using the ClassBreaksRenderer.  The idea is to show the parcels as points at the center of each polygon with the size/color of the point being determined by the sale amount of the parcel.  I can get the renderer set up just fine - the issue I am having involves where the "parcel points" are being drawn.  In most cases, the points are not drawn in the center of the parcel.  In some cases, the point is completely outside the parcel polygon.  Below is a quick snapshot of what I am talking about:

There are some good examples in the image above.  I just want the parcel points to draw at the center of the associated parcel - you can see above they currently are not. Is there a better way to implement this type of symbolization with the API? 

Below is the code I am using to set the renderer up.  Any help is appreciated!!

Ryan

var markerOutline = new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([0,0,0]), 1);
  var salesRenderer = new ClassBreaksRenderer(symbol, "publication.DBO.SALES_8_1_C.PRICE");
         salesRenderer.addBreak(0, 19999, new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 10, markerOutline, new Color([153, 255, 204,1])));
  salesRenderer.addBreak(20000, 39999, new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 11, markerOutline, new Color([51, 204, 51,1])));
  salesRenderer.addBreak(40000, 59999, new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 12, markerOutline, new Color([0, 51, 0,1])));
  salesRenderer.addBreak(60000, 99999, new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 13, markerOutline, new Color([255, 255, 153,1])));
  salesRenderer.addBreak(100000, 139999, new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 14, markerOutline, new Color([255, 102, 0,1])));
  salesRenderer.addBreak(140000, 199999, new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 15, markerOutline, new Color([102, 51, 0,1])));
  salesRenderer.addBreak(200000, 299999, new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 16, markerOutline, new Color([255, 102, 255,1])));
  salesRenderer.addBreak(300000, 399999, new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 17, markerOutline, new Color([204, 0, 153,1])));
  salesRenderer.addBreak(400000, 499999, new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 18, markerOutline, new Color([102, 0, 102,1])));
  salesRenderer.addBreak(500000, 699999, new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 19, markerOutline, new Color([51, 204, 255,1])));
  salesRenderer.addBreak(700000, 999999, new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 20, markerOutline, new Color([0, 153, 204,1])));
  salesRenderer.addBreak(1000000, 6844000, new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 21, markerOutline, new Color([0, 51, 153,1])));
   
  var sales = new FeatureLayer("http://summitmaps.summitoh.net/arcgis/rest/services/Appraisal_Mercator/MapServer/1", {
  visible: true,
  mode: FeatureLayer.MODE_ONDEMAND,
  id: "Parcel Sales",
  minScale: 50000,
  maxScale: 0
  });
   
  sales.setRenderer(salesRenderer);






0 Kudos
2 Replies
RobertScheitlin__GISP
MVP Emeritus

Ryan,

   I am not sure what is going wrong with the marker class break renderer, but why not just change the fill color for the whole polygon instead?

RyanSellman
Deactivated User

Thanks for the reply, Robert.  I'm trying to replicate a legacy desktop application and the users are used to similar symbology.  I thought I would post the question just in case I was missing something minor.  I have no problem using your suggestion and changing the fill color of the entire parcel based on sale price.  I just found it odd that the markers were drawing in what seemed to be random points in/around the parcel..

Thanks for the suggestion!

0 Kudos