ArcGIS Server Link for Google Maps JavaScript API V3
Examples
This library lets you add map resources accessible via
ESRI ArcGIS Server REST API into
Google Maps API V3 and provide some additional support for map tiles created
with different spatial reference and tiling scheme.
.
There are many objects used in the REST API that do not require
a constructor and can be
used just as object literal in the operation:
For a description and examples of how to use this library, check out the how-to.
class Albers
This class (Albers
) represents a Spatial Reference System based on Albers Projection. This class extends SpatialReference
.
Constructor
Constructor |
Description |
Albers(params:Object) |
Create a Albers Equal-Area Conic Projection based Spatial Reference. The params passed in construction should
include the following properties:
-wkid: well-known id
-semi_major: ellipsoidal semi-major axis in meter
-unit: meters per unit
-inverse_flattening: inverse of flattening of the ellipsoid where 1/f = a/(a - b)
-standard_parallel_1: phi1, latitude of the first standard parallel
-standard_parallel_2: phi2, latitude of the second standard parallel
-latitude_of_origin: phi0, latitude of the false origin
-central_meridian: lamda0, longitude of the false origin (with respect to the prime meridian)
-false_easting: FE, false easting, the Eastings value assigned to the natural origin
-false_northing: FN, false northing, the Northings value assigned to the natural origin
e.g.
var albers = new Albers({wkid:9999, semi_major: 6378206.4,inverse_flattening: 294.9786982,
standard_parallel_1: 29.5, standard_parallel_2: 45.5,
central_meridian: -96.0, latitude_of_origin: 23,false_easting: 0,
'false_northing': 0, unit: 1 }); |
Methods
class BufferOptions
This class represent the parameters needed in an buffer operation
for a GeometryService
. There is no constructor for this class. Instead, this class is instantiated as a javascript object literal.
Properties
Properties |
Type |
Description |
bufferSpatialReference |
SpatialReference |
The well-known ID of or the SpatialReference of the buffer geometries |
distances |
Array.number |
The distances the input geometries are buffered. |
geometries |
Array.OverlayView|Array.object |
Array of google.maps.LatLng , Polyline , Polygon , or ESRI Geometry format to buffer. |
overlayOptions |
OverlayOptions |
how to render result overlay. See OverlayOptions |
unionResults |
Boolean |
If true, all geometries buffered at a given distance are unioned into a single (possibly multipart) polygon, and the unioned geometry is placed in the output array. |
unit |
Number |
see esriSRUnitType Constants . |
class BufferResults
This class represent the parameters needed in an project operation
for a GeometryService
.
There is no constructor, use JavaScript object literal.
Properties
Properties |
Type |
Description |
geometries |
Array.OverlayView|Array.object |
Array of google.maps.LatLng, Polyline, Polygon , or ESRI Geometry format to project. |
class Catalog
The catalog resource is the root node and initial entry point into an ArcGIS Server host.
This resource represents a catalog of folders and services published on the host.
Constructor
Constructor |
Description |
Catalog(url:String) |
Create a ArcGIS service catalog instance using it's url: http://<host>/<instance>/rest/services |
Properties
Properties |
Type |
Description |
currentVersion |
String |
currentVersion |
folders |
Array.string |
folders list |
services |
Array.string |
list of services. Each has name, type property. |
Events
Events |
Arguments |
Description |
load |
None |
This event is fired when the catalog info is loaded. |
class Config
This is an object literal that sets common configuration values used across the lib.
Properties
Properties |
Type |
Description |
alwaysUseProxy |
Boolean |
whether to always use proxy page when send request to server. |
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. |
class CopyrightControl
put a copyright notice at bottom rigth corner.
Constructor
Constructor |
Description |
CopyrightControl(map:google.maps.Map) |
Creates a copyright control |
Methods
Methods |
Return Value |
Description |
refresh() |
None |
refresh copyright text |
class Error
Error returned from Server.
Syntax:
{
"error" :
{
"code" : 500,
"message" : "Object reference not set to an instance of an object.",
"details" : [
"'geometry' parameter is invalid"
]
}
}
class ExportMapOptions
This class represent the parameters needed in an exportMap operation for a MapService
.
For more info see Export Operation. There is no constructor for this class. Instead, this class is instantiated as a javascript object literal.
Properties
Properties |
Type |
Description |
bounds |
google.maps.LatLngBounds |
bounds of map |
dpi |
Number |
The dpi of the exported image, default 96 |
endTime |
Date |
The end time instant the exported map image if the service supports time (since AGS10).
time=<timeInstant> or time=<startTime>, <endTime>, e.g. time=1199145600000, 1230768000000 (1 Jan 2008 00:00:00 GMT to 1 Jan 2009 00:00:00 GMT) |
format |
String |
The format of the exported image. png | png8 | png24 | jpg | pdf | bmp | gif | svg The default value is png . |
height |
Number |
height of image, in pixel; |
imageSR |
SpatialReference |
The well-known ID of the spatial reference of the exported image or instance of SpatialReference . |
layerDefinitions |
Object |
Allows you to filter the features of individual layers in the exported map by specifying
definition expressions for those layers. Syntax: { "<layerId1>" : "<layerDef1>" , "<layerId2>" : "<layerDef2>" }
key is layerId returned by server, value is definition for that layer. |
layerIds |
Array.number |
list of layer ids. If not specified along with layerOptions, show list of visible layers. |
layerOptions |
String |
show | hide | include | exclude. If not specified with along layerIds, show list of visible layers. |
layerTimeOptions |
Object |
layerTimeOptions The time options per layer. Users can indicate whether or not the layer should use the time extent
specified by the time parameter or not, whether to draw the layer
features cumulatively or not and the time offsets for the layer. Syntax:
{
"<layerId1>" : {
//If true, use the time extent specified by the time parameter
"useTime" : < true | false >,
//If true, draw all the features from the beginning of time for that data
"timeDataCumulative" : < true | false >,
//Time offset for this layer so that it can be overlaid on the top of a previous or future time period
"timeOffset" : <timeOffset1>,
"timeOffsetUnits" : "<esriTimeUnitsCenturies | esriTimeUnitsDays | esriTimeUnitsDecades |
esriTimeUnitsHours | esriTimeUnitsMilliseconds | esriTimeUnitsMinutes |
esriTimeUnitsMonths | esriTimeUnitsSeconds | esriTimeUnitsWeeks | esriTimeUnitsYears |
esriTimeUnitsUnknown>"
},
"<layerId2>" : {
"useTime" : < true | false >,
"timeDataCumulative" : < true | false >,
"timeOffsetOffset" : <timeOffset2>,
"timeOffsetUnits" : "<timeOffsetUnits2>"
}
}
|
time |
Date |
The time instant the exported map image if the service supports time (since AGS10). |
transparent |
Boolean |
If true, the image will be exported with
the background color of the map set as its transparent color. note the REST API default value is false. The default value is true . |
width |
Number |
width of image, in pixel; |
class Feature
This class represent JSON feature object as returned by the REST API.
There is no constructor, use JavaScript object literal.
For more info see Feature Object.
Syntax:
{
"geometry" : <overlays>,
"attributes" : {
"name1" : <value1>,
"name2" : <value2>,
}
}
Properties
Properties |
Type |
Description |
attributes |
Object |
attributes as name-value JSON object. |
geometry |
Array.OverlayView |
geometries. Array of Marker, Polyline or Polygon. |
class Field
This class represents a field in a Layer
. It is accessed from
the fields
property. There is no constructor for this class,
use Object Literal.
Properties
Properties |
Type |
Description |
alias |
String |
field alias. |
domain |
Domain |
domain |
length |
Int |
length. |
name |
String |
field Name |
type |
String |
field type (esriFieldTypeOID|esriFieldTypeString|esriFieldTypeInteger|esriFieldTypeGeometry}. |
class FindOptions
This class represent the parameters needed in an find operation for a MapService
.
There is no constructor, use JavaScript object literal.
For more info see Find Operation. There is no constructor for this class. Instead, this class is instantiated as a javascript object literal.
Properties
Properties |
Type |
Description |
contains |
Boolean |
If false, the operation searches for an exact match of
the searchText string. An exact match is case sensitive.
Otherwise, it searches for a value that contains the searchText provided.
This search is not case sensitive. The default is true. The default value is true . |
layerIds |
Array.number |
The layer Ids to perform the find operation on. The layers to perform the find operation on. |
maxAllowableOffset |
Number |
This option can be used to specify the maximum allowable offset to be used for generalizing
geometries returned by the find operation |
returnGeometry |
Boolean |
If true, the resultset will include the geometries associated with each result. The default value is true . |
searchFields |
Array.string |
The names of the fields to search.
If this parameter is not specified, all fields are searched. |
searchText |
String |
The search string. This is the text that is searched across the layers and the fields that the user specifies. |
class FindResult
This class represent one entry in the results of a find operation for a MapService
.
There is no constructor, use JavaScript object literal.
For more info see Find Operation.
Properties
Properties |
Type |
Description |
displayFieldName |
String |
displayFieldName |
feature |
Feature |
Feature |
foundFieldName |
String |
foundFieldName |
geometryType |
String |
esriGeometryPoint | esriGeometryPolyline | esriGeometryPolygon | esriGeometryEnvelope |
layerId |
Number |
layerId |
layerName |
String |
layerName |
value |
String |
value of the display field |
class FindResults
This class represent the results of a find operation for a MapService
.
There is no constructor, use JavaScript object literal.
For more info see Find Operation.
Properties
Properties |
Type |
Description |
results |
Array.FindResult |
The find results as an array of FindResult |
class GeocodeOptions
This class represent the parameters needed in a find address candidate operation
on a GeocodeService
.
There is no constructor, use JavaScript object literal.
For more info see Find Adddress Candidates Operation. There is no constructor for this class. Instead, this class is instantiated as a javascript object literal.
Properties
Properties |
Type |
Description |
inputs |
Object |
an object literal with name-value pair of input values. |
outFields |
Array.string |
The list of fields to be included in the returned resultset. |
outSR |
int|SpatialReference |
output SR, see SpatialReference |
class GeocodeResult
This class represent one entry in the results of a find address operation for a
GeocodeService
.
There is no constructor, use JavaScript object literal.
For more info see Find Adddress Candidates Operation.
Properties
Properties |
Type |
Description |
address |
String |
matched address |
attributes |
Object |
attributes as name-value JSON object. |
location |
google.maps.LatLng |
matched location |
score |
Number |
matching score |
class GeocodeResults
This class represent the results of an find address candidate operation for a
GeocodeService
.
There is no constructor, use JavaScript object literal.
For more info see Find Adddress Candidates Operation.
Properties
Properties |
Type |
Description |
candidates |
Array.GeocodeResult |
The find address results as
an array of GeocodeResult |
class GeocodeService
This class (GeocodeService
) represent an ArcGIS GeocodeServer
service.
Constructor
Constructor |
Description |
GeocodeService(url:String) |
Creates a GeocodeService class.
Params:url : URL of service, syntax: http://{catalogurl}/{serviceName}/GeocodeServer |
Properties
Properties |
Type |
Description |
addressFields |
Array.Field |
input fields.
Each entry is an object of type Field , plus required(true|false) |
candidateFields |
Array.Field |
candidate Fields.
Each entry is an object of type Field |
intersectionCandidateFields |
Array.Field |
intersectionCandidateFields
Each entry is an object of type Field |
locatorProperties |
Object |
an object with key-value pair that is specific to Locator type. |
serviceDescription |
String |
serviceDescription |
spatialReference |
SpatialReference |
spatialReference |
Methods
Methods |
Return Value |
Description |
findAddressCandidates(params:GeocodeOptions, callback:Function, errback:Function) |
None |
The findAddressCandidates operation is performed on a geocode service
resource. The result of this operation is a resource representing
the list of address candidates. This resource provides information
about candidates including the address, location, and score.
param is an instance of GeocodeOptions . An instance of
GeocodeResults will be passed into callback function. |
geocode(params:GeocodeOptions, callback:Function) |
None |
Alias of GeocodeService.findAddressCandidates ; |
reverseGeocode(params:ReverseGeocodeOptions, callback:Function, errback:Function) |
None |
The reverseGeocode operation is The reverseGeocode operation is performed on a geocode service resource.
The result of this operation is a inverse geocoded address resource.
param is an instance of ReverseGeocodeOptions . An instance of
ReverseGeocodeResult will be passed into callback function. |
Events
Events |
Arguments |
Description |
load |
None |
This event is fired when the service and it's service info is loaded. |
class Geographic
This class (Geographic
) will simply retuns same LatLng as Coordinates.
The param
should have wkid property. Any Geographic Coordinate Systems (eg. WGS84(4326)) can
use this class As-Is.
Note: This class does not support datum transformation. This class extends SpatialReference
.
Constructor
Constructor |
Description |
Geographic(params:Object) |
Creates a Geographic Coordinate System. e.g.:
var g2 = new Geographic({wkid:4326});
|
class GeometryService
This class (GeometryService
) represent an ArcGIS
Geometry
service.
Constructor
Constructor |
Description |
GeometryService(url:String) |
Creates an GeometryService class.
Params:url : URL of service, syntax: http://{catalogurl}/{serviceName}/GeometryServer |
Methods
Methods |
Return Value |
Description |
buffer(params:BufferOptions, callback.:Function, errback:Function) |
None |
This resource projects an array of input geometries from an input spatial reference
to an output spatial reference. Result of type BufferResults is passed in callback function. |
project(params:ProjectOptions, callback:Function, errback:Function) |
None |
This resource projects an array of input geometries from an input spatial reference
to an output spatial reference. Result of type ProjectResults is passed in callback function. |
class GeometryType
List of Geometry type supported by ArcGIS server.
Properties
Properties |
Type |
Description |
ENVELOPE |
String |
esriGeometryEnvelope |
MULTIPOINT |
String |
esriGeometryMultipoint |
POINT |
String |
esriGeometryPoint |
POLYGON |
String |
esriGeometryPolygon |
POLYLINE |
String |
esriGeometryPolyline |
class GPService
GPService
Properties
Properties |
Type |
Description |
executionType |
String |
|
resultMapServerName |
String |
|
serviceDescription |
String |
|
tasks |
Array.string |
|
Events
Events |
Arguments |
Description |
load |
None |
This event is fired when the service and it's service info is loaded. |
class GPTask
GPTask
Properties
Properties |
Type |
Description |
category |
String |
|
displayName |
String |
|
executionType |
String |
|
helpUrl |
String |
|
name |
String |
|
name |
String |
|
name |
String |
|
parameters |
Array.GPParameter |
see GPParameter |
resultMapServerName |
String |
|
tasks |
Array.string |
|
Methods
Methods |
Return Value |
Description |
execute(p:GPOptions, callback:Function, errback:Function) |
None |
execute a GeoProcessing task |
class IdentifyOptions
This class represent the parameters needed in an identify operation for a MapService
.
There is no constructor, use JavaScript object literal.
For more info see Identify Operation. There is no constructor for this class. Instead, this class is instantiated as a javascript object literal.
Properties
Properties |
Type |
Description |
bounds |
google.maps.LatLngBounds |
The bounding box of the map currently being viewed. |
dpi |
Number |
dpi of image, default 96; |
geometry |
Geometry |
The geometry to identify on, google.maps.LatLng , Polyline , or Polygon . |
height |
Number |
height of image in pixel |
layerIds |
Array.number |
The layers to perform the identify operation on. |
layerOption |
String |
The layers to perform the identify operation on. 'top|visible|all'. |
maxAllowableOffset |
Number |
This option can be used to specify the maximum allowable offset to be used for generalizing geometries returned by the identify operation |
overlayOptions |
OverlayOptions |
how results should be rendered. See OverlayOptions |
returnGeometry |
Boolean |
If true, the resultset will include the geometries associated with each result. The default value is true . |
tolerance |
Number |
The distance in screen pixels from the specified geometry within which the identify should be performed |
width |
Number |
width of image in pixel |
class IdentifyResult
This class represent one entry in the results of an identify operation for a MapService
.
There is no constructor, use JavaScript object literal.
For more info see Identify Operation.
Properties
Properties |
Type |
Description |
displayFieldName |
String |
displayFieldName |
feature |
Feature |
Feature |
layerId |
Number |
layerId |
layerName |
String |
layerName |
value |
String |
value of the display field |
class IdentifyResults
This class represent the results of an identify operation for
a MapService
.
There is no constructor, use JavaScript object literal.
For more info see Identify Operation.
Properties
Properties |
Type |
Description |
results |
Array.IdentifyResult |
The identify results as an array of IdentifyResult |
class LambertConformalConic
This class (LambertConformalConic
) represents a Spatial Reference System based on Lambert Conformal Conic Projection. This class extends SpatialReference
.
Constructor
Constructor |
Description |
LambertConformalConic(params:Object) |
Create a Lambert Conformal Conic Projection based Spatial Reference. The params passed in construction should
include the following properties:
-wkid: well-known id
-semi_major: ellipsoidal semi-major axis in meter
-unit: meters per unit
-inverse_flattening: inverse of flattening of the ellipsoid where 1/f = a/(a - b)
-standard_parallel_1: phi1, latitude of the first standard parallel
-standard_parallel_2: phi2, latitude of the second standard parallel
-latitude_of_origin: phi0, latitude of the false origin
-central_meridian: lamda0, longitude of the false origin (with respect to the prime meridian)
-false_easting: FE, false easting, the Eastings value assigned to the natural origin
-false_northing: FN, false northing, the Northings value assigned to the natural origin
e.g. North Carolina State Plane NAD83 Feet:
var ncsp82 = new LambertConformalConic({wkid:2264, semi_major: 6378137.0,inverse_flattening: 298.257222101,
standard_parallel_1: 34.33333333333334, standard_parallel_2: 36.16666666666666,
central_meridian: -79.0, latitude_of_origin: 33.75,false_easting: 2000000.002616666,
'false_northing': 0, unit: 0.3048006096012192 }); |
Methods
class Layer
This class (Layer
) The layer / table(v10+)
resource represents a single layer / table in a map of a map service
published by ArcGIS Server.
Constructor
Constructor |
Description |
Layer(url:String) |
Create a ArcGIS map Layer using it's url (http://[mapservice-url]/[layerId]) |
Properties
Properties |
Type |
Description |
copyrightText |
String |
copyrightText, only available after load. |
defaultVisibility |
Boolean |
defaultVisibility |
definitionExpression |
String |
Layer definition. |
description |
String |
description |
drawingInfo |
DrawingInfo |
rendering info See DrawingInfo |
fields |
Array.Field |
fields, only available after load. See Field |
geometryType |
String |
geometryType type(esriGeometryPoint|..), only available after load. |
hasAttachments |
Boolean |
hasAttachments |
id |
Number |
layer ID |
maxScale |
Number |
maxScale |
minScale |
Number |
minScale |
name |
String |
layer Name |
parentLayer |
Layer |
parent Layer Layer |
relationships |
Array.String |
relationships (id, name, relatedTableId) |
subLayers |
Array.Layer |
sub Layers. Layer . |
timeInfo |
TimeInfo |
timeInfo |
type |
String |
Feature Layer|Image Layer |
typeIdField |
String |
typeIdField |
types |
Array.String |
subtypes: id, name, domains. |
visibility |
Boolean |
Visibility of this layer |
Methods
Methods |
Return Value |
Description |
isInScale(scale:Number) |
Boolean |
Whether the layer is viewable at given scale |
query(params:QueryOptions, callback:Function, errback:Function) |
None |
The query operation is performed on a layer resource. The result of this operation is a resultset resource that will be
passed in the callback function. param is an instance of QueryOptions
For more info see Query Operation. |
queryRelatedRecords(params:QueryRelatedRecordsParameters, callback:Function, errback:Function) |
None |
The query related records operation is performed on a layer / table resource.
The result of this operation are featuresets grouped by source layer / table
object IDs. Each featureset contains Feature objects including the values for
the fields requested by the user. For related layers, if you request geometry
information, the geometry of each feature is also returned in the featureset.
For related tables, the featureset does not include geometries. |
Events
Events |
Arguments |
Description |
load |
None |
This event is fired when layer's service info is loaded. |
class LOD
This class contains information about one "Level Of Detail" for a cached map service.
It is the type of lods
property of TileInfo
There is no constructor for this class. Use as object literal.
Properties
Properties |
Type |
Description |
level |
Number |
zoom level. |
resolution |
Number |
map unit per pixel |
scale |
Number |
actual map scale. e.g a value of 5000 means 1:5000 scale. |
class MapImage
This is the result of MapService
.exportMap operation.
There is no constructor, use as JavaScript object literal.
Properties
Properties |
Type |
Description |
bounds |
google.maps.LatLngBounds |
The bounding box of the exported image. |
height |
Number |
height of the exported image. |
href |
String |
URL of image |
scale |
Number |
scale of the exported image. |
width |
Number |
width of the exported image. |
class MapOverlay
This class (MapOverlay
) extends the Google Maps API's
OverlayView
that draws map images from data source on the fly. It is also known as "Dynamic Maps".
It can be added to the map via setMap(map)
method.
The similar class in the core Map API is google.maps.GroundOverlay,
however, the instance of this class always cover the viewport exactly, and will redraw itself as map moves.
Constructor
Constructor |
Description |
MapOverlay(service:String|MapService, opt_overlayOpts:MapOverlayOptions) |
Creates an Map Overlay using url of the map service and optional MapOverlayOptions .
service (required) is url of the underline MapService or the MapService itself.
opt_overlayOpts (optional) is an instance of MapOverlayOptions . |
Methods
Methods |
Return Value |
Description |
draw() |
None |
Called by API not by app code.
See OverlayView.draw in core API docs. |
getMapService() |
MapService |
Gets underline MapService . |
getOpacity() |
Number |
Gets Image Opacity. return opacity between 0-1. |
hide() |
None |
Hide the overlay |
isHidden() |
Boolean |
Check if the overlay is visible, and within zoomzoom range and current map bounds intersects with it's fullbounds. |
onAdd() |
None |
Called by API not by app code.
Handler when overlay is added. Interface method.
This will be called after setMap(map) is called. |
onRemove() |
None |
Called by API not by app code.
Handler when overlay is removed. |
refresh() |
None |
Refresh the map image in current view port. |
setOpacity(opacity:Number) |
None |
Sets Image Opacity. parameter opacity between 0-1. |
show() |
None |
Makes the overlay visible. |
Events
Events |
Arguments |
Description |
drawend |
None |
This event is fired after the the drawing request was returned by server. |
drawstart |
None |
This event is fired before the the drawing request was sent to server. |
class MapOverlayOptions
Instance of this class are used in the opt_ovelayOpts
argument
to the constructor of the MapOverlay
class. There is no constructor for this class. Instead, this class is instantiated as a javascript object literal.
Properties
Properties |
Type |
Description |
exportOptions |
ExportMapOptions |
See ExportMapOptions |
map |
google.maps.Map |
map to attach to. |
opacity |
Number |
Opacity of map image from 0.0 (invisible) to 1.0 (opaque) The default value is 1.0 . |
class MapSerivceOptions
provides options to construct a MapService
There is no constructor for this class. Instead, this class is instantiated as a javascript object literal.
Properties
Properties |
Type |
Description |
delayLoad |
Number |
number of seconds to delay loading meta data on construction. |
class MapService
This class (MapService
) is the core class for all map service operations.
It represents an ArcGIS Server map service that offer access to map and layer content
Constructor
Constructor |
Description |
MapService(url:String) |
Creates a MapService objects that can be used by UI components.
-
url (required) is the URL of the map servive, e.g.
http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StateCityHighway_USA/MapServer .
Note the spatial reference of the map service must already exists
in the spatialReferences_ if actual coordinates transformation is needed.
|
Properties
Properties |
Type |
Description |
copyrightText |
String |
copyrightText |
description |
String |
description |
documentInfo |
Object |
Object with the folloing properties: Title, Author,Comments,Subject,Category,Keywords |
layers |
Array.Layer |
array of Layer s. |
mapName |
String |
map frame Name inside the map document |
serviceDescription |
String |
serviceDescription |
singleFusedMapCache |
Boolean |
if map cache is singleFused |
spatialReference |
SpatialReference |
see SpatialReference |
supportedImageFormatTypes |
String |
supportedImageFormatTypes, comma delimited list. |
tables |
Array.Layer |
array of Tables of type Layer . |
tileInfo |
TileInfo |
See TileInfo |
timeInfo |
TimeInfo |
see TimeInfo |
units |
String |
unit |
url |
String |
map service URL |
Methods
Methods |
Return Value |
Description |
exportMap(params:ExportMapOptions, callback:Function, errback:Function) |
String|None |
Export an image with given parameters.
For more info see Export Operation.
The params is an instance of ExportMapOptions .
The following properties will be set automatically if not specified:...
The callback is the callback function with argument of
an instance of MapImage . |
find(opts:FindOptions, callback:Function, errback:Function) |
None |
Find features using the FindOptions and process FindResults
using the callback function.
For more info see Find Operation. |
getFullBounds() |
google.maps.LatLngBounds |
get full bounds of the map serivce |
getInitialBounds() |
google.maps.LatLngBounds |
get initial bounds of the map serivce |
getLayer(nameOrId:String|Number) |
Layer |
Get a map layer by it's name(String) or id (Number), return Layer . |
hasLoaded() |
Boolean |
If the map service meta info is loaded |
identify(params:IdentifyOptions, callback:Function, errback:Function) |
None |
Identify features on a particular Geographic location, using IdentifyOptions and
process IdentifyResults using the callback function.
For more info see Identify Operation. |
loadServiceInfo() |
None |
Load serviceInfo |
queryLayer(layerNameOrId:Number|String, params:QueryOptions, callback:Function, errback:Function) |
None |
Query a layer with given id or name using the QueryOptions and process ResultSet
using the callback function.
See Layer .
For more info see Query Layer Operation. |
Events
Events |
Arguments |
Description |
load |
None |
This event is fired when the service and it's service info is loaded. |
class MapType
This class implements the Google Maps API's
GMapType.
It holds a list of TileLayer
s.
Note: all tiled layer in the same map type must use same spatial reference and tile scheme.
Constructor
Constructor |
Description |
MapType(tileLayers:Array.TileLayer|String, opt_typeOpts:MapTypeOptions) |
Creates a MapType, with a array of TileLayer s, or a single URL as shortcut. |
Methods
Methods |
Return Value |
Description |
getOpacity() |
Number |
get opacity |
getTileLayers() |
Array.TileLayer |
get list of TileLayer in this map type |
setOpacity(op:Number) |
None |
Set Opactity |
class MapTypeOptions
Instance of this class are used in the opt_typeOpts
argument
to the constructor of the MapType
class. See
google.maps.MapType. There is no constructor for this class. Instead, this class is instantiated as a javascript object literal.
Properties
Properties |
Type |
Description |
alt |
String |
Alt text to display when this MapType's button is hovered over in the MapTypeControl. Optional. |
maxZoom |
Number |
The maximum zoom level for the map when displaying this MapType. Required for base MapTypes, ignored for overlay MapTypes. |
minZoom |
Number |
The minimum zoom level for the map when displaying this MapType. Optional; defaults to 0. |
name |
String |
map type name |
projection |
Projection |
an instance of Projection . |
tileSize |
google.maps.Size |
The dimensions of each tile. |
class NetworkService
NetworkService
Properties
Properties |
Type |
Description |
closestFacilityLayers |
Array.string |
|
routeLayers |
Array.string |
|
serviceAreaLayers |
Array.string |
|
serviceDescription |
String |
|
Events
Events |
Arguments |
Description |
load |
None |
This event is fired when the service and it's service info is loaded. |
class OverlayOptions
Instance of this classes that specify how
the geometry features returned by ArcGIS server should be rendered in the browser. There is no constructor for this class. Instead, this class is instantiated as a javascript object literal.
Properties
Properties |
Type |
Description |
fillColor |
String |
The fill color in HTML hex style, ie. "#FFAA00" |
fillOpacity |
Number |
The fill opacity between 0.0 and 1.0 |
icon |
String|google.maps.MarkerImage |
Icon for the foreground |
markerOptions |
google.maps.MarkerOptions |
style option for points. |
polygonOptions |
google.maps.PolygonOptions |
style option for polygons. PolygonOptions |
polylineOptions |
google.maps.PolylineOptions |
style option for polylines. PolylineOptions |
shadow |
String|google.maps.MarkerImage |
Shadow image |
strokeColor |
String |
The stroke color in HTML hex style, ie. "#FFAA00" |
strokeOpacity |
Number |
The stroke opacity between 0.0 and 1.0 |
strokeWeight |
Number |
The stroke width in pixels. |
zIndex |
Number |
The zIndex compared to other overlays. |
class Projection
This class (Projection
) implements a custom
google.maps.Projection
from the core Google Maps API.
It includes a real SpatialReference
object to convert LatLng from/to
map coordinates, and tiling scheme informations to convert
map coordinates from/to pixel coordinates.
Constructor
Constructor |
Description |
Projection(tileInfo:TileInfo) |
Creates an ArcGIS Map Tiling Reference System.
tileInfo tiling information. An instance of TileInfo
Applications normally do not create instances of this class directly. |
Methods
Methods |
Return Value |
Description |
fromLatLngToPoint(gLatLng:LatLng, opt_point:Point) |
Point |
See google.maps.Projection. |
fromPointToLatLng(pixel:Point, opt_nowrap:Boolean) |
LatLng |
See google.maps.Projection. |
getScale(zoom:Number) |
Number |
Get the scale at given level; |
class ProjectOptions
This class represent the parameters needed in an project operation
for a GeometryService
.
There is no constructor, use JavaScript object literal.
For more info see Project Operation. There is no constructor for this class. Instead, this class is instantiated as a javascript object literal.
Properties
Properties |
Type |
Description |
geometries |
Array.OverlayView|Array.object |
Array of google.maps.LatLng, Polyline, Polygon , or ESRI Geometry format to project. |
geometryType |
GeometryType |
esriGeometryPoint | esriGeometryPolyline | esriGeometryPolygon | esriGeometryEnvelope |
inSpatialReference |
SpatialReference |
The well-known ID of or the SpatialReference of the input geometries |
outSpatialReference |
SpatialReference |
The well-known ID of or the SpatialReference of the out geometries |
class ProjectResults
This class represent the parameters needed in an project operation
for a GeometryService
.
There is no constructor, use JavaScript object literal.
For more info see Project Operation.
Properties
Properties |
Type |
Description |
geometries |
Array.OverlayView|Array.object |
Array of google.maps.LatLng, Polyline, Polygon, or ESRI Geometry format to project. |
class QueryOptions
This class represent the parameters needed in an query operation for a Layer
.
There is no constructor, use JavaScript object literal.
For more info see Query Operation. There is no constructor for this class. Instead, this class is instantiated as a javascript object literal.
Properties
Properties |
Type |
Description |
geometry |
OverlayView|Array.OverlayView |
The geometry to apply as the spatial filter. |
maxAllowableOffset |
Number |
This option can be used to specify the maximum allowable offset to be used for generalizing geometries returned by the query operation |
objectIds |
Array.number |
The object IDs of this layer / table to be queried |
outFields |
Array.string |
The list of fields to be included in the returned resultset. |
overlayOptions |
OverlayOptions |
See OverlayOptions |
returnGeometry |
Boolean |
If true, If true, the resultset will include the geometries associated with each result. |
returnIdsOnly |
Boolean |
If true, the response only includes an array of object IDs. Otherwise the response is a feature set. The default is false. |
spatialRelationship |
SpatialRelationship |
The spatial relationship to be applied on the
input geometry while performing the query. The supported spatial relationships
include intersects, contains, envelope intersects, within, etc.
The default spatial relationship is intersects. See SpatialRelationship |
text |
String |
A literal search text. If the layer has a display field
associated with it, the server searches for this text in this field.
This parameter is a short hand for a where clause of:
where [displayField]like '%[text]%'. The text is case sensitive.
This parameter is ignored if the where parameter is specified. |
where |
String |
A where clause for the query filter. Any legal SQL where clause operating on the fields in the layer is allowed. |
class QueryRelatedRecordsOptions
This class represent the parameters needed in an query related records operation for a Layer
.
For more info see Query Related Records Operation. There is no constructor for this class. Instead, this class is instantiated as a javascript object literal.
Properties
Properties |
Type |
Description |
definitionExpression |
String |
The definition expression to be applied to the related table / layer. From the list of objectIds, only those records that conform to this expression will be returned. |
Number |
|
[maxAllowableOffset] This option can be used to specify the maximum allowable offset to be used for generalizing geometries returned by the query operation |
objectIds |
Array.number |
The object IDs of this layer / table to be queried |
outFields |
Array.string |
The list of fields to be included in the returned resultset. This list is a comma delimited list of field names. |
outSR |
Number |
The well-known ID of or the SpatialReference of the output geometries |
relatioshipId |
Int |
The ID of the relationship to be queried |
returnGeometry |
Boolean |
If true, the resultset will include the geometries associated with each result. The default value is true . |
class RelatedRecord
This class represent the result of an query related records operation for a Layer
.
There is no constructor, use JavaScript object literal.
For more info see Query Operation.
Properties
Properties |
Type |
Description |
objectId |
int |
objectid of original record |
relatedRecords |
Array.feature |
list of Feature s. |
class RelatedRecords
This class represent the results of an query related records operation for a Layer
.
For more info see Query Operation.
Properties
Properties |
Type |
Description |
displayFieldName |
String |
display Field Name for layer |
geometryType |
String |
esriGeometryPoint | esriGeometryMultipoint | esriGeometryPolygon | esriGeometryPolyline |
relatedRecordGroups |
Array.object |
list of related records |
spatialReference |
Object |
SpatialReference |
class ResultSet
This class represent the results of an query operation for a Layer
.
There is no constructor, use JavaScript object literal.
For more info see Query Operation.
Properties
Properties |
Type |
Description |
displayFieldName |
String |
display Field Name for layer |
features |
Array.feature |
result as array of Feature |
fieldAliases |
Object |
Field Name's Aliases. key is field name, value is alias. |
geometryType |
GemetryType |
esriGeometryPoint | esriGeometryMultipoint | esriGeometryPolygon | esriGeometryPolyline |
objectIdFieldName |
String |
objectIdFieldName when returnIdsOnly=true |
objectIds |
Array.int |
objectIds when returnIdsOnly=true |
class ReverseGeocodeOptions
This class represent the parameters needed in a reverseGeocode operation
on a GeocodeService
.
There is no constructor, use JavaScript object literal.
For more info see Reverse Geocode Operation. There is no constructor for this class. Instead, this class is instantiated as a javascript object literal.
Properties
Properties |
Type |
Description |
distance |
Number |
The distance in meters from the given location within which
a matching address should be searched. |
location |
google.maps.LatLng |
an object literal of LatLng. |
class ReverseGeocodeResult
This class represent one entry in the results of a find address operation for a
GeocodeService
.
There is no constructor, use JavaScript object literal.
For more info see Reverse Geocode Operation.
Properties
Properties |
Type |
Description |
address |
Object |
matched address, object literal with name-value address parts. |
location |
google.maps.LatLng |
matched location |
class RouteOptions
intance that specify how a route should be solved. There is no constructor for this class. Instead, this class is instantiated as a javascript object literal.
Properties
Properties |
Type |
Description |
barriers |
Array.google.maps.LatLng|Array.Marker |
the locations the route must avoid |
findBestSequence |
Boolean |
If true, the solver should resequence the route in the optimal order. The default is as defined in the network layer. |
preserveFirstStop |
Boolean |
If true, the solver should resequence the route in the optimal order. The default is as defined in the network layer. |
preserveLastStop |
Boolean |
If true, the solver should resequence the route in the optimal order. The default is as defined in the network layer. |
returnDirections |
Boolean |
If true, directions will be generated and returned with the analysis results. Default is true |
returnRoutes |
Boolean |
If true, routes will be returned with the analysis results. Default is true. |
stops |
Array.google.maps.LatLng|Array.Marker |
the locations the route must pass |
class RouteResults
intance that specify the results of the solve operation.
Properties
Properties |
Type |
Description |
stops |
Array.google.maps.LatLng |
|
class RouteTask
This class (RouteTask
) represent a Network Layer resource deployed in a NetWorkService.
It can solve a route based on stops, barrier
Constructor
Constructor |
Description |
RouteTask(url:String) |
Create a route task with the URL of the routing server resource. |
Methods
Methods |
Return Value |
Description |
solve(opt_Route:RouteOptions, callback:Function, errback:Function) |
None |
Solve a route based on inputs such as stops and barriers. Result of type RouteResults
is passed to Function callback, and error of type Error is passed to Function errback. |
class SpatialReference
This class (SpatialReference
) is for coordinate systems that converts value
between geographic and real-world coordinates. The following classes extend this class:
Geographic
, SphereMercator
, LambertConformalConic
, and TransverseMercator
.
Constructor
Constructor |
Description |
SpatialReference(params:Object) |
Create A Generic Spatial Reference Object
The params passed in constructor is a javascript object literal and depends on
the type of Coordinate System to construct. |
Properties
Properties |
Type |
Description |
wkid |
Number |
well-known coodinate system id (EPSG code) |
wkt |
String |
well-known coodinate system text |
Methods
Methods |
Return Value |
Description |
forward(lnglat:Array.number) |
Array.number |
Convert Lat Lng to real-world coordinates.
Note both input and output are array of [x,y], although their values in different units. |
getCircum() |
number |
Get the map the periodicity in x-direction, in map units NOT pixels |
inverse(coords:Array.number) |
Array.number |
Convert real-world coordinates to Lat Lng.
Note both input and output are are array of [x,y], although their values are different. |
toJSON() |
|
To JSON String |
class SpatialRelationship
This is actually a list of constants that represent spatial
relationship types.
Properties
Properties |
Type |
Description |
CONTAINS |
String |
esriSpatialRelContains |
CROSSES |
String |
esriSpatialRelCrosses |
ENVELOPE_INTERSECTS |
String |
esriSpatialRelEnvelopeIntersects |
INDEX_INTERSECTS |
String |
esriSpatialRelIndexIntersects |
INTERSECTS |
String |
esriSpatialRelIntersects |
OVERLAPS |
String |
esriSpatialRelOverlaps |
TOUCHES |
String |
esriSpatialRelTouches |
WITHIN |
String |
esriSpatialRelWithin |
class SphereMercator
This class (SphereMercator
) is the Projection Default Google Maps uses. It is a special form of Mercator. This class extends SpatialReference
.
Constructor
Constructor |
Description |
SphereMercator(params:Object) |
Creates a Spatial Reference based on Sphere Mercator Projection.
The params passed in constructor should have the following properties:
-wkid: wkid
-semi_major: ellipsoidal semi-major axis
-unit: meters per unit
-central_meridian: lamda0, longitude of the false origin (with respect to the prime meridian)
e.g. The "Web Mercator" used in ArcGIS Server:
var web_mercator = new SphereMercator({wkid: 102113, semi_major:6378137.0, central_meridian:0, unit: 1 });
|
Methods
class TileInfo
This class contains information about map tile infornation for a cached map service.
There is no constructor for this class.
Properties
Properties |
Type |
Description |
cols |
Number |
tile cols size, e.g. 512, must be same as rows |
compressionQuality |
Number |
JPEG only.0-100. |
dpi |
Number |
dot per inch for map tiles. |
format |
String |
PNG8 | PNG24 | PNG32 | GIF | JPEG |
lods |
Array.LOD |
Array of Level of Details. See LOD |
origin |
Point |
origin of tile system of type |
rows |
Number |
tile row size, e.g. 512, must be same as cols |
spatialReference |
SpatialReference |
spatial reference. wkid info only. |
class TileLayer
This class (TileLayer
) provides access to a cached ArcGIS Server
map service. There is no GTileLayer
class in Google Maps API V3, this class is kept to allow
finer control of zoom levels for each individual tile sets within a map type, such as zoom level range and opacity.
Constructor
Constructor |
Description |
TileLayer(service:MapService, opt_layerOpts:TileLayerOptions) |
Creates a tile layer from a cached by ArcGIS map service.
service (required) is the underline MapService
opt_layerOpts (optional) is an instance of TileLayerOptions . |
Methods
Methods |
Return Value |
Description |
getMapService() |
MapService |
get the underline MapService |
getOpacity() |
Number |
get the opacity (0-1) of the tile layer |
setOpacity(op:Number) |
None |
set Opacity |
class TileLayerOptions
Instances of this class are used in the opt_layerOpts
argument
to the constructor of the TileLayer
class. There is no constructor for this class. Instead, this class is instantiated as a javascript object literal.
Properties
Properties |
Type |
Description |
hosts |
String |
host pattern of tile servers if they are numbered. Most browser
has default restrictions on how many concurrent connections can be made to
a single host. One technique to workaround this is to create multiple hosts and rotate them when
loading tiles.
The syntax is prefix[numberOfHosts]suffix , for example, "mt[4].google.com" means
rotate hosts in mt0.google.com, mt1.google.com, mt2.google.com, mt3.google.com (4 hosts). |
maxZoom |
Number |
max zoom level. |
minZoom |
Number |
min zoom level. |
opacity |
Number |
opacity (0-1). |
class TransverseMercator
This class (TransverseMercator
) represents a Spatial Reference System based on
Transverse Mercator Projection This class extends SpatialReference
.
Constructor
Constructor |
Description |
TransverseMercator(params:Object) |
Create a Transverse Mercator Projection. The params passed in constructor should contain the
following properties:
-wkid: well-known id
-semi_major: ellipsoidal semi-major axis in meters
-unit: meters per unit
-inverse_flattening: inverse of flattening of the ellipsoid where 1/f = a/(a - b)
-Scale Factor: scale factor at origin
-latitude_of_origin: phi0, latitude of the false origin
-central_meridian: lamda0, longitude of the false origin (with respect to the prime meridian)
-false_easting: FE, false easting, the Eastings value assigned to the natural origin
-false_northing: FN, false northing, the Northings value assigned to the natural origin
e.g. Georgia West State Plane NAD83 Feet:
var gawsp83 = new TransverseMercator({wkid: 102667, semi_major:6378137.0,
inverse_flattening:298.257222101,central_meridian:-84.16666666666667, latitude_of_origin: 30.0,
scale_factor:0.9999, false_easting:2296583.333333333, false_northing:0, unit: 0.3048006096012192});
|
Methods
namespace Util
A set of utilities ((Util
)
for commonly used functions.
Static Methods
Static Methods |
Return Value |
Description |
addToMap(map:google.maps.Map, overlays:Array.OverlayView) |
None |
Add a list of overlays to map |
getJSON(url:String, params:Object, callbackName:String, callbackFn:Function) |
String |
Make Cross Domain Calls. This function returns the
script ID which can be used to track the requests. parameters:
- url: url of server resource
- params: an object with name,value pairs. value must be string
- callbackName: Callback parameter name the server is expecting.e.g:'callback'
- callbackFn: the actual callback function.
|
registerSR(wkid/wkt:Number|String, wktOrSR:Object) |
SpatialReference |
static method. Call with Syntax SpatialReference.register(..) .
Add A Spatial Reference to the internal collection of Spatial References.
the wktOrSR parameter can be String format of "well-known text" of the
Spatial Reference, or an instance of SpatialReference .
If passes in String WKT format, to be consistent, it should use the same format as listed
in
ESRI documentation. For example, add NC State Plane NAD83 as String:
SpatialReference.register(2264,'PROJCS["NAD_1983_StatePlane_North_Carolina_FIPS_3200_Feet",
GEOGCS["GCS_North_American_1983",
DATUM["D_North_American_1983",
SPHEROID["GRS_1980",6378137.0,298.257222101]],
PRIMEM["Greenwich",0.0],
UNIT["Degree",0.0174532925199433]],
PROJECTION["Lambert_Conformal_Conic"],
PARAMETER["False_Easting",2000000.002616666],
PARAMETER["False_Northing",0.0],
PARAMETER["Central_Meridian",-79.0],
PARAMETER["Standard_Parallel_1",34.33333333333334],
PARAMETER["Standard_Parallel_2",36.16666666666666],
PARAMETER["Latitude_Of_Origin",33.75],
UNIT["Foot_US",0.3048006096012192]]');
Note: only Lambert Conformal Conic and Transverse Mercator Projection
based Spatial References are supported if added via WKT String.
If passes in an instance of SpatialReference , it can be one of the
built in classes, or a class that extends SpatialReference. For example, add NC State Plane NAD83 as SR:
SpatialReferences.register(2264: new LambertConformalConic({
wkid: 2264,
semi_major: 6378137.0,
inverse_flattening: 298.257222101,
standard_parallel_1: 34.33333333333334,
standard_parallel_2: 36.16666666666666,
central_meridian: -79.0,
latitude_of_origin: 33.75,
'false_easting': 2000000.002616666,
'false_northing': 0,
unit: 0.3048006096012192
});
|
removeFromMap(overlays:Array.OverlayView, clearArray:Boolean) |
None |
Add a list of overlays to map |
Events
Events |
Arguments |
Description |
jsonpend |
<span class="type">scriptID:String</span> |
This event is fired after a REST JSONP response was returned by server. |
jsonpstart |
<span class="type">scriptID:String</span> |
This event is fired before a REST request sent to server. |