Image overlays Stay organized with collections Save and categorize content based on your preferences.
MapTypeinterface
google.maps.MapTypeinterface
This interface defines the map type, and is typically used for custom map types. Immutable.
Properties | |
|---|---|
maxZoom | Type: numberThe maximum zoom level for the map when displaying this MapType. Required for base MapTypes, ignored for overlay MapTypes. |
minZoom | Type: numberThe minimum zoom level for the map when displaying this MapType. Optional; defaults to 0. |
radius | Type: numberRadius of the planet for the map, in meters. Optional; defaults to Earth's equatorial radius of 6378137 meters. |
altoptional | Type: stringoptionalAlt text to display when this MapType's button is hovered over in the MapTypeControl. Optional. |
nameoptional | Type: stringoptionalName to display in the MapTypeControl. Optional. |
projectionoptional | Type: ProjectionoptionalThe Projection used to render this MapType. Optional; defaults to Mercator. |
tileSizeoptional | Type: SizeoptionalThe dimensions of each tile. Required. |
Methods | |
|---|---|
getTile | getTile(tileCoord, zoom, ownerDocument)Parameters: Return Value: Element|null Resulting tile.Returns a tile for the given tile coordinate (x, y) and zoom level. This tile will be appended to the given ownerDocument. Not available for base map types. |
releaseTile | releaseTile(tile)Parameters:
Return Value: voidReleases the given tile, performing any necessary cleanup. The provided tile will have already been removed from the document. Optional. |
Projectioninterface
google.maps.Projectioninterface
Projection interface.
Methods | |
|---|---|
fromLatLngToPoint | fromLatLngToPoint(latLng[, point])Parameters:
Return Value: Point|nullTranslates from the LatLng cylinder to the Point plane. This interface specifies a function which implements translation from given LatLng values to world coordinates on the map projection. The Maps API calls this method when it needs to plot locations on screen.Projection objects must implement this method, but may returnnull if the projection cannot calculate thePoint. |
fromPointToLatLng | fromPointToLatLng(pixel[, noClampNoWrap])Parameters:
Return Value: LatLng|nullThis interface specifies a function which implements translation from world coordinates on a map projection to LatLng values. The Maps API calls this method when it needs to translate actions on screen to positions on the map.Projection objects must implement this method, but may returnnull if the projection cannot calculate theLatLng. |
ImageMapTypeclass
google.maps.ImageMapTypeclass
This class implements the MapType interface and is provided for rendering image tiles.
This class extendsMVCObject.
This class implementsMapType.
Access by callingconst {ImageMapType} = await google.maps.importLibrary("maps").
SeeLibraries in the Maps JavaScript API.
Constructor | |
|---|---|
ImageMapType | ImageMapType(opts)Parameters:
Constructs an ImageMapType using the provided ImageMapTypeOptions |
Properties | |
|---|---|
alt | Type: stringoptional |
maxZoom | Type: number |
minZoom | Type: number |
name | Type: stringoptional |
projection | Type: Projection |
radius | Type: number |
tileSize | Type: Size |
Methods | |
|---|---|
getOpacity | getOpacity()Parameters: None Return Value: number opacity The current opacity.Returns the opacity level ( 0 (transparent) to1.0) of theImageMapType tiles. |
getTile | getTile(tileCoord, zoom, ownerDocument)Parameters: Return Value: Element|null Resulting tile. |
releaseTile | releaseTile(tileDiv)Parameters:
Return Value: None |
setOpacity | setOpacity(opacity)Parameters:
Return Value: None Sets the opacity level ( 0 (transparent) to1.0) of theImageMapType tiles. |
Inherited:addListener,bindTo,get,notify,set,setValues,unbind,unbindAll | |
Events | |
|---|---|
tilesloaded | function()Arguments: None This event is fired when the visible tiles have finished loading. |
ImageMapTypeOptionsinterface
google.maps.ImageMapTypeOptionsinterface
This class is used to create a MapType that renders image tiles.
Properties | |
|---|---|
altoptional | Type: stringoptionalAlt text to display when this MapType's button is hovered over in the MapTypeControl. |
getTileUrloptional | Type: function(Point, number): (stringoptional)optionalReturns a string (URL) for given tile coordinate (x, y) and zoom level. |
maxZoomoptional | Type: numberoptionalThe maximum zoom level for the map when displaying this MapType. |
minZoomoptional | Type: numberoptionalThe minimum zoom level for the map when displaying this MapType. Optional. |
nameoptional | Type: stringoptionalName to display in the MapTypeControl. |
opacityoptional | Type: numberoptionalThe opacity to apply to the tiles. The opacity should be specified as a float value between 0 and 1.0, where 0 is fully transparent and 1 is fully opaque. |
tileSizeoptional | Type: SizeoptionalThe tile size. |
GroundOverlayclass
google.maps.GroundOverlayclass
A rectangular image overlay on the map.
This class extendsMVCObject.
Access by callingconst {GroundOverlay} = await google.maps.importLibrary("maps").
SeeLibraries in the Maps JavaScript API.
Constructor | |
|---|---|
GroundOverlay | GroundOverlay(url, bounds[, opts])Parameters:
Creates a ground overlay from the provided image URL and its LatLngBounds. The image is scaled to fit the current bounds, and projected using the current map projection. |
Methods | |
|---|---|
getBounds | getBounds()Parameters: None Return Value: LatLngBoundsGets the LatLngBounds of this overlay. |
getMap | getMap()Parameters: None Return Value: MapReturns the map on which this ground overlay is displayed. |
getOpacity | getOpacity()Parameters: None Return Value: numberReturns the opacity of this ground overlay. |
getUrl | getUrl()Parameters: None Return Value: stringGets the url of the projected image. |
setMap | setMap(map)Parameters:
Return Value: None Renders the ground overlay on the specified map. If map is set to null, the overlay is removed. |
setOpacity | setOpacity(opacity)Parameters:
Return Value: None Sets the opacity of this ground overlay. |
Inherited:addListener,bindTo,get,notify,set,setValues,unbind,unbindAll | |
Events | |
|---|---|
click | function(event)Arguments:
This event is fired when the DOM click event is fired on the GroundOverlay. |
dblclick | function(event)Arguments:
This event is fired when the DOM dblclick event is fired on the GroundOverlay. |
GroundOverlayOptionsinterface
google.maps.GroundOverlayOptionsinterface
This object defines the properties that can be set on aGroundOverlay object.
Properties | |
|---|---|
clickableoptional | Type: booleanoptionalIf true, the ground overlay can receive mouse events. |
mapoptional | Type: MapoptionalThe map on which to display the overlay. |
opacityoptional | Type: numberoptionalDefault: 1.0The opacity of the overlay, expressed as a number between 0 and 1. Optional. |
StyledMapTypeclass
google.maps.StyledMapTypeclass
Creates aMapType with a custom style.
This class extendsMVCObject.
This class implementsMapType.
Access by callingconst {StyledMapType} = await google.maps.importLibrary("maps").
SeeLibraries in the Maps JavaScript API.
Constructor | |
|---|---|
StyledMapType | StyledMapType(styles[, options])Parameters:
Creates a styled MapType with the specified options. TheStyledMapType takes an array ofMapTypeStyles, where eachMapTypeStyle is applied to the map consecutively. A laterMapTypeStyle that applies the sameMapTypeStylers to the same selectors as an earlierMapTypeStyle will override the earlierMapTypeStyle.Note that the StyledMapType is not supported when a map ID is set. When using both together, you will receive a console warning. |
Properties | |
|---|---|
alt | Type: string |
maxZoom | Type: number |
minZoom | Type: number |
name | Type: string |
projection | Type: Projection |
radius | Type: number |
tileSize | Type: Size |
Methods | |
|---|---|
getTile | getTile(tileCoord, zoom, ownerDocument)Parameters: Return Value: Element|null Resulting tile. |
releaseTile | releaseTile(tile)Parameters:
Return Value: None |
Inherited:addListener,bindTo,get,notify,set,setValues,unbind,unbindAll | |
StyledMapTypeOptionsinterface
google.maps.StyledMapTypeOptionsinterface
This class is used to specify options when creating aStyledMapType. These options cannot be changed after theStyledMapType is instantiated.
Properties | |
|---|---|
altoptional | Type: stringoptionalText to display when this MapType's button is hovered over in the map type control. |
maxZoomoptional | Type: numberoptionalThe maximum zoom level for the map when displaying this MapType. Optional. |
minZoomoptional | Type: numberoptionalThe minimum zoom level for the map when displaying this MapType. Optional. |
nameoptional | Type: stringoptionalThe name to display in the map type control. |
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-11-21 UTC.