You are here: Using ArcWeb Explorer JavaScript > Parameter descriptions > AWX JavaScript group layers

ArcWeb Explorer JavaScript group layers

A map generated by the AWX JavaScript API is comprised of one or many group layers of the same type. Note that a map can only have one group layer of each type. A group layer consists of several layers that operate as a single layer. The following group layers and parameters can be used in AWX JavaScript. See Setting group layer depths for information on setting depth for your group layers:

*NOTE: The "layerVisibility" parameter is spelled correctly in the AWX JavaScript API for vectorGroupLayer, but it is misspelled "layerVisiblity" for mapImageGroupLayer and thematicGroupLayer.

vectorGroupLayer

The vectorGroupLayer is a group layer which makes vector data available on the client side. Examples are road networks in the United States and Europe. In a vectorGroupLayer, geographic features are represented as points, lines, and polygons.

NameData Type DescriptionValid Values

alpha

Number

Sets transparency.

0-100

dataSource

String

Contains name of the data source.

See valid data sources.

style

String

Determines color scheme used in the map: nt (Neutral),  gs (Gray Scale), or tg (Tangerine).

nt/gs/tg

layerVisibility*

Array

Key value pairs of layername and visibility
[{name:"Oceans and seas",visibility:"off"}]. A list of all available layers with their visibility is not available.

Default values depend on data source and zoom level.

 

rasterTileGroupLayer

The rasterTileGroupLayer is a tiled raster group layer containing satellite data from GlobeExplorer.

NameData Type DescriptionValid Values

alpha

Number

Sets transparency.

0-100

dataSource

String

Contains name of the data source.

See valid data sources.

 

mapImageGroupLayer

The mapImageGroupLayer is a group layer containing data in an image format derived from various ESRI data sources. These include vector data sources on the server side. Examples are census maps and street maps. Each cell contains an attribute value and location coordinates.

NameData Type DescriptionValid Values

alpha

Number

Sets transparency.

0-100

dataSource

String

Contains name of the data source.

See valid data sources.

layerVisiblity*

Array

Key value pairs of layername and visibility
[{name:"Oceans and seas",visibility:"off"}]. To get a list of all available layers with their visibility, use layerVisibilityInfo which is controlled by returnLayerVisibilityInfo.

Default values depend on data source and zoom level. Valid values for visibility returned from the server are "on", "default" and "not available".

returnLayerVisibilityInfo

Boolean

Determines if layer visibility information is returned.

Default value is "false".

 

hybridGroupLayer

The hybridGroupLayer is a group layer that is a combination of vectors and raster tiles, for example, road maps overlaid on satellite images.

The hybridGroupLayer has a predetermined set of data sources and parameters.

 

thematicGroupLayer

The thematicGroupLayer is a group layer consisting of a data source that allows the creation of thematic maps, such as a thematic map that displays information about average household income.

NOTE: Thematic maps in the size range of 500 to 1000 pixels (width or height) will not display properly. Maps smaller than 500 pixels or larger than 1000 pixels will display correctly. The largest map possible is 2000 pixels by 2000 pixels.

NOTE: If the user changes the map type to “data map” using the map types widget (called by the showAllWidgets() and showWidget() methods), then that thematic map will display. Any thematicGroupLayers set in the code are ignored.

NameData Type DescriptionValid Values

alpha

Number

Sets transparency.

0-100

classColors

Array

Contains an array of RGB color values.

 

classificationMethod

String

Contains information about how the data classes are divided. Equal interval divides the number of classes into equal intervals, regardless of how many members each class contains. Quantile divides the number of classes so each class contains the same number of members, regardless of the interval range.

Valid values are "equalInterval" or "quantile". Default value is "equalInterval".

classLabels

Array

Contains labels for each class in the legend. The order of the classLabels values needs to match the order of the legend.

 

colorPalette

String

Contains a color ramp for the class breaks.

Valid values are "coldToHot", green", "grey", "orange", or "red". Default value is "red".

dataSource

String

Contains name of the data source.

See valid data sources.

layerVisiblity*

Array

Key value pairs of layername and visibility
[{name:"Oceans and seas",visibility:"off"}]. To get a list of all available layers with their visibility, use layerVisibilityInfo which is controlled by returnLayerVisibilityInfo.

Default values depend on data source and zoom level. Valid values for visibility returned from the server are "on", "default" and "not available".

legendUrl

String

Returns the URL of the legend for the thematic map.

 

mapLegend**

Object

Sets mapLegend object. mapLegend parameters are described in the table below.

 

numClasses

Number

Contains the number of classes into which the data is classified.

Valid values are "2", "3", "4, or "5". Default value is "2".

returnLayerVisibilityInfo

Boolean

Determines whether or not layer visibility information is returned.

Default value is "false".

showLegend

String

