ArcGIS Server Link for Google Maps API: Concepts

Examples | Class References

This library provides access to ESRI's ArcGIS Server via it's REST API from Google Maps API. The main concepts of this library are:

Google Maps API Extension Classes

For developers who are familiar with the core Google Maps API classes, this library can be considered as a collection of custom/extension classes to the core API that facilitates access to ArcGIS Server. You can accomplish many tasks by using only those subclasses. Several principles are used in the design:

The following table describes the classes in the core Google Maps API and their corresponding sub classes in this library.

Core Google Maps API Class ArcGIS Link Class
GOverlay, GGroundOverlay ArcGISMapOverlay
GTileLayer ArcGISTileLayer
GTileLayerOverlay ArcGISTileLayerOverlay
GMapType ArcGISMapType
GProjection ArcGISProjection

REST API Classes

The GMap extension classes are built on top of a number of classes that communicates with ArcGIS Server. Developers who want to get lower level access can use those classes by calling the ArcGISTileLayer.getMapService() or ArcGISMapOverlay.getMapService(). Those classes are designed to closely reflect the actual REST API. Several principles are used in the design:

The following is a table that describes the REST resource and their corresponding classes:

REST Resource Library Class
Map Service ArcGISMapService
Layer ArcGISLayer
Geocode Service ArcGISGeocodeService
GP Service TBD
Geometry Service ArcGISGeometryService
Image Service TBD

The load Event

ArcGIS services may be published with different spatial reference systems. If they are pre-rendered as map tiles, they will use a certain "tiling scheme". Some of them may use the exact same tile scheme as Google maps, some may not. In order to let the core Google Maps API know how to load tiles correctly, it is necessary to get information about how the tiles are constructed from the server first. This is an asynchronous process. For this reason, it's often necessary to wait for the "load" event before using an ArcGIS Link class. It is not necessary to wait if...

Rule of thumb: when in doubt, always use 'load' event.

var tileLayer=new ArcGISTileLayer(url);
GEvent.addListener(tileLayer,'load', function(){
  // start use the tile Layer.
});

Spatial Reference Support

This library provides additional spatial reference support by implementing interface ArcGISSpatialReference, which converts between Lat/Lng and map coordinates, then using an intermediate class ArcGISProjection to bridge Google's coordinate system to ArcGIS's system. This library includes a few built-in spatial references: WGS84 (4326) and WebMercator (102113). It also has two of the most widely used projections: LambertConformalConic and Transverse Mercator. Spatial references based on these two projections can be used by calling ArcGISSpatialReferences.addSpatialReference(wkid, wkt). A developer can also implement their own projection class and plug it in. If the system fails to find an implemented spatial reference, it will use ArcGISFlatSpatialReference for somewhat less accurate coordinates transformation. Here is a summary of options:

Layer Orders/z-Index

ArcGIS Maps can be added with one of the following types: ArcGISMapOverlay, ArcGISTileLayerOverlay, or ArcGISMapType.