API Reference: ArcGIS JavaScript Extension for Google Maps


Classes

class esri.arcgis.gmaps.TiledMapServiceLayer

An instance of this class represents a map service, published with the ArcGIS Server, that has been cached in the same coordinate system as Google Maps (WGS 1984 Web Mercator) and uses the same tiling scheme. This class implements the GTileLayer interface and hence can be added to your map as a custom tile layer through GTileLayerOverlay or as a custom map type through GMapType.

Constructor

Constructor Description
esri.arcgis.gmaps.TiledMapServiceLayer(url, options?, callback?)

Creates a new TiledMapServiceLayer from the ArcGIS Server REST resource identified by the url. The optional options argument is an object literal that specifies a set of TiledMapServiceLayerOptions.

Once it has finished loading the resource, the load event will be fired and the optional callback function will be invoked. Both the callback and the event handlers will receive a reference to this object that can be added to your map as a custom tile layer using the MapExtension.addToMap method.

Properties

Property Type Description
url String URL to the ArcGIS Server REST resource that represents the tiled map service.
description String Map description.
copyright String Copyright text.
layerInfos MapServiceLayerInfo[] Layers available in the map service.
initialExtent GLatLngBounds Initial extent (bounding box) as defined by the map service.
fullExtent GLatLngBounds Full extent (bounding box) as defined by the map service.

Events

Event Arguments Description
load TiledMapServiceLayer, Error? This event is fired after the TiledMapServiceLayer finishes loading the tiled map service resource. The first argument is a reference to the object that was loaded. The second argument is an Error object that will be available in case there is an error.

class esri.arcgis.gmaps.TiledMapServiceLayerOptions

This class represents the options? argument to the TiledMapServiceLayer constructor. It is instantiated as JavaScript object literal.

Properties

Property Type Description
opacity Number Specifies the tile opacity as a number between 0.0 (invisible) and 1.0 (opaque). Default is 1.0.
minResolution Number Specifies the lowest zoom level for the tile layer. Default is 0.
maxResolution Number Specifies the highest zoom level for the tile layer. Default is 19.
copyrights GCopyrightCollection Specifies a copyright collection for the tile layer. This is used to generate the copyright messages of GMapType to which the tile layer may be added.

class esri.arcgis.gmaps.DynamicMapServiceLayer

An instance of this class represents a dynamic map service published with the ArcGIS Server. It implements the GOverlay interface and hence can be added to the map using GMap2.addOverlay method. In addition, you can also generate individual images from the associated map service by calling the exportMapImage method. It is important to note that you'll need to specify a server output directory when configuring the map service.

Warning: This class will not be available for a mapplet as the Google Mapplets API does not support GOverlay interface.

Constructor

Constructor Description
esri.arcgis.gmaps.DynamicMapServiceLayer(url, parameters?, opacity?, callback?)

Creates a new DynamicMapServiceLayer from the ArcGIS Server REST resource identified by the url. The optional parameters argument is an ImageParameters object that can be used to customize the image format, dpi and the layers to be shown. The opacity is given as a number between 0 and 1. If not given, the default is 1.

Once it has finished loading the resource, the load event will be fired and the optional callback function will be invoked. Both the callback and the event handlers will receive a reference to this object that can be added to your map using the GMap2.addOverlay method.

Properties

Property Type Description
url String URL to the ArcGIS Server REST resource that represents the dynamic map service.
description String Map description.
copyright String Copyright text.
layerInfos MapServiceLayerInfo[] Layers available in the map service.
initialExtent GLatLngBounds Initial extent (bounding box) as defined by the map service. If the map service is in a coordinate system that is not compatible with that of Google Maps, then the value of this property will be an object of the form:
{
 "xmin" : <xmin>, "ymin" : <ymin>, "xmax" : <xmax>, "ymax" : <ymax>,
 "spatialReference" : { "wkid" : <wkid> }
}

However, if Config.geometryServiceUrl property is set, then it will be implicitly used to project the above extent to WGS 1984 Geographic Coordinate System (Well-Known ID = 4326).

fullExtent GLatLngBounds Full extent (bounding box) as defined by the map service. If the map service is in a coordinate system that is not compatible with that of Google Maps, then the value of this property will be in the same format as described in initialExtent.

Methods

Method Return Value Description
exportMapImage(parameters?, callback?) none

Sends a request to the dynamic map service resource associated with this object to generate a map image using the ImageParameters specified in the parameters argument. (Since 1.2) If the parameters argument is not given, the generated map image will represent the current state of this layer.

On completion, the exportcomplete event will be fired and the optional callback function will be invoked. Both the callback and event handlers will receive a MapImage object.

setVisibleLayers(layerIds) none Sets the visible layers of the DynamicMapServiceLayer. The layerIds argument should be an array of layer IDs.
setDefaultVisibleLayers() none Resets the layers to their default visibility as set in the map document used to publish the map service.
setLayerDefinitions(layerDefs) none Sets the layer definitions used to filter the features of individual layers in the map service. The layerDefs argument is an array of layer definition expressions as shown in the code snippet below:
var layerDefs = [];
layerDefs[0] = "POPULATION > 5000000";
layerDefs[5] = "AREA > 100000";
dynamicMapServiceLayer.setLayerDefinitions(layerDefs);

Note that the array indices 0 and 5 are valid layer IDs; POPULATION and AREA are valid attribute fields associated with the respective layers. Definition expressions for layers that are currently not visible will be ignored by the server. Use setVisibleLayers and setDefaultVisibleLayers methods to manipulate the visiblity of layers.

setImageFormat(format) none (Since 1.3) Sets the map image format. Supported formats: png8, png24, jpg, gif, bmp. Default is "png8".
clearLayerDefinitions() none Removes all the layer definitions set using the setLayerDefinitions method.
setOpacity(opacity) none Sets the opacity of this overlay to the given value. The opacity is given as a number between 0 (fully transparent) and 1 (fully opaque).
getVisibleLayers() Number[] (Since 1.2) Returns an array of layer IDs of the currently visible map service layers.
getLayerDefinitions() String[] (Since 1.2) Returns an array of layer definitions set by the setLayerDefinitions method, or null, if the layer definitions are not set.
refresh() none (Since 1.2) Forces the layer to update the images shown on the map.
show() none Shows the overlay if it is currently hidden.
hide() none Hides the overlay if it is currently visible.
isHidden() Boolean Returns true if the overlay is currently hidden. Otherwise returns false.

Events

Event Arguments Description
load DynamicMapServiceLayer, Error? This event is fired after the DynamicMapServiceLayer finishes loading the dynamic map service resource. The first argument is a reference to the object that was loaded. The second argument is an Error object that will be available in case there was an error.
update none (Since 1.2) This event is fired whenever the dynamic map service layer is updated. The layer is updated when panning or zooming the map or when calling a method that changes the state of the layer. Note that the event is fired only after all the images are loaded.
exportcomplete MapImage, Error? This event is fired when a map image is returned from the server after invoking the DynamicMapServiceLayer.exportMapImage method. The first argument is a MapImage object that represents the dynamically generated map image. The second argument is an Error object that will be available in case there was an error.

class esri.arcgis.gmaps.ImageParameters

This class contains various options that can be specified when generating a map image. Instances of this class are used in: the parameters? argument to DynamicMapServiceLayer's constructor, the parameters argument to the exportMapImage method of DynamicMapServiceLayer, the parameters? argument to the getResultImage and getResultImageLayer methods of Geoprocessor.

Constructor

Constructor Description
esri.arcgis.gmaps.ImageParameters() Creates a new ImageParameters object.

Properties

Property Type Description
format String The image format. Supported formats: png8, png24, jpg, pdf, bmp, gif, svg. Default is "png8".
transparent Boolean Indicates whether or not the background color of the map is set as the image's transparent color. Default is true. Note that, only the png and gif formats support transparency and Internet Explorer 6 does not display transparency correctly for png24 image format.
dpi Number Resolution of the image in dots per inch. Default is 96.
layerIds* Number[] Array of layer IDs to be shown in the map image. See layerOption property for more information on how the layers specified here will be handled.
layerOption* String This option determines which layers appear on the image. There are four ways to specify which layers are shown:
"show" - only the layers specified in the list will be shown.
"hide" - all layers except those specified in the list will be shown.
"include" - in addition to the layers visible by default, the layers specified in the list will be shown.
"exclude" - the layers visible by default excluding those specified in the list will be shown.
Default is "show".
layerDefinitions* String[] Array of layer definition expressions that allows you to filter the features of individual layers in the exported map image. For example:
var imageParams = new esri.arcgis.gmaps.ImageParameters();
imageParams.layerDefinitions = [];
imageParams.layerDefinitions[0] = "POPULATION > 5000000";
imageParams.layerDefinitions[5] = "AREA > 100000";

Note that the array indices 0 and 5 are valid layer IDs; POPULATION and AREA are valid attribute fields associated with the respective layers. Definition expressions for layers that are not visible will be ignored by the server. Use layerIds and layerOption properties to manipulate the visiblity of layers.

bounds GLatLngBounds Extent (bounding box) of the map to be exported.
width Number Image width in pixels.
height Number Image height in pixels.

* layerIds, layerOption and layerDefinitions properties are ignored when an instance of this class is passed as an argument to getResultImage and getResultImageLayer methods of Geoprocessor.

class esri.arcgis.gmaps.MapImage

An instance of this class represents the data object for a dynamically generated map image. It is returned after successful completion of exportMapImage method of DynamicMapServiceLayer, exportImage method of ImageServiceLayer and getResultImage method of Geoprocessor. There is no constructor for this class.

Properties

Property Type Description
href String URL to the map image.
width Number Image width in pixels.
height Number Image height in pixels.
bounds GLatLngBounds The extent (bounding box) that defines the boundaries of the image.
scale Number The scale at which the image is created.

class esri.arcgis.gmaps.MapServiceLayerInfo

This class contains information about a layer in an ArcGIS Server map service (Tiled or Dynamic). There is no constructor for this class.

Properties

Property Type Description
id Number Unique layer ID.
name String Layer Name.
parentLayerId Number Layer ID of the parent, if this layer is part of a group layer, or -1 otherwise.
subLayerIds Number[] An array of sublayer IDs, if this layer is a group layer, or null otherwise.
defaultVisibility Boolean Indicates whether or not this layer is visible by default.

