I am using this method for changing shape colors on a conditional basis, and it works great. However, I've run into a fairly large issue. I'm also using the shapeCreated event to display a label on the map (state postal code) using this code. However, the data is actually made up of multipolygons, so the created shapes may or may not refelect the actual state outline. As such, the label prints multiple times. I can put code in place to ensure it's a new state name when a shape gets created, but the label doesn't get centered any more since it centers on the actual shape being created, and not the shape the subshape belongs to (hope that makes sense).
So what is a good way of centering the label on a shape made up of multiple polygons?
provNum = e.shape.dataItem.properties[
bbox = e.shape.bbox();
center = bbox.center();
// Create the label
labelCenter = label.bbox().center();
// Position the label
center.x - labelCenter.x,
center.y - labelCenter.y
// Render the label on the layer surface