Determines legend visibility: fixed displays a fixed legend on the map; floating displays a floating legend on the map. If not set, no legend displays.

Valid values are "fixed" or "floating". Default is no legend displays.

thematicField

String

Sets the field based on which the thematic map is generated. For a list of available fields, see thematicGroupLayer data sources, click a link to view metadata for a specific data source, then click More Info and view the Supplemental Info for a list of available fields for that data source.

Examples of valid values are: "AVGHHINC", "AVGHHINC90", "AVGHHSZ90", "AVGHHSZ_CY", and "AVGHHSZ_FY".

 

**mapLegend parameters

If mapLegend parameters are not set in the addGroupLayer method, no legend displays. There is no default legend.

To remove an existing legend, set mapLegend as null using the setGroupLayerProperties method.

If mapLegend parameters are changed using the setGroupLayerProperties method, all properties must be set to desired values when a new mapLegend object is created. Parameters will not retain previous values as the old mapLegend object is discarded.

NameData Type DescriptionValid Values

autoExtend

Boolean

Determines if the legend automatically extends beyond the size specified in height. Only extended if needed.

Default value is "false".

backgroundColor

String

Contains the background color of the legend. Valid format is an R,G,B string with each value between 0 and 255, for example, "255,0,0" is red.

Default value is "255,255,255" (white).

font

String

Contains the font of the legend text. Valid values are "Arial", "Bembo MT", "Book Antiqua", "Bookman Old Style", "Century Gothic", "Courier New", "Georgia", "Gill Sans MT", "Monotype Century Schoolbook", "Rockwell MT", "Times New Roman", or "Verdana".

The legend title font is dependent on the system fonts. If the specified font is not found, a Flash default will be used.

fontSize

Number

Sets the value fonts and the title fonts.

Default value is "8".

height

Integer

Contains the height of the legend. Height is in pixels. The height value is ignored if the column's value is greater than "1". (The best height is set based on the number of columns.)

Default value is "300".

title

String

Contains the title of the legend.

 

width

Number

Contains the width of the legend. Width is in pixels.

Default value is "125".

 

queryGroupLayer

The queryGroupLayer is a group layer consisting of a data source which allows the filtering of features based on a WHERE clause. By default, the 10 points closest to the map center display. You can change the number of points using the “count” option. A live sample of this functionality is provided in the Query Group Layer sample. Query data sources provided by ESRI as well as query data sources created by users are available at http://www.arcwebservices.com. An example of a queryGroupLayer is a map that allows you to query business listings in the United States. See queryGroupLayer for more information. See Spatial Query codes for a list of codes for the valid data sources.

NameData Type DescriptionValid Values

dataSource

String

Name of the data source.

See valid data sources.

count

Number

Maximum results to be returned.

Default value is "10".

labelField

String

Contains field labels.

 

orderByField

String

Determines the order to display the field names in the results.

 

orderByDecending

Boolean

Determines if the results are in ascending or descending order.

Default value is "false" (ascending).

refreshScope

Number

Sets a buffer area around the extent. Results are returned for this full area to enable smooth panning. If refreshScope = 3, an area equal to extent x 3 is used around the extent.

Default value is "5".

fieldMap

Object

Determines values for the fields that are returned and also sets an alias for the field. For example:

fieldMap:{
MAG:"Magnitude",
TIMESTAMP:"Date",
DEPTH:"Depth",
USGSID:null, //use " or null to keep the default column name
DESCRIPTION:"Description"
}

In this example, MAG is the field name, and "Magnitude" is the alias.

 

markerDefaults

Object

Sets marker properties. See markerDefaults for information on the available marker properties.

 

whereClause

String

Contains a SQL WHERE clause to limit search results. The following operators work in a WHERE clause: =, >, >=, <, <=, <>, AND, OR, LIKE, BETWEEN, IN, NOT IN. The following are not valid: ORDER BY and DISTINCT. See Building WHERE clauses for more information on WHERE clauses.

 

 

Setting group layer depths

AWX JavaScript API automatically assigns depths to the various layers added to your map. It also allows you to set the depth you want your layer at. There are some intricacies to keep in mind while setting layer depths to keep your application performing satisfactorily.

When layer depths are set automatically, the layer capturing mouse clicks is automatically pushed on top of all the other layers so it is possible to interact with the map. You don't have to worry about setting depths of any layers or the click layer.

If a layer is removed, the layer order automatically reshuffles to fill the gap left by the removed layer.

When manually setting layer depths using the “depth” argument of the addGroupLayer method of AWMap, these points must be kept in mind:

If these conditions are not met, the map may not behave as expected, in terms of capturing clicks.


Visit the Feedback page to give comments or suggestions about the ArcWeb Developer's Guide.

ArcWeb site | ArcWeb support | support.esri.com

Copyright © ESRI