Scale renderer


Purpose
The custom scale renderer changes how polygon features are drawn based on the current map scale. This custom renderer shows you how to define a custom feature renderer and consume it inside of an ArcGIS Engine application. 
The renderer itself is defined to have two scale thresholds that are hard coded in the renderer source code. If you zoom out beyond 1:3,000, polygon features are symbolized with a marker symbol at their centroids. If you zoom out past 1:2,000, but not beyond 1:3,000, polygon features are symbolized with a polygon representing the envelopes of the features. For all the remaining scales, the polygon geometry defined by the shape attribute is used to draw the outlines.

How to use

See How to use ArcGIS samples for help on running the sample.

Scale Renderer
  1. Navigate to this sample's lib folder (scalerenderer/lib) and copy ScaleRendererExt.jar into the <ArcGIS Engine Install Dir>/java/lib/ext folder to deploy the custom renderer extension. The extension functionality will become available to you when you start the ArcGIS Engine application.
  2. Navigate to this sample's bin folder (scalerenderer/bin) and execute the SscaleRenderer.jar to start the application. The JFrame is loaded with and empty MapBean and 3 buttons: Open File …, Zoom In, and Zoom Out.
  3. Click 'Open File …' and add the states shapefile from <DevKitHome Install Dir>/java/samples/data/usa folder to populate your MapBean.
  4. Click the 'Zoom Out' button. Notice the symbology change to envelopes for each polygon in the states layer.
  5. You can continue to click the 'Zoom Out' button. Eventually the polygon features are symbolized with simple marker symbols located at each polygons centroid.

If you installed the samples feature, you will find the files associated with this sample in <Your Developer Kit install location>\DeveloperKit10.4\Java\Samples\ArcObjects.

cartography/ScaleRendererMain.java Main class that consumes the custom renderer in an Engine application.
cartography/ScaleRenderer.java Renderer that implements IFeatureRenderer and contains the draw method.

See Also:

How to implement custom feature renderers
Consuming custom feature renderers




Development licensing Deployment licensing
Engine Developer Kit Engine