Google Maps Layer for ArcGIS Server JavaScript API

Use Google Maps in application built on ESRI ArcGIS Server JavaScript API.

For a description and examples of how to use this library, check out the how-to.

class GoogleMapsAPIOptions

This is an object literal that specify the option to load Google Maps API V3. See Google documentation for more information. There is no constructor for this class. Instead, this class is instantiated as a javascript object literal.

Properties

Properties Type Description
client String client ID for Google Maps Premier license.
dir String Bi-directional (Bidi) text. rtl or ltr;
language String language to use for text such as the names for controls, etc, e.g. cn, ja
libraries String Additonal libraries (geometry|places|adsense);
sensor Boolean whether GPS device is used. default to false;
v Number API version, 3, 3.1 etc. default to 3.

class GoogleMapsLayer

This class allows Google Maps been used in ESRI ArcGIS JavaScript API.

Constructor

Constructor Description
GoogleMapsLayer(opts:GoogleMapsLayerOptions) Create a GoogleMapsLayer using config GoogleMapsLayerOptions

Methods

Methods Return Value Description
getGoogleMapInstance() google.maps.Map get the wrapped google.maps.Map for further customization.
setMapStyle(styles:Object[]) None set map style for customized base map. The style specs are available at Google Documentation. This class privide a few pre-defined styles: MAP_STYLE_GRAY|MAP_STYLE_NIGHT.
setMapTypeId(mapTypeId:String) None set map type id. e.g GoogleMapsLayer.MAP_TYPE_ROADMAP
setOpacity(opacity:Number) None Sets Opacity
setVisibleLayers(list:Number[]) None Sets layer visibility.

Events

Events Arguments Description
onMapTypeChange mapTypeId:String Fired when Google Map Type (ROAD, SATERLLITE etc) changed
onStreetViewVisibilityChange visibility:boolean Fired when Street View visibility changed.

class GoogleMapsLayerOptions

This is an object literal that specify the option to construct a GoogleMapsLayer. There is no constructor for this class. Instead, this class is instantiated as a javascript object literal.

Properties

Properties Type Description
apiOptions GoogleMapsAPIOptions The options to load Google API. Include property: v, client, sensor, language etc,see GoogleMapsAPIOptions
id String layerId.
mapOptions google.maps.MapOptions optional. The options for construct Google Map instance. See MapOptions.
opacity Number opacity (0-1)
visible Boolean default visibility