class esri.arcgis.gmaps.ImageServiceLayer

An instance of this class represents an image service published with the ArcGIS Server. An image service provides read-only access to a mosaicked collection of images or a raster data set. This class implements the GOverlay interface and hence can be added to the map using GMap2.addOverlay method. In addition, you can also generate individual images from the associated image service by calling the exportImage method. It is important to note that you'll need to specify a server output directory when configuring the image service.
(Since 1.2)

Warning: This class will not be available for a mapplet as the Google Mapplets API does not support GOverlay interface.

Constructor

Constructor Description
esri.arcgis.gmaps.ImageServiceLayer(url, parameters?, opacity?, callback?)

Creates a new ImageServiceLayer from the ArcGIS Server REST resource identified by the url. The optional parameters argument is an ImageServiceParameters object that can be used to modify the image format, interpolation method, compression quality and band combination. The opacity is given as a number between 0 and 1. If not given, the default is 1.

Once it has finished loading the resource, the load event will be fired and the optional callback function will be invoked. Both the callback and the event handlers will receive a reference to this object that can be added to your map using the GMap2.addOverlay method.

Properties

Property Type Description
url String URL to the ArcGIS Server REST resource that represents the image service.
name String The name of the image service.
description String The description of the image service.
copyright String Copyright information associated with the image service.
extent GLatLngBounds The extent (bounding box) of the image service. If the image service is in a coordinate system that is not compatible with that of Google Maps, then the value of this property will be an object of the form:
{
 "xmin" : <xmin>, "ymin" : <ymin>, "xmax" : <xmax>, "ymax" : <ymax>,
 "spatialReference" : { "wkid" : <wkid> }
}

However, if Config.geometryServiceUrl property is set, then it will be implicitly used to project the above extent to WGS 1984 Geographic Coordinate System (Well-Known ID = 4326).

pixelType String The pixel type of the image service. Pertains to the type of values stored in the raster, such as signed integer, unsigned integer, or floating point. Integers are whole numbers, whereas floating points have decimals. It can have one of the following values: C64, C128, F32, F64, S8, S16, S32, U1, U2, U4, U8, U16, U32, UNKNOWN
pixelSize GSize The pixel size of the image service, in its native units.
minPixelSize Number The minimum visible pixel size.
maxPixelSize Number The maximum visible pixel size.
serviceDataType String The data type of the image service. It can have one of the following values:

"esriImageServiceDataTypeElevation" - the elevation data type for elevation data.
"esriImageServiceDataTypeGeneric" - the generic data type for any data.
"esriImageServiceDataTypeRGB" - the RGB data type for RGB true color image.
"esriImageServiceDataTypeThematic" - the thematic data type for categorical data.

bands Object[] The raster bands that the raster dataset is composed of, and their statistics. The length of this array gives the number of bands and the array index represents the band ID. It is an object of the form:
[
 {
   "min": <Number>,
   "max": <Number>,
   "mean": <Number>,
   "stddev": <Number>

 },
 ...
]

Methods

Method Return Value Description
exportImage(parameters?, callback?) none

Sends a request to the image service resource associated with this object to generate a map image using the ImageServiceParameters specified in the parameters argument. If the parameters argument is not given, the generated map image will represent the current state of this layer.

On completion, the exportcomplete event will be fired and the optional callback function will be invoked. Both the callback and event handlers will receive a MapImage object.

setInterpolation(method) none Sets the interpolation method - the resampling process of extrapolating the pixel values while transforming the raster dataset when it undergoes warping or when it changes coordinate space. The following methods are supported:

"RSP_BilinearInterpolation" - resample pixel by bilinear interpolation.
"RSP_CubicConvolution" - resample pixel by cubic convolution.
"RSP_Majority" - resample pixel by majority value.
"RSP_NearestNeighbor" - resample pixel by nearest neighbor.

setCompressionQuality(value) none Sets the compression quality - controls how much loss the image will be subjected to by the compression algorithm. It is specified as a number in the range 0 to 100. Only applicable to jpg image types.
setBandIds(bandIds) none Sets the band selection. If there are multiple bands, you can specify a single band to export, or you can change the band combination (red, green, blue) by specifying the band IDs. The bandIds argument should be an array of band IDs.
setImageFormat(format) none (Since 1.3) Sets the image format. Supported formats: png8, png24, jpg, gif, bmp. Default is "png8".
setOpacity(opacity) none Sets the opacity of this overlay to the given value. The opacity is given as a number between 0 (fully transparent) and 1 (fully opaque).
refresh() none Forces the layer to update the images shown on the map.
show() none Shows the overlay if it is currently hidden.
hide() none Hides the overlay if it is currently visible.
isHidden() Boolean Returns true if the overlay is currently hidden. Otherwise returns false.

Events

Event Arguments Description
load ImageServiceLayer, Error? This event is fired after the ImageServiceLayer finishes loading the image service resource. The first argument is a reference to the object that was loaded. The second argument is an Error object that will be available in case there was an error.
update none This event is fired whenever the image service layer is updated. The layer is updated when panning or zooming the map or when calling a method that changes the state of the layer. Note that the event is fired only after all the images are loaded.
exportcomplete MapImage, Error? This event is fired when a map image is returned from the server after invoking the ImageServiceLayer.exportImage method. The first argument is a MapImage object that represents the dynamically generated map image. The second argument is an Error object that will be available in case there was an error.

class esri.arcgis.gmaps.ImageServiceParameters

This class contains various options that can be specified when generating a map image from an image service resource. Instances of this class are used in: the parameters argument to ImageServiceLayer's constructor, the parameters argument to the exportImage method of ImageServiceLayer.
(Since 1.2)

Constructor

Constructor Description
esri.arcgis.gmaps.ImageServiceParameters() Creates a new ImageServiceParameters object.

Properties

Property Type Description
interpolation String The interpolation method - the resampling process of extrapolating the pixel values while transforming the raster dataset when it undergoes warping or when it changes coordinate space. The following methods are supported:

"RSP_BilinearInterpolation" - resample pixel by bilinear interpolation.
"RSP_CubicConvolution" - resample pixel by cubic convolution.
"RSP_Majority" - resample pixel by majority value.
"RSP_NearestNeighbor" - resample pixel by nearest neighbor.

compressionQuality Number The compression quality - controls how much loss the image will be subjected to by the compression algorithm. It is specified as a number in the range 0 to 100. Only applicable to jpg image types.
bandIds Number[] The band selection as an array of band IDs. If there are multiple bands, you can specify a single band to export, or you can change the band combination (red, green, blue) by specifying the band IDs.
bounds GLatLngBounds Extent (bounding box) of the image to be exported.
width Number Image width in pixels.
height Number Image height in pixels.
format String The image format. Supported formats: png8, png24, jpg, bmp, gif. Default is "png8".

class esri.arcgis.gmaps.QueryTask

This class is used to perform a query operation on a layer resource of a map service exposed by the ArcGIS Server REST API.

Constructor

Constructor Description
esri.arcgis.gmaps.QueryTask(url) Creates a new QueryTask object that is used to execute a query on the layer resource identified by the url.

Properties

Property Type Description
url String URL to the ArcGIS Server REST resource that represents a layer.

Methods

Method Return Value Description
execute(parameters, asGeoXml?, callback?) none

Executes a query on the layer resource. The parameters argument is a Query object that specifies the attribute and spatial filters of the query.

On completion, the executecomplete event will be fired and the optional callback function will be invoked. Both the callback and event handlers will receive the features matching your query in a FeatureSet object that gives you access to individual features in the resultset and their attributes and geometry. Instead, if you set the optional asGeoXml argument to true, a GGeoXml object representing the resultset in KML data format will be returned. Either way, you can add them to your map using MapExtension.addToMap method. However, with KML, you can view the matching features in the symbology set by the map author.

Events

Event Arguments Description
executecomplete FeatureSet or GGeoXml, Error? This event is fired when the query operation is completed. The first argument is either a FeatureSet or GGeoXml depending on your choice for the asGeoXml argument in execute() method. The second argument is an Error object that will be available in case there was an error.

class esri.arcgis.gmaps.Query

An instance of this class is used as the parameters argument to QueryTask.execute method. It is used to specify the attribute and spatial parameters for a query operation.

Constructor

Constructor Description
esri.arcgis.gmaps.Query() Creates a new Query object.

Properties

Property Type Description
queryGeometry GLatLng or GLatLng[] or GLatLngBounds or GPolyline or GPolyline[] or GPolygon or GPolygon[] The geometry to apply as the spatial filter.
spatialRelationship SpatialRelationship The spatial relationship to be applied on the input geometry while performing the query. Valid values are defined in the SpatialRelationship enumeration. Default is esri.arcgis.gmaps.SpatialRelationship.INTERSECTS.
where String A where clause for the query filter. Any legal SQL Where clause operating on the fields in the layer is allowed.
text String A literal search text. If the layer has a display field associated with it, the server will search for this text in this field. This property is a shorthand for a where clause of the form:
<displayField> like '%text%'
outFields String[] Specifies an array of attribute field names (not the field aliases) to be included in the returned resultset. If this property is not set, only the primary display field of the layer will be returned.
returnGeometry Boolean Indicates whether or not the resultset should include the geometries associated with the matching features. Default is true.

enum esri.arcgis.gmaps.SpatialRelationship

These constants represent the spatial relationships that can be applied on the input geometry while performing a query operation. They are used in the spatialRelationship property of a Query object.

Constants

Constant Description
INTERSECTS Returns features that partially or fully fall within the area of the query geometry.
CONTAINS Returns features that are wholly contained within the query geometry.
CROSSES Returns features that cross the query geometry. Note that, two lines that share a common endpoint do not cross.
ENVELOPE_INTERSECTS Returns features whose bounding boxes intersect the bounding box of query geometry.
INDEX_INTERSECTS Returns features whose index entries intersect the bounding box of query geometry.
OVERLAPS Returns features that have the same dimension as the query geometry and their intersection sets (with the query geometry) result in a geometry different from both but of the same dimension.
TOUCHES Returns features that share a common boundary with the query geometry.
WITHIN Returns features that wholly contain the query geometry.

class esri.arcgis.gmaps.FeatureSet

This class represents the results of a query operation performed on a layer. It contains all of the features that satisfy a set of attribute and spatial constraints specified when initiating the query operation. An instance of this class can also be used as an input parameter to a GP task and returned by a GP task as an output parameter (result). It can be added to your map using MapExtension.addToMap method.

Constructor

Constructor Description
esri.arcgis.gmaps.FeatureSet() Creates a new FeatureSet object that is used as an input parameter to a GP task. See Geoprocessor.execute for more information.

Properties

Property Type Description
features Feature[] A collection of features each having the same spatial representation, such as points, polylines, or polygons and a common set of attribute fields.
geometryType String The type of geometry associated with the features. Values: "esriGeometryPoint", "esriGeometryMultipoint", "esriGeometryPolyline", "esriGeometryPolygon".
displayFieldName String The name of a layer's primary display field. The value of this property will match the name of one of the attributes of the features. It can be used as the title of a marker.
fieldAliases Object (Since 1.2) Set of name-value pairs representing the attribute fields of a layer and their corresponding alias names. A field alias is typically a more readable version of a field name. The value of this property is an object of the form:
{
  "<fieldName1>" : "<fieldAlias1>",
  "<fieldName2>" : "<fieldAlias2>",
  "<fieldName3>" : "<fieldAlias3>"
}

For example,

{
  "ST" : "State Name",
  "POP2000" : "Population - 2000",
  "AREANAME" : "City Name"
}

class esri.arcgis.gmaps.Feature

This class represents a spatial object that has an associated shape (geometry) and attribute information. It can be added to your map using MapExtension.addToMap method.

Constructor

Constructor Description
esri.arcgis.gmaps.Feature() Creates a new Feature object.

Properties

Property Type Description
geometry GOverlay[] The geometry shape associated with the feature. The following list maps the ArcGIS geometry types to their corresponding GOverlay equivalents:
esriGeometryPoint - A single element array of GMarker.
esriGeometryMultipoint - An array of GMarker objects.
esriGeometryPolyline - An array of GPolyline objects. Each element in the array represents a "path".
esriGeometryPolygon - An array of GPolygon objects. Each element in the array represents a "ring".

attributes Object Specifies the descriptive properties (or fields) that define the state of the feature. It is an object literal of the form:
{
  "<fieldName1>" : <fieldValue1>,
  "<fieldName2>" : <fieldValue2>,
  "<fieldName3>" : <fieldValue3>

}

For example,

{
  "AREANAME" : "Lawrence",
  "STATE" : "KS",
  "CLASS" : "city",
  "AREALAND" : 28.111,
  "AREAWATER" : 0.586,
  "POP2000" : 80098,
  "MALES" : 39803,
  "FEMALES" : 40295
} 

class esri.arcgis.gmaps.IdentifyTask

This class is used to perform an identify operation on the layers of a map service resource exposed by the ArcGIS Server REST API.

Constructor

Constructor Description
esri.arcgis.gmaps.IdentifyTask(url) Creates a new IdentifyTask object that is used to identify features in a map of the map service given by url.

Properties

Property Type Description
url String URL to the ArcGIS Server REST resource that represents the map service.

Methods

Method Return Value Description
execute(parameters, callback?) none

Sends a request to the ArcGIS Server REST map service resource associated with this object to identify features based on the IdentifyParameters specified in the parameters argument.

On completion, the executecomplete event will be fired and the optional callback function will be invoked. Both the callback and event handlers will receive an IdentifyResults object that gives you access to the features identified and the layers these features were found in. You can add the results to your map using MapExtension.addToMap method.

Events

Event Arguments Description
executecomplete IdentifyResults, Error? This event is fired when the identify operation is completed. The first argument is an IdentifyResults object. The second argument is an Error object that will be available in case there was an error.

class esri.arcgis.gmaps.IdentifyParameters

An instance of this class is used as the parameters argument to IdentifyTask.execute method. It specifies the criteria used to identify the features.

Constructor

Constructor Description
esri.arcgis.gmaps.IdentifyParameters() Creates a new IdentifyParameters object.

Properties

Property Type Description
geometry GLatLng or GLatLng[] or GLatLngBounds or GPolyline or GPolyline[] or GPolygon or GPolygon[] The geometry to identify on.
tolerance Number The distance in screen pixels from the specified geometry within which the identify is performed. (Since 1.3) Default is 2 pixels.
layerIds Number[] The layers to perform the identify operation on. When both the layerIds and layerOption properties are specified, the server processes them with a boolean "AND" operator. See layerOption property for more ways to specify the layers.
layerOption String The layers to perform the identify operation on. There are three ways to specify the layers to identify on:
"top" - only the top-most layer at the specified location.
"visible" - all visible layers at the specified location.
"all" - all layers at the specified location.
Default is "top".
bounds GLatLngBounds Extent (bounding box) of the map currently being viewed. The bounds, width, height and dpi properties are used by the server to determine the layers visible in the current extent. They are also used to calculate the distance on the map to search based on the tolerance in screen pixels.
width Number Width of the map currently being viewed (in pixels).
height Number Height of the map currently being viewed (in pixels).
dpi Number Resolution of the current map view in dots per inch. Default is 96.
returnGeometry Boolean Indicates whether or not the resultset should include the geometries associated with the features. Default is true.

class esri.arcgis.gmaps.IdentifyResults

This class represents a collection of features returned by an identify operation. It can be added to your map using MapExtension.addToMap method. There is no constructor for this class.

Properties

Property Type Description
identifyResults IdentifyResult[] The result collection that provides access to the map features identified and their attribute values.

class esri.arcgis.gmaps.IdentifyResult

An instance of this class represents a result object of identify operation. It can be added to your map using MapExtension.addToMap method. There is no constructor for this class.

Properties

Property Type Description
feature Feature An identified feature.
layerId Number Unique ID of the layer that contains the feature.
layerName String The layer name.
displayFieldName String The name of the layer's primary display field. The value of this property will match the name of one of the attributes of the feature.

class esri.arcgis.gmaps.FindTask

This class is used to search a map service, exposed by the ArcGIS Server REST API, for a string value. The search can be conducted on a single field of a single layer, on many fields of a layer or on many fields of many layers.

Constructor

Constructor Description
esri.arcgis.gmaps.FindTask(url) Creates a new FindTask object that is used to search layers and fields of the map service given by url.

Properties

Property Type Description
url String URL to the ArcGIS Server REST resource that represents the map service.

Methods

Method Return Value Description
execute(parameters, callback?) none

Sends a request to the ArcGIS Server REST map service resource associated with this object to perform a search based on the FindParameters specified in the parameters argument.

On completion, the executecomplete event will be fired and the optional callback function will be invoked. Both the callback and event handlers will receive a FindResults object that gives you access to the features (their attributes and geometry), layers and fields matching the search criteria. You can add the result collection to your map using MapExtension.addToMap method.

Events

Event Arguments Description
executecomplete FindResults, Error? This event is fired when the find operation is completed. The first argument is an FindResults object. The second argument is an Error object that will be available in case there was an error.

class esri.arcgis.gmaps.FindParameters

An instance of this class is used as the parameters argument to FindTask.execute method. It specifies the search criteria for a find operation.

Constructor

Constructor Description
esri.arcgis.gmaps.FindParameters() Creates a new FindParameters object.

Properties

Property Type Description
searchText String The search string. This is the text that is searched across the layers and fields specified in layerIds and searchFields properties.
contains Boolean Indicates whether or not a match should contain the searchText string. Default is true. Set this property to false if you want an exact match.
searchFields String[] The names of the fields to search - specified as an array of field names. If this property is not set, all fields are searched.
layerIds Number[] The layers to perform the find operation on - specified as an array of layer IDs.
returnGeometry Boolean Indicates whether or not the resultset should include the geometries associated with the features. Default is true.

class esri.arcgis.gmaps.FindResults

This class represents a collection of features returned by a find operation. It can be added to your map using MapExtension.addToMap method. There is no constructor for this class.

Properties

Property Type Description
findResults FindResult[] The result collection that provides access to the features that matched the search criteria, and their attribute values.

class esri.arcgis.gmaps.FindResult

An instance of this class represents a result object of find operation. It can be added to your map using MapExtension.addToMap method. There is no constructor for this class.

Properties

Property Type Description
feature Feature A feature that has attribute(s) matching the search criteria.
layerId Number Unique ID of the layer that contains the feature.
layerName String The layer name.
foundFieldName String The name of the field that contains the searchText. feature.attributes.foundFieldName property contains the found value.
displayFieldName String The name of the layer's primary display field. The value of this property will match the name of one of the attributes of the feature.

class esri.arcgis.gmaps.Locator

This class represents a geocode service resource exposed by the ArcGIS Server REST API. It is used to generate candidates for an address (geocode) and to find an address for a geographic location (reverse geocode).

Constructor

Constructor Description
esri.arcgis.gmaps.Locator(url) Creates a new Locator object that is used to perform geocoding tasks on the geocode service resource given by the url.

Properties

Property Type Description
url String URL to the ArcGIS Server REST resource that represents the geocode service.

Methods

Method Return Value Description
addressToLocations(address, outFields?, asGeoXml?, callback?) none Sends a request to the ArcGIS Server REST geocode resource associated with this locator to find candidates for a single address specified in the address argument. The address argument is an object literal that contains properties representing the various address fields accepted by the corresponding geocode service. These fields are listed in the addressFields property of the associated geocode service resource. For example, if the addressFields of a geocode service resource includes fields with the following names: Street, City, State and Zone, then the address argument would be of the form:
{
  Street: "380 New York Street",
  City: "Redlands",
  State: "CA",
  Zone: "92373"
}

The optional outFields argument specifies an array of attribute field names to be included in the returned resultset. For non-intersection addresses you can specify the candidate fields from the geocode service resource. For intersection addresses you can specify the intersection candidate fields from the geocode service resource. Note that the shape field is ignored. If this argument is not specified, then the resultset will not have any attribute fields.

On completion, the addresstolocationscomplete event will be fired and the optional callback function will be invoked. Both the callback and event handlers will receive an AddressResults object that contains the candidates that matched the given address as well as their scores. Instead, if you set the optional asGeoXml argument to true, a GGeoXml object representing the candidates in KML data format will be returned. Either way, you can add them to your map using MapExtension.addToMap method.

locationToAddress(point, distance, asGeoXml?, callback?) none

Sends a request to the ArcGIS Server REST geocode resource associated with this locator to find the address closest to the given point, and within the specified search distance.

On completion, the locationtoaddresscomplete event will be fired and the optional callback function will be invoked. Both the callback and event handlers will receive an AddressCandidate object that contains the address fields pertaining to the reverse geocoded address as well as its exact location. Instead, if you set the optional asGeoXml argument to true, a GGeoXml object representing the address in KML data format will be returned. Either way, you can add them to your map using MapExtension.addToMap method.

Events

Event Arguments Description
addresstolocationscomplete AddressResults or GGeoXml, Error? This event is fired when the addressToLocations operation is completed. The first argument is an AddressResults object or GGeoXml depending on your choice for the asGeoXml argument in addressToLocations() method. The second argument is an Error object that will be available in case there was an error.
locationtoaddresscomplete AddressCandidate or GGeoXml, Error? This event is fired when the locationToAddress operation is completed. The first argument is an AddressCandidate object or GGeoXml depending on your choice for the asGeoXml argument in locationToAddress() method. The second argument is an Error object that will be available in case there was an error.

class esri.arcgis.gmaps.AddressResults

This class represents a collection of address candidate objects returned by addressToLocations operation performed on a Locator. It can be added to your map using MapExtension.addToMap method. There is no constructor for this class.

Properties

Property Type Description
addressCandidates AddressCandidate[] The result collection that provides access to the candidates for an address.

class esri.arcgis.gmaps.AddressCandidate

This class contains properties that describe an address and its geographic location. It can be added to your map using MapExtension.addToMap method. There is no constructor for this class.

Properties

Property Type Description
address Object The address. It contains one property for each of the address fields defined by a geocode service. Each address field describes some part of the address information for the candidate.
location GMarker A marker bound to the geographic location of the address.
score Number A match score that indicates how well the candidate matches the address. It is specified as a number between 0 (no match) and 100 (exact match).
attributes Object Specifies the candidate fields of a non-intersection address or the intersection candidate fields of an intersection address. It is an object literal of the form:
{
  "<fieldName1>" : <value1>,
  "<fieldName2>" : <value2>,
  "<fieldName3>" : <value3>

}

For example,

{
  "StreetName1" : "MARKET",
  "Type1" : "ST",
  "LeftZone1" : "94103",
  "StreetName2" : "STOCKTON",
  "Type2" : "ST",
  "LeftZone2" : "94108"
}

class esri.arcgis.gmaps.RouteTask

A route task is used to obtain a route and driving directions for a given set of locations (or stops). It is associated with a network layer of type esriNAServerRouteLayer in a network analysis service published by ArcGIS Server. You can also specify barriers in the vicinity of the stops that need to be taken into account for the route analysis.
(Since 1.4, requires ArcGIS Server 9.3.1 or later)

Constructor

Constructor Description
esri.arcgis.gmaps.RouteTask(url) Creates a new route task object that is associated with the network layer resource identified by the given url.

Properties

Property Type Description
url String URL to the ArcGIS Server REST resource that represents a network layer.

Methods

Method Return Value Description
solve(parameters, callback?) none

Performs a solve operation on the network layer resource associated with this object. The parameters argument is an instance of RouteParameters class that provides arguments to the solve route operation.

On completion, the solvecomplete event will be fired and the optional callback function will be invoked. Both the callback and event handlers will receive a RouteResults object.

Events

Event Arguments Description
solvecomplete RouteResults, Error? This event is fired when a route is solved. The first argument is a RouteResults object. The second argument is an Error object if the server returned an error message.

class esri.arcgis.gmaps.RouteParameters

This class represents the arguments supported by the solve route operation. An instance of this class is used as the parameters argument to the solve method of RouteTask.
(Since 1.4)

Constructor

Constructor Description
esri.arcgis.gmaps.RouteParameters() Creates a new RouteParameters object that is passed as an argument to the solve route operation.

Properties

Property Type Description
accumulateAttributes String[] The list of network attribute names to be accumulated with the analysis. You can specify any attribute names listed in the Services Directory under "Network Dataset -> Network Attributes" as "Usage Type: esriNAUTCost". You can specify "none" as the attribute name to indicate that no network attributes should be accumulated. The default is as defined in the network layer.
barriers FeatureSet or DataLayer The set of barriers loaded as network locations during analysis. You can specify 2 types of barriers:
  • Features: Barrier geometries and attributes expressed as a feature set.
  • Layer: Barriers reference a data layer in the map service.
directionsLanguage String The language to be used when computing directions. The default is as defined in the network layer. By default, NAServer gets installed with en_US only - it is up to the server administrator to add additional languages.
directionsLengthUnits Units The length units to use when computing directions. The default is as defined in the network layer.
directionsTimeAttribute String The name of network attribute to use for the drive time when computing directions. The default is as defined in the network layer.
doNotLocateOnRestrictedElements Boolean If true, the solver will avoid network elements restricted by barriers or due to restrictions specified in restrictionAttributes. Default is false.
findBestSequence Boolean If true, the solver should reorder stops to find optimal route (while taking into account preserveFirstStop and preserveLastStop if they were set to true). The default is as defined in the network layer.
ignoreInvalidLocations Boolean When false, the solve operation will fail if at least one of the stops specified cannot be located or reached. If true, invalid locations are ignored and route(s) will be returned as long as there are at least two valid stops that have been connected by a route. If multiple routes are processed in a single request, a valid result will be returned as long as at least one route is built. The list of routes that cannot be solved is included in RouteResults.messages property. The default is as defined in the network layer.
impedanceAttribute String The network attribute name to be used as the impedance attribute in analysis. You can specify any attribute name listed in the Services Directory under "Network Dataset -> Network Attributes" as "Usage Type: esriNAUTCost". The default is as defined in the network layer.

For example, set impedanceAttribute to "Time" for the fastest route or "Length" for the shortest route, assuming the service has those two cost attributes.

outputLines NAOutputLine The type of output lines to be generated in the result. Applicable only if returnRoutes is true. The default is as defined in the network layer.
outputGeometryPrecision Number The precision of the output geometry after generalization. If 0, no generalization of output geometry is performed. If present and positive, it represents the MaximumAllowableOffset parameter - generalization is performed according to IPolycurve.Generalize.
outputGeometryPrecisionUnits Units The units of the output geometry precision. Default is null.
preserveFirstStop Boolean If true, the solver should keep the first stop fixed in the sequence. Applicable only if findBestSequence is true. The default is as defined in the network layer.
preserveLastStop Boolean If true, the solver should keep the last stop fixed in the sequence. Applicable only if findBestSequence is true. The default is as defined in the network layer.
restrictionAttributes String[] The list of network attribute names to be used as restrictions with the analysis. You can specify any attribute names listed in the Services Directory under "Network Dataset -> Network Attributes" as "Usage Type: esriNAUTRestriction". You can also specify "none" as the attribute name to indicate that no network attributes should be used as restrictions. The default is as defined in the network layer.
restrictUTurns NAUTurn Specifies how U-Turns should be handled in the analysis. The default is as defined in the network layer.
returnBarriers Boolean If true, barriers will be returned with the analysis results. Default is false.
returnDirections Boolean If true, directions will be generated and returned with the analysis results. Default is false.
returnRoutes Boolean If true, routes will be returned with the analysis results. Default is true.
returnStops Boolean If true, stops will be returned with the analysis results. Default is false.
startTime Date The time the route begins. If not specified, the solver will not start the route at a particular time.
stops FeatureSet or DataLayer The set of stops loaded as network locations during analysis. You can specify 2 types of stops:
  • Features: Stop geometries and attributes expressed as a feature set. If you want to solve multiple routes, you can provide a RouteName attribute for each stop in such a way that stops belonging to a specific route have identical route names.
  • Layer: Stops reference a data layer in the map service. Attribute and spatial filters can also be applied on the layer.
useHierarchy Boolean If true, the hierarchy attribute for the network should be used in analysis. The default is as defined in the network layer.
useTimeWindows Boolean If true, the solver should consider time windows. The default is as defined in the network layer.

class esri.arcgis.gmaps.DataLayer

This class represents a data layer in the map service that is used to specify stops and barriers for a solve route operation.
(Since 1.4)

Constructor

Constructor Description
esri.arcgis.gmaps.DataLayer() Creates a new data layer object.

Properties

Property Type Description
name String The name of the data layer in the map service that is being referenced.
where String A where clause for the query filter. Any legal SQL where clause operating on the fields in the layer is allowed.
geometry GLatLng or GLatLng[] or GLatLngBounds or GPolyline or GPolyline[] or GPolygon or GPolygon[] The geometry to apply as the spatial filter. The spatial relationship as specified by spatialRelationship is applied to this geometry while performing the query.
spatialRelationship SpatialRelationship The spatial relationship to be applied on the input geometry. The supported spatial relationships include intersects, contains, envelope intersects, within, etc.

enum esri.arcgis.gmaps.NAOutputLine

These constants represent the types of output lines that can be generated for the routes.
(Since 1.4)

Constants

Constant Description
NONE Do not generate lines.
STRAIGHT Generate straight lines from one stop to the next.
TRUE_SHAPE Generate lines that follow the street geometries.
TRUE_SHAPE_WITH_MEASURE Generate lines that follow the street geometries and have Ms corresponding to the impedance to travel along the line.

enum esri.arcgis.gmaps.NAUTurn

These constants represent various restrictions that can be applied to U-Turns in a route analysis.
(Since 1.4)

Constants

Constant Description
ALLOW_BACKTRACK Allow U-Turns anywhere.
AT_DEAD_ENDS_ONLY Only allow U-Turns at dead ends.
NO_BACKTRACK Do not allow U-Turns.

enum esri.arcgis.gmaps.Units

These constants represent various units of measurement that can be used to quantify the geometry length and precision values in a route analysis.
(Since 1.4)

Constants

Constant Description
CENTIMETERS Centimeters.
DECIMAL_DEGREES Decimal degrees.
DECIMETERS Decimeters.
FEET Feet.
INCHES Inches.
KILOMETERS Kilometers.
METERS Meters.
MILES Miles.
MILLIMETERS Millimeters.
NAUTICAL_MILES Nautical miles.
POINTS Points.
UNKNOWN Unknown.
YARDS Yards.

class esri.arcgis.gmaps.RouteResults

This class represents the collection of routes returned by a solve route operation. There is no constructor for this class.
(Since 1.4)

Properties

Property Type Description
results RouteResult[] Routes generated by the server.
barriers Feature[] Barries used in the analysis. They are returned only if RouteParameters.returnBarriers was set to true. See "Barrier properties" section in Finding the best route topic for the list of attributes returned for each barrier.
messages GPMessage[] Errors and warning messages generated during the analysis.

class esri.arcgis.gmaps.RouteResult

An instance of this class provides information pertaining to a single route - such as its name, stops and turn-by-turn directions. There is no constructor for this class.
(Since 1.4)

Properties

Property Type Description
directions DirectionsFeatureSet Turn-by-turn directions for the route. Returned only if RouteParameters.returnDirections was set to true.
route Feature The route as a polyline feature. Returned only if RouteParameters.returnRoutes was set to true. See "Route properties" section in Finding the best route topic for the list of attributes associated with the route.
routeName String The name of the route.
stops Feature[] Stops used in the analysis. Returned only if RouteParameters.returnStops was set to true. See "Stop properties" section in Finding the best route topic for the list of attributes returned for each stop.

class esri.arcgis.gmaps.DirectionsFeatureSet

This class provides turn-by-turn driving directions and the summary for a route. There is no constructor for this class.
(Since 1.4)

Properties

Property Type Description
features Feature[] An array of polyline features, each representing a single segment in the route. The attributes for each feature provide information associated with the corresponding route segment. The following attributes are returned:
text - The direction text.
length - The length of the route segment.
time - The time to travel along the route segment.
ETA - The estimated time of arrival at the route segment, represented in milliseconds since midnight Jan 1, 1970 in the local time of the first stop.
maneuverType - The type of maneuver that the direction represents.

See here for the list of maneuver types.

geometryType String The type of geometry associated with the features. It should always be: "esriGeometryPolyline"
bounds GLatLngBounds Extent of the route.
mergedGeometry GPolyline A single polyline representing the route.
routeId String The route id returned by the server.
routeName String The name of the route.
totalLength Number The total length of the route in directions length units (RouteParameters.directionsLengthUnits).
totalTime Number The total time of the route as specified by the directions time attribute (RouteParameters.directionsTimeAttribute).
totalDriveTime Number Actual driving time for the route in the units specified by the directions time attribute.

class esri.arcgis.gmaps.Geoprocessor

This class represents a GP Task resource exposed by the ArcGIS Server REST API. A GP Task resource represents a single task in a GP service published using the ArcGIS Server and it supports one of the following operations:
"Execute Task" - performed on a GP Task resource when the execution type is synchronous;
"Submit Job" - performed on an asynchronous GP Task resource.

Constructor

Constructor Description
esri.arcgis.gmaps.Geoprocessor(url, options?) Creates a new Geoprocessor object that represents the GP Task identifed by url. The optional options? argument is an object literal that specifies a set of GeoprocessorOptions including some parameters used by the geoprocessing environment.

Properties

Property Type Description
url String URL to the ArcGIS Server REST resource that represents the GP Task.

Methods

Method Return Value Description
execute(parameters, asGeoXml?, callback?) none Sends a request to the GP Task resource associated with this object to perform a synchronous GP task execution. The parameters argument specifies the input parameters accepted by the task and their corresponding values. These input parameters are listed in the parameters field of the associated GP Task resource. For example, assume that a GP Task resource has the following input parameters:
Input_Points (GPFeatureRecordSetLayer)
Distance (GPLinearUnit)
Drive_Times_in_Minutes (GPString)
Contour_Interval (GPDouble)

The parameters argument for the above inputs is an object literal of the form:

{
 Input_Points: <FeatureSet>,
 Distance: <LinearUnit>,
 Drive_Times_in_Minutes: <String>,
 Contour_Interval: <Number>
}

On completion, the executecomplete event will be fired and the optional callback function will be invoked. Both the callback and event handlers will receive a GPResults object that gives you access to the result parameters and the task execution messages. Instead, if you set the optional asGeoXml argument to true, a GGeoXml object representing the resultset in KML data format will be returned. Either way, you can add them to your map using MapExtension.addToMap method. However, with KML, you can view the results in the symbology set by the map author.

submitJob(parameters, statusCallback?, callback?) none

Submits a job to the GP Task resource associated with this object for asynchronous processing. The parameters argument is an object literal that specifies the input parameters accepted by the task and their corresponding values. The structure of this argument is same as that described in execute() method.

Once the job is submitted and until it is completed, the jobstatusupdate event will be fired and the optional statusCallback function will be invoked at regular intervals, the duration of which is specified by the GeoprocessorOptions.statusUpdateInterval property. Both the statusCallback and event handlers will receive a JobInfo object that provides basic information about the job such as the job ID, status and messages.

On job completion, the jobcomplete event will be fired and the optional callback function will be invoked. Both the callback and event handlers will receive a JobInfo object. The task execution results can be retrieved using getResultData(), getResultImage() or getResultImageLayer() methods.

checkJobStatus(jobId, callback?) none

Sends a request to the GP Task resource associated with this object to get the current state of the job identified by jobId.

Upon receiving the response, the jobstatusupdate event will be fired and the optional callback function will be invoked with a JobInfo object that contains the status information.

cancelJobStatusUpdates(jobId) none Cancels the periodic job status updates (initiated automatically when you invoke submitJob()) for the job identified by jobId. Note that, you can still obtain the status of this job by calling the checkJobStatus() method at your own discretion.
getResultData(jobId, resultParameterName, asGeoXml?, callback?) none

Sends a request to the GP Task resource associated with this object to get the task result identified by jobId and resultParameterName.

On completion, the getresultdatacomplete event will be fired and the optional callback function will be invoked. Both the callback and event handlers will receive a ParameterValue whose structure is based on its data type. Instead, if you set the optional asGeoXml argument to true, a GGeoXml object representing the result in KML data format will be returned. Either way, you can add them to your map using MapExtension.addToMap method. However, with KML, you can view the results in the symbology set by the map author.

getResultImage(jobId, resultParameterName, parameters?, callback?) none

Sends a request to the GP Task resource associated with this object to get the task result identified by jobId and resultParameterName as an image. The optional parameters argument is an ImageParameters object that specifies the properties of the result image.

On completion, the getresultimagecomplete event will be fired and the optional callback function will be invoked. Both the callback and event handlers will receive a MapImage object.

getResultImageLayer(jobId, resultParameterName, parameters?) DynamicMapServiceLayer Returns the task result identified by jobId and resultParameterName as a DynamicMapServiceLayer that can be added to your map using GMap2.addOverlay method. The optional parameters argument is an ImageParameters object that is used to customize the images generated for the dynamic map layer.

Events

Event Arguments Description
executecomplete GPResults or GGeoXml, Error? This event is fired when a synchronous GP task (execute operation) is completed. The first argument is a GPResults object or GGeoXml depending on your choice for the asGeoXml argument in execute() method. The second argument is an Error object that will be available in case there was an error.
jobcomplete JobInfo, Error? This event is fired when an asynchronous GP task (submit job operation) is completed. The first argument is a JobInfo object. The second argument is an Error object that will be available in case there was an error.
jobstatusupdate JobInfo, Error? This event is fired when a job status update is available. The first argument is a JobInfo object. The second argument is an Error object that will be available in case there was an error.
getresultdatacomplete ParameterValue or GGeoXml, Error? This event is fired when the result of an asynchronous GP task execution is available. The first argument is a ParameterValue or GGeoXml depending on your choice for the asGeoXml argument in getResultData() method. The second argument is an Error object that will be available in case there was an error.
getresultimagecomplete MapImage, Error? This event is fired when a map image is generated by invoking the getResultImage() method. The first argument is a MapImage object. The second argument is an Error object that will be available in case there was an error.

class esri.arcgis.gmaps.GeoprocessorOptions

Instances of this class are used in the options? argument to Geoprocessor's constructor. This class is instantiated as JavaScript object literal.

Properties

Property Type Description
statusUpdateInterval Number Specifies the time interval (in milliseconds) between each job status request sent to an asynchronous GP Task. Default is 1000 milliseconds.
processSpatialReference Number The Well-Known ID (wkid) of the spatial reference that a GP model will use to perform geometry operations.
outSpatialReference Number The Well-Known ID (wkid) of the spatial reference of the output geometries. Default is 4326 (WGS 1984 Geographic Coordinate System).

class esri.arcgis.gmaps.GPResults

An instance of this class represents the result of a synchronous GP task execution. It can be added to the map using MapExtension.addToMap method. There is no constructor for this class.

Properties

Property Type Description
results ParameterValue[] Specifies the output parameters (results) returned by a GP task. Each result parameter provides information such as the parameter name, data type and value.
messages GPMessage[] Specifies the messages generated during the GP task execution.

class esri.arcgis.gmaps.ParameterValue

Instances of this class represent the output parameters (results) of a GP task, and their properties and values. It can be added to the map using MapExtension.addToMap method. There is no constructor for this class.

Properties

Property Type Description
paramName String Unique name of the parameter.
dataType String Specifies the type of data for the parameter. It can have one of the following values: "GPString", "GPDouble", "GPLong", "GPBoolean", "GPDate", "GPLinearUnit", "GPDataFile", "GPRasterData", "GPRecordSet", "GPRasterDataLayer", "GPFeatureRecordSetLayer".
value Object

The value of the parameter. The data structure of this value depends on the dataType.

The following table provides an example for each of the supported data types:
dataType value
GPString "MyString"
GPDouble 12.56
GPLong 345
GPBoolean true
GPDate <GPDate>
GPLinearUnit <LinearUnit>
GPDataFile <DataFile>
GPRasterData <RasterData>
GPRecordSet <FeatureSet>
GPRasterDataLayer <RasterData>
GPFeatureRecordSetLayer <FeatureSet>

class esri.arcgis.gmaps.JobInfo

This class represents information pertaining to the execution of an asynchronous GP task (job) on the server. There is no constructor for this class.

Properties

Property Type Description
jobId String A string that uniquely identifies a job on the server. It is created when a job is submitted for execution and is later used to check its status and retrieve the results.
jobStatus JobStatus The current state of the job being processed on the server. Valid values for this property are defined in the JobStatus enumeration.
messages GPMessage[] Provides verbose information about the status of job processing on the server.

class esri.arcgis.gmaps.GPMessage

An instance of this class represents a message generated during the execution of a geoprocessing task and includes such information as when the processing started, what parameter values are being used, the progress, and warnings of potential problems and errors. It is composed of a message type and a description. There is no constructor for this class.

Properties

Property Type Description
type String The geoprocessing message type. It can have one of the following values: "esriJobMessageTypeInformative", "esriJobMessageTypeWarning", "esriJobMessageTypeError", "esriJobMessageTypeEmpty" and "esriJobMessageTypeAbort".
description String A description of the geoprocessing message.

enum esri.arcgis.gmaps.JobStatus

This enumeration represents the status of a job on the server. Each constant represents a state of an asynchronous GP task execution.

Constants

Constant Description
NEW The job is new.
SUBMITTED The job is submitted for execution.
WAITING The job is waiting for available job processor.
EXECUTING The job is being executed by job processor.
SUCCEEDED The job has been completed successfully.
FAILED The job execution has failed.
TIMED_OUT The job execution has timed out.
CANCELLING The job is being cancelled.
CANCELLED The job has been cancelled.
DELETING The job is being deleted.
DELETED The job has been deleted.

class esri.arcgis.gmaps.GPDate

An instance of this class represents a geoprocessing value object containing a date.

Constructor

Constructor Description
esri.arcgis.gmaps.GPDate() Creates a new GPDate object.

Properties

Property Type Description
date String A string value representing the date.
format String A string specifying the format for the date.

class esri.arcgis.gmaps.LinearUnit

An instance of this class represents a geoprocessing value object containing a linear distance.

Constructor

Constructor Description
esri.arcgis.gmaps.LinearUnit() Creates a new LinearUnit object.

Properties

Property Type Description
distance Number Specifies the value of the linear distance.
units String Specifies the unit type of the linear distance, such as "esriMeters", "esriMiles", "esriKilometers" etc.

class esri.arcgis.gmaps.DataFile

An instance of this class represents a geoprocessing value object containing a data source.

Constructor

Constructor Description
esri.arcgis.gmaps.DataFile() Creates a new DataFile object.

Properties

Property Type Description
url String URL to the location of the data file.

class esri.arcgis.gmaps.RasterData

An instance of this class represents a geoprocessing value object containing a raster data source.

Constructor

Constructor Description
esri.arcgis.gmaps.RasterData() Creates a new RasterData object.

Properties

Property Type Description
url String URL to the location of the raster data file.
format String Specifies the format of the raster data such as "jpg", "tif" etc.

class esri.arcgis.gmaps.Geometry

This class represents a geometry service resource exposed by the ArcGIS Server REST API. It is used to perform various operations on geometries such as: project, simplify, buffer and relation, and calculate areas, lengths and label points.

Constructor

Constructor Description
esri.arcgis.gmaps.Geometry(url) Creates a new Geometry object that represents the geometry service resource identified by the url.

Properties

Property Type Description
url String URL to the ArcGIS Server REST resource that represents the geometry service.

Methods

Method Return Value Description
buffer(parameters, callback?) none

Creates buffer polygons to a specified distance around the given geometries. A buffer is defined as the area within a specified distance around a geometry. The parameters argument is a BufferParameters object that specifies the input geometries, buffer distance and other options.

On completion, the buffercomplete event will be fired and the optional callback function will be invoked. Both the callback and event handlers will receive a BufferResults object that contains the buffer polygons. You can add them to your map using MapExtension.addToMap method.

project(parameters, callback?) none

Projects a set of geometries into a new spatial reference. The parameters argument is a ProjectParameters object that specifies the input geometries, in/out spatial references and other options.

On completion, the projectcomplete event will be fired and the optional callback function will be invoked. Both the callback and event handlers will receive a ProjectResults object that contains the projected geometries. You can add them to your map using MapExtension.addToMap method if parameters.outSpatialReference is 4326 (WGS 1984).

simplify(geometries, callback?) none

Alters the given geometries to make their definitions topologically legal with respect to their geometry type. The geometries argument is an array of array of GLatLng objects (GLatLng[ ][ ]) or an array of array of GPolyline objects (GPolyline[ ][ ]) or an array of array of GPolygon objects (GPolygon[ ][ ]).

On completion, the simplifycomplete event will be fired and the optional callback function will be invoked. Both the callback and event handlers will receive a SimplifyResults object that contains the simplified geometries. You can add them to your map using MapExtension.addToMap method.

getAreasAndLengths(polygons, callback?) none

(Since 1.1) Calculates areas and perimeter lengths for the given polygons. The polygons argument is an array of array of GPolygon objects (GPolygon[ ][ ]) representing an array of ArcGIS Polygon geometry.

On completion, the areasandlengthscomplete event will be fired and the optional callback function will be invoked. Both the callback and event handlers will receive an object that contains the areas (in square meters) and perimeter lengths (in meters) for each ArcGIS Polygon (see areasandlengthscomplete event for the more information on this object).

getLengths(polylines, callback?) none

(Since 1.1) Calculates the lengths for the given polylines. The polylines argument is an array of array of GPolyline objects (GPolyline[ ][ ]) representing an array of ArcGIS Polyline geometry.

On completion, the lengthscomplete event will be fired and the optional callback function will be invoked. Both the callback and event handlers will receive an object that contains the lengths (in meters) for each ArcGIS Polyline (see lengthscomplete event for the more information on this object).

getLabelPoints(polygons, callback?) none

(Since 1.2) Calculates an optimum, interior point for the given polygons that can be used for label placement. The polygons argument is an array of array of GPolygon objects (GPolygon[ ][ ]) representing an array of ArcGIS Polygon geometry.

On completion, the labelpointscomplete event will be fired and the optional callback function will be invoked. Both the callback and event handlers will receive an object that contains the label points for each ArcGIS Polygon (see labelpointscomplete event for the more information on this object).

relation(parameters, callback?) none

(Since 1.2) Determines the pairs of geometries from the input geometry arrays that participate in the specified spatial relation. The parameters argument is a RelationParameters object that specifies the arguments to the relation operation.

On completion, the relationcomplete event will be fired and the optional callback function will be invoked. Both the callback and event handlers will receive an object that contains the geometry pairs for which the specified relation is true (see relationcomplete event for the more information on this object).

Events

Event Arguments Description
buffercomplete BufferResults, Error? This event is fired when a buffer operation is completed. The first argument is an BufferResults object. The second argument is an Error object that will be available in case there was an error.
projectcomplete ProjectResults, Error? This event is fired when a project operation is completed. The first argument is an ProjectResults object. The second argument is an Error object that will be available in case there was an error.
simplifycomplete SimplifyResults, Error? This event is fired when a simplify operation is completed. The first argument is an SimplifyResults object. The second argument is an Error object that will be available in case there was an error.
areasandlengthscomplete Object, Error? (Since 1.1) This event is fired when a getAreasAndLengths operation is completed. The first argument is an object of the form:
{
  areas: [ <area1>, <area2>, ... ],
  lengths: [ <length1>, <length2>, ... ]
}

where the areas are measured in square meters and the lengths are measured in meters. The second argument is an Error object that will be available in case there was an error.

lengthscomplete Object, Error? (Since 1.1) This event is fired when a getLengths operation is completed. The first argument is an object of the form:
{
  lengths: [ <length1>, <length2>, ... ]
}

where the lengths are measured in meters. The second argument is an Error object that will be available in case there was an error.

labelpointscomplete Object, Error? (Since 1.2) This event is fired when a getLabelPoints operation is completed. The first argument is an object of the form:
{
  labelPoints: [ <GMarker1>, <GMarker2>, ... ]
}

The second argument is an Error object that will be available in case there was an error.

relationcomplete Object, Error? (Since 1.2) This event is fired when a relation operation is completed. The first argument is an object of the form:
{
  relations: [
    { geometry1Index: <geometry1Index1>, geometry2Index: <geometry2Index1> },
    { geometry1Index: <geometry1Index2>, geometry2Index: <geometry2Index2> }
  ]
}

where geometry1Index is the index of the geometry in the base array and geometry2Index is the index of the geometry in the comparison array -- together they represent the geometry pair for which the specified relation is true. The second argument is an Error object that will be available in case there was an error.

class esri.arcgis.gmaps.BufferParameters

Instances of this class are used in the parameters argument to Geometry.buffer method.

Constructor

Constructor Description
esri.arcgis.gmaps.BufferParameters() Creates a new BufferParameters object.

Properties

Property Type Description
geometries GLatLng[][] or GPolyline[][] or GPolygon[][] The geometries to buffer.
distances Number[] The distances (in the unit specified by the unit property) the input geometries are buffered to.
unit SRUnitType Unit that the buffer distance values are in. It can be one of the constants defined in SRUnitType. Default is esri.arcgis.gmaps.SRUnitType.METER.
unionResults Boolean Indicates whether or not the geometries buffered at a given distance are unioned into a single polygon. Default is false.
bufferSpatialReference Number The Well-Known ID (wkid) of the spatial reference in which the geometries are buffered. If this property is not set, it is assumed to be 102113 (WGS 1984 Web Mercator) for linear units and 4326 (WGS 1984) for angular units.

enum esri.arcgis.gmaps.SRUnitType

These constants represent some of the predefined units of measurement. Each constant corresponds to a factory code used in the ArcGIS Projection Engine Library and falls under one of the two categories: Linear, Angular. You need to use these constants as units for calculating buffer distances. Numeric equivalents for the constants are specified in parantheses.

Constants

Constant Description Constant Description Constant Description
METER (9001) International meter. KILOMETER (9036) Kilometer. STATUTE_MILE (9093) Statute mile.
NAUTICAL_MILE (9030) International nautical mile. US_NAUTICAL_MILE (109012) US nautical mile (pre-1954). FOOT (9002) International foot.
GERMAN_METER (9031) German legal meter. SURVEY_FOOT (9003) US survey foot. CLARKE_FOOT (9005) Clarke's foot.
FATHOM (9014) Fathom. SURVEY_CHAIN (9033) US survey chain. SURVEY_LINK (9034) US survey link.
SURVEY_MILE (9035) US survey mile. CLARKE_YARD (9037) Yard (Clarke's ratio). CLARKE_CHAIN (9038) Chain (Clarke's ratio).
CLARKE_LINK (9039) Link (Clarke's ratio). SEARS_YARD (9040) Yard (Sears). SEARS_FOOT (9041) Foot (Sears).
SEARS_CHAIN (9042) Chain (Sears). SEARS_LINK (9043) Link (Sears). BENOIT_1895A_YARD (9050) Yard (Benoit 1895 A).
BENOIT_1895A_FOOT (9051) Foot (Benoit 1895 A). BENOIT_1895A_CHAIN (9052) Chain (Benoit 1895 A). BENOIT_1895A_LINK (9053) Link (Benoit 1895 A).
BENOIT_1895B_YARD (9060) Yard (Benoit 1895 B). BENOIT_1895B_FOOT (9061) Foot (Benoit 1895 B). BENOIT_1895B_CHAIN (9062) Chain (Benoit 1895 B).
BENOIT_1895B_LINK (9063) Link (Benoit 1895 B). INDIAN_FOOT (9080) Indian geodetic foot. INDIAN_1937_FOOT (9081) Indian foot (1937).
INDIAN_1962_FOOT (9082) Indian foot (1962). INDIAN_1975_FOOT (9083) Indian foot (1975). INDIAN_YARD (9084) Indian yard.
INDIAN_1937_YARD (9085) Indian yard (1937). INDIAN_1962_YARD (9086) Indian yard (1962). INDIAN_1975_YARD (9087) Indian yard (1975).
FOOT_1865 (9070) Foot (1865). RADIAN (9101) Radian. DEGREE (9102) Degree.
ARCMINUTE (9103) Arc-minute. ARCSECOND (9104) Arc-second. GRAD (9105) Grad.
GON (9106) Gon. MICRORADIAN (9109) Microradian ARCMINUTE_CENTESIMAL (9112) Centesimal arc-minute.
ARCSECOND_CENTESIMAL (9113) Centesimal arc-second. MIL6400 (9114) Mil. BRITISH_1936_FOOT (9095) British foot (1936).
GOLDCOAST_FOOT (9094) Gold coast foot. INTERNATIONAL_CHAIN (109003) International chain. INTERNATIONAL_LINK (109004) Internationl link.
INTERNATIONAL_YARD (109001) International yard. SURVEY_YARD (109002) US survey yard. LENGTH_50KILOMETER (109030) 50 Kilometer length.
LENGTH_150KILOMETER (109031) 150 Kilometer length. DECIMETER (109005) Decimeter. CENTIMETER (109006) Centimeter.
MILLIMETER (109007) Millimeter. INTERNATIONAL_INCH (109008) International inch. US_SURVEY_INCH (109009) US survey inch.
INTERNATIONAL_ROD (109010) Internation rod. US_SURVEY_ROD (109011) US survey rod. UK_NAUTICAL_MILE (109013) UK nautical mile (pre-1970).

class esri.arcgis.gmaps.ProjectParameters

Instances of this class are used in the parameters argument to Geometry.project method.

Constructor

Constructor Description
esri.arcgis.gmaps.ProjectParameters() Creates a new ProjectParameters object.

Properties

Property Type Description
geometries GLatLng[][] or GPolyline[][] or GPolygon[][] or Object[] The geometries to project. If you have custom geometries whose x and y coordinates are not specified in WGS 1984 Geographic Coordinate System (i.e., inSpatialReference is not 4326), then the value of this property should be an array of object literals of the form:
[
 {
  "x" : <x>, "y" : <y>
 },
 ...
]

representing an array of points, or

[
 {
  "points" : [ [<x1>, <y1>], [<x2>, <y2>] ]
 },
 ...
]

representing an array of multipoints, or

[
 {
  "paths" : [ 
   [ [<x11>, <y11>], [<x12>, <y12>] ], 
   [ [<x21>, <y21>], [<x22>, <y22>] ]
  ]
 },
 ...
]

representing an array of polylines, or

[
 {
   "rings" : [ 
    [ [<x11>, <y11>], [<x12>, <y12>], ..., [<x11>, <y11>] ], 
    [ [<x21>, <y21>], [<x22>, <y22>], ..., [<x21>, <y21>] ]
   ]
 },
 ...
]

representing an array of polygons.

inSpatialReference Number The Well-Known ID (wkid) of the spatial reference of the input geometries.
outSpatialReference Number The Well-Known ID (wkid) of the spatial reference to project the geometries to.
geometryType String The type of input geometries. It can have one of the following values: "esriGeometryPoint", "esriGeometryMultipoint", "esriGeometryPolyline", "esriGeometryPolygon" depending on the type of input geometries. You need not set this property if inSpatialReference is 4326.

class esri.arcgis.gmaps.RelationParameters

Instances of this class are used in the parameters argument to Geometry.relation method.
(Since 1.2)

Constructor

Constructor Description
esri.arcgis.gmaps.RelationParameters() Creates a new RelationParameters object.

Properties

Property Type Description
geometries1 GLatLng[][] or GPolyline[][] or GPolygon[][] The base set of geometry in the relation operation. The relationship between each geometry in the base set is compared to each geometry in the comparison set (geometries2). All geometries in this array must be of the same type.
geometries2 GLatLng[][] or GPolyline[][] or GPolygon[][] The comparison set of geometry in the relation operation. All geometries in this array must be of the same type.
relation RelationType The spatial relationship to be tested between the two input geometry arrays. It can be one of the constants defined in RelationType.
comparisonString String The "Shape Comparison Language" string to be evaluated when the relation parameter is specified as esri.arcgis.gmaps.RelationType.RELATION. Strings such as RELATE(G1, G2, "FFFTTT***") are accepted in addition to other kinds of string.

enum esri.arcgis.gmaps.RelationType

These constants represent the operators that can be used to evaluate the spatial relationship between geometries while performing a relation operation. They are used as values for the relation property of a RelationParameters object. See here for more information.
(Since 1.2)

Constants

Constant Description
CROSS Two geometries intersect in a geometry of lesser dimension.
DISJOINT Two geometries share no points in common.
IN The base geometry is the intersection of the geometries and the intersection of their interiors is not empty.
INTERIOR_INTERSECTION Two geometries intersect excluding boundary touch.
INTERSECTION Geometry interiors intersect or boundaries touch, same as 'not disjoint'.
LINE_COINCIDENCE The boundaries of the geometries must share an intersection, but the relationship between the interiors of the shapes is not considered (they could overlap, one could be contained in the other, or their interiors could be disjoint). This relation applies to polylines and polygons.
LINE_TOUCH Two geometries are said to touch when the intersection of the geometries is non-empty, but the intersection of their interiors is empty. This evaluates if the touch occurs along a boundary (not a point). Valid for polygons.
OVERLAP Two polylines share a common sub-line, or two polygons share a common sub-area.
POINT_TOUCH Two geometries are said to touch when the intersection of the geometries is non-empty, but the intersection of their interiors is empty. This evaluates if the touch occurs at a point (not a boundary).
TOUCH The boundaries of the geometries intersect.
WITHIN Same as IN but also allows polylines that are strictly on the boundaries of polygons to be considered in the polygon.
RELATION Allows specification of any relationship defined using the "Shape Comparison Language".

class esri.arcgis.gmaps.BufferResults

An instance of this class represents the result of a buffer operation performed using the Geometry class. It can be added to your map using MapExtension.addToMap method. There is no constructor for this class.

Properties

Property Type Description
geometries GPolygon[][] The buffer polygons.

class esri.arcgis.gmaps.ProjectResults

An instance of this class represents the result of a project operation performed using the Geometry class. It can be added to your map using MapExtension.addToMap method. There is no constructor for this class.

Properties

Property Type Description
geometries GOverlay[][] or Object[]

The geometries projected in the spatial reference specified when initiating the project operation. The value of this property depends on the type of geometries passed as input to the Geometry.project method (via ProjectParameters.geometries property), and the spatial reference to which the geometries are projected (specified via ProjectParameters.outSpatialReference).

The following table lists the type of output geometries based on the type of input geometries and the out spatial reference:
out SR is 4326 out SR is not 4326
Points, Multipoints GMarker[ ][ ] An array of object literals of the form:
[
 {
  "points" : [ [<x1>, <y1>], [<x2>, <y2>] ],
  "spatialReference" : { "wkid" : <wkid> }
 },
 ...
]

Polylines GPolyline[ ][ ] An array of object literals of the form:
[
 {
  "paths" : [ 
   [ [<x11>, <y11>], [<x12>, <y12>] ], 
   [ [<x21>, <y21>], [<x22>, <y22>] ]
  ],
  "spatialReference" : { "wkid" : <wkid> }
 },
 ...
]

Polygons GPolygon[ ][ ] An array of object literals of the form:
[
 {
  "rings" : [ 
   [ [<x11>, <y11>], [<x12>, <y12>], ..., [<x11>, <y11>] ], 
   [ [<x21>, <y21>], [<x22>, <y22>], ..., [<x21>, <y21>] ]
  ],
  "spatialReference" : { "wkid" : <wkid> }
 },
 ...
]

Note: 4326 is the Well-Known ID (wkid) of the Geographic Coordinate System that uses WGS 1984 datum.

class esri.arcgis.gmaps.SimplifyResults

An instance of this class represents the result of a simplify operation performed using the Geometry class. It can be added to your map using MapExtension.addToMap method. There is no constructor for this class.

Properties

Property Type Description
geometries GOverlay[][]

The simplified (topologically legal) geometries as an array of array of GOverlays. Each element of the array can be a marker, polyline or polygon based on the geometries passed as input to the Geometry.simplify method.

The following table lists the type of input geometries and their corresponding outputs:
input geometries output geometries
GLatLng[ ][ ] GMarker[ ][ ]
GPolyline[ ][ ] GPolyline[ ][ ]
GPolygon[ ][ ] GPolygon[ ][ ]

class esri.arcgis.gmaps.MapExtension

An instance of this class is used to manage the addition and removal of ArcGIS features and results on the map. You would not require more than one instance of this class for your web application.

Constructor

Constructor Description
esri.arcgis.gmaps.MapExtension(map) Creates a new instance of a MapExtension object bound to the specified map.

Properties

Property Type Description
map GMap2 The map object bound to this MapExtension.

Methods

Method Return Value Description
addToMap(results, overlayOptions?, infoWindowOptions?) GOverlay[][]

Adds the overlays corresponding to the given ArcGIS features or results to the map. The results argument can be an instance of one of the following classes: FeatureSet, Feature, FindResults, FindResult, IdentifyResults, IdentifyResult, AddressResults, AddressCandidate, GPResults, ParameterValue, BufferResults, ProjectResults, SimplifyResults, TiledMapServiceLayer, GGeoXml.

The optional overlayOptions argument can be used to customize the user interface and other visual aspects of the overlays. By Default, the fill and stroke styles defined in Config are used.

The optional infoWindowOptions argument can be used to specify the content to be displayed in the infowindow when the overlays are clicked. By default, each overlay added to the map has an infowindow that displays all the attributes (and their values) pertaining to the associated ArcGIS feature or result.

This method returns an array of array of overlays that were added to the map, so that they can be later removed by calling the removeFromMap() method. Each element in the outer array represents an ArcGIS feature and each element in the inner array represents a part of that feature. For example, a polygon feature is made up of mulitple rings. Hawaii, for instance, is one feature that contains multiple islands (rings).

Note: If your application is a mapplet, then you need to use the addToMapAsync() method described below.
addToMapAsync(results, overlayOptions?, infoWindowOptions?, callback) none This method is identical to addToMap(), except that it is executed in asynchronous fashion and returns the overlays to the specified callback function. Note that the callback argument is not optional. This method should be used only if your application is a mapplet.
removeFromMap(overlays) none Removes the given overlays from the map after deregistering their click handlers. The overlays argument should be an array of array of overlays as returned by the addToMap*() methods.

class esri.arcgis.gmaps.OverlayOptions

Instances of this class are used in the overlayOptions? argument to the addToMap() and addToMapAsync() methods of the MapExtension class when adding ArcGIS features and results to the map. It allows you to specify options that will be used when creating GMarker, GPolyline and GPolygon objects. It has no constructor but is instantiated as JavaScript object literal. All properties of this class are optional.
Note: Values specified for strokeColor, strokeWeight, strokeOpacity, fillColor and fillOpacity override the corresponding values set in Config.

Properties

Property Type Description
strokeColor String A string that contains the color in hexadecimal numeric HTML style, i.e. "#RRGGBB". Applicable for polylines and polygons only.
strokeWeight Number Width of the line in pixels. Applicable for polylines and polygons only.
strokeOpacity Number The opacity given as a number between 0 (fully transparent) and 1 (fully opaque). Applicable for polylines and polygons only.
fillColor String A string that contains the color in hexadecimal numeric HTML style, i.e. "#RRGGBB". Applicable for polygons only.
fillOpacity Number The opacity given as a number between 0 (fully transparent) and 1 (fully opaque). Applicable for polygons only.
markerOptions MarkerOptions Specifies the object to use for the opts? argument in the constructor of GMarker class.
polylineOptions GPolylineOptions Specifies the object to use for the opts? argument in the constructor of GPolyline class.
polygonOptions GPolygonOptions Specifies the object to use for the opts? argument in the constructor of GPolygon class.

class esri.arcgis.gmaps.MarkerOptions

This class represents the options passed within the markerOptions property of the OverlayOptions class. It extends GMarkerOptions by prioviding a templating mechanism for the marker title. There is no constructor for this class. Instead, this class is instantiated as JavaScript object literal.
Note: This class supports all the properties defined by GMarkerOptions in addition to the ones listed in the table below.

Properties

Property Type Description
title String

This string will appear as tooltip on the marker, i.e. it will work just as the title attribute on HTML elements. In addition, it can contain special embedded strings of the form {ATTRIBUTE_NAME} that will be substituted with values obtained from the ArcGIS feature or result associated with the marker.

For example, an attribute named WELLID with a value of 14 can be shown as a tooltip by providing this templated string:
Well ID: {WELLID}
The content that is displayed will be, Well ID: 14

class esri.arcgis.gmaps.InfoWindowOptions

Instances of this class are used in the infoWindowOptions? argument to the addToMap() and addToMapAsync() methods of the MapExtension class when adding ArcGIS features and results to the map. It extends GInfoWindowOptions by adding two new properties: content and contentTabs. There is no constructor for this class. Instead, this class is instantiated as JavaScript object literal.
Note: This class supports all the properties defined by GInfoWindowOptions in addition to the ones listed in the table below.

Properties

Property Type Description
content String

Specifies the HTML content to be shown when the infowindow is displayed. It can contain special embedded strings of the form {ATTRIBUTE_NAME} that will be substituted with values obtained from the ArcGIS feature or result associated with the infowindow.

For example, an attribute named WELLID with a value of 14 can be shown in the infowindow by providing this templated string:
<b>Well ID:</b> {WELLID}
The content that is displayed in the infowindow will be, Well ID: 14

contentTabs Object[] Specifies the HTML content to be shown in each tab of a tabbed infowindow. For example,
[
 {
   label:"tab 1 title", content:"tab 1 html content"
 },
 {
   label:"tab 2 title", content:"tab 2 html content"
 }
]

Each element in the array shown above is an object literal representation of the GInfoWindow class, and contains two properties: content defines the content of the infowindow when the tab is selected, and label defines the label of the tab. The properties can also have special embedded strings that will be substituted with attribute values from the associated ArcGIS feature or result.

object esri.arcgis.gmaps.Config

This object literal contains configuration options that can be modified to alter the default behaviour of the API in certain areas.

Properties

Property Type Description
proxyUrl String The URL to the web proxy page used in case the length of the URL request to an ArcGIS Server REST resource exceeds 2000 characters. Default is null. (Since 1.3) Note that the proxy will not be used if the REST resource is located on the same web server as the HTML application, unless alwaysUseProxy option is true. A HTML application and a REST resource are considered to be located on the same web server if the protocol, hostname and port values of their URLs are identical.
alwaysUseProxy Boolean Indicates whether or not the web proxy page is used always. Default value for this option is false, i.e. if this option is not specifed, the web proxy page will be used only when the length of the URL request to an ArcGIS Server REST resource exceeds 2000 characters.
geometryServiceUrl String The URL to an ArcGIS Server REST Geometry Service resource. It is used by the DynamicMapServiceLayer to project the initialExtent and fullExtent properties to WGS 1984 Geographic Coordinate System (Well-Known ID = 4326) used by Google Maps. Default is null.
polylineStrokeColor String The stroke color, in hexadecimal notation, to be used when creating GPolyline objects. Default is "#ff0000".
polylineStrokeWeight Number The stroke width, in pixels, to be used when creating GPolyline objects. Default is 5.
polylineStrokeOpacity Number The stroke opacity to be used when creating GPolyline objects. It is given as a number between 0 and 1. Default is 0.75.
polygonFillColor String The fill color, in hexadecimal notation, to be used when creating GPolygon objects. Default is "#0000ff".
polygonFillOpacity Number The fill opacity to be used when creating GPolygon objects. It is given as a number between 0 and 1. Default is 0.3.
polygonStrokeColor String The stroke color, in hexadecimal notation, to be used when creating GPolygon objects. Default is "#0000ff".
polygonStrokeWeight Number The stroke width, in pixels, to be used when creating GPolygon objects. Default is 2.
polygonStrokeOpacity Number The stroke opacity to be used when creating GPolygon objects. It is given as a number between 0 and 1. Default is 0.75.

class esri.arcgis.gmaps.Error

An instance of this class represents an error message returned by the ArcGIS Server REST API. There is no constructor for this class.

Properties

Property Type Description
code Number HTTP status code for the error.
message String The error message.
details String[] Detailed error descriptions.

function esri.arcgis.gmaps.JSONRequest

This function provides a convenient way to asynchronously retrieve JSON data from trusted sources. Typically, it accomplishes the task by dynamically inserting a <script> tag into the page and setting the source URL as its src attribute. The parameters you pass will be attached to the URL as its querystring. The <script> tag does not adhere to a strict same-origin policy and hence it can interact with disparate domains. However, it can only make HTTP GET requests, which means the length of the URL (including the parameters) is limited to 2000 characters for the most part. In such cases, this function will make use of the XMLHttpRequest object and interact with the server via HTTP POST method. XMLHttpRequest is limited by a strict same-origin policy and hence it requires a server-side proxy. You can set the URL to your server-side proxy using the esri.arcgis.gmaps.Config.proxyUrl option.
(Since 1.4)

* It is important to note that the web service you are calling must support JSONP (JSON with Padding) response format by letting the client pass the name of the callback function. For example, http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/4?f=pjson&callback=myCallbackFunc

* Do not use this function if the source is not trustworthy.

Function

Method Return Value Description
esri.arcgis.gmaps.JSONRequest(url, onload, parameters?, options?) none Retrieves the JSON response from the web service identified by the given url and calls the onload function with the JSON response as the argument. If the url points to an ArcGIS Server REST service and if it returned an error, the Error object will be passed to the onload function as the second argument.

If the web service supports query parameters, you should pass them using the optional parameters argument. It is an object literal of the form:

{
  parameterName1: "a string",
  parameterName2: true | false,
  parameterName3: <Number>,
  parameterName4: <Array>,
  parameterName5: {
    anotherParameter: "a string"
  }
}

Note that any parameter that has a value of undefined, null or "" (an empty string) will be ignored.
The options argument can be used to configure certain aspects of the request and as the name indicates, all properties are optional. It is simply an object literal that supports the following properties:

{
  callbackParamName: "<String>"
}

callbackParamName - specifies the query parameter name that will be used to send the name of the callback function. For ArcGIS Server REST services, the parameter name should be "callback". Default is "callback".