Hide Table of Contents
esri/dijit/util
esri/layer/pixelFilters
esri/process
esri/support
esri/workers
Class: GraphicsLayerProxy

require(["esri/opsdashboard/GraphicsLayerProxy"], function(GraphicsLayerProxy) { /* code goes here */ });

Description

(Added at v3.14)
(Currently in Mature Support) GraphicsLayerProxy is a proxy class that represents a graphics layer in a map widget in the host application. GraphicsLayerProxy cannot be directly instantiated. To create a graphics layer proxy, use the function createGraphicsLayerProxy. When the GraphicsLayerProxy is no longer required, it should be destroyed using destroyGraphicsLayerProxy.

Samples

Search for samples that use this class.

Properties

NameTypeSummary
maxScaleNumberRead-only: The current host graphics layer maximum visible scale.
minScaleNumberRead-only: The current host graphics layer minimum visible scale.
opacityNumberRead-only: The current host graphics layer opacity ratio.
rendererRendererRead-only: The current renderer used by the host graphics layer.
visibleBooleanRead-only: The current host graphics layer visibility.

Methods

NameReturn typeSummary
addOrUpdateGraphic(graphic)NoneUpdate a graphic in the host graphics layer with a new version.
addOrUpdateGraphics(graphics)NoneUpdate graphics in the host graphics layer with a new version.
clear()NoneRemoves all the graphics from the host graphics layer.
removeGraphic(graphic)NoneRemoves from the host graphics layer a graphic.
setMaxScale(maxScale)NoneSets the host graphics layer maximum scale.
setMinScale(minScale)NoneSets the host graphics layer minimum scale.
setOpacity(opacity)NoneSets the host graphics layer opacity ratio.
setRenderer(renderer)NoneSets the host graphics layer renderer.
setVisibility(visibility)NoneSet the visibility of the host graphics layer.
Property Details

<Number> maxScale

Read-only: The current host graphics layer maximum visible scale. If the map is zoomed in beyond this scale, the layer will not be visible. A value of 0 means the layer does not have a maximum scale. Use setMaxScale() to change this value.

<Number> minScale

Read-only: The current host graphics layer minimum visible scale. If the map is zoomed out beyond this scale, the layer will not be visible. A value of 0 means the layer does not have a visible scale. Use setMinScale() to change this value.

<Number> opacity

Read-only: The current host graphics layer opacity ratio. Values range from 0.0 to 1.0, where 0.0 is 100% transparent and 1.0 has no transparency. Use setOpacity() to change this value.

<Renderer> renderer

Read-only: The current renderer used by the host graphics layer. Use setRenderer() to change this value and all its properties.

<Boolean> visible

Read-only: The current host graphics layer visibility. Use setVisibility() to change this value.
Method Details

addOrUpdateGraphic(graphic)

Update a graphic in the host graphics layer with a new version. If the graphic doesn't exist then add it.
Parameters:
<Graphic> graphic Required The graphic to update in the host graphics layer.

addOrUpdateGraphics(graphics)

Update graphics in the host graphics layer with a new version. If the graphics don't exist then add them.
Parameters:
<Graphic[]> graphics Required The graphics to update in the host graphics layer.

clear()

Removes all the graphics from the host graphics layer.

removeGraphic(graphic)

Removes from the host graphics layer a graphic.
Parameters:
<Graphic> graphic Required The graphic to remove from the host graphics layer.

setMaxScale(maxScale)

Sets the host graphics layer maximum scale.
Parameters:
<Number> maxScale Required None

setMinScale(minScale)

Sets the host graphics layer minimum scale.
Parameters:
<Number> minScale Required None

setOpacity(opacity)

Sets the host graphics layer opacity ratio. Values range from 0.0 to 1.0, where 0.0 is 100% transparent and 1.0 has no transparency.
Parameters:
<Number> opacity Required An opacity ratio between 0 and 1.

setRenderer(renderer)

Sets the host graphics layer renderer. Using a renderer for a graphics layer is a good optimization when dealing with a lot of graphics having a same set of symbols. It prevents having the same symbol duplicated in each graphics.
Parameters:
<Renderer> renderer Required Since the Windows operations dashboard is built using ArcGIS Runtime SDK for WPF, only renderers supported by the WPF should be used, such as SimpleRenderer, UniqueValueRenderer and ClassBreaksRenderer.

setVisibility(visibility)

Set the visibility of the host graphics layer.
Parameters:
<Boolean> visibility Required The new visibility value.
Show Modal