BoundsBox 1.0 provides image option.

BoundsBox is an extension for overlaying <DIV> elements on v3 map by coordinates. BoundsBox is a subclass of OverlayView.

Version 1.0 provides a new option to overlay images. Images are scaled when map is zoomed.

Opacity is adjustable.

Get the code.


new BoundsBox(Map, LatLngBounds, {opt_options});

BoundsBox optional options object

Property Type Description
html string Html contents of the div.
className string CSS class of the div. Default: "bounds-box"
fit boolean If true, map viewport will be fitted to show the box. Default: false.
imageSrc string Url of image file. Image object is created only if this option is given.From 1.0
pane string You can select another pane for the overlay. Default: "overlayLayer". From 1.0
zIndex number zIndex of the div relative to the pane. From 1.0

BoundsBox methods

Method Return Value Description
remove() - Removes the div from DOM.
getPosition() LatLng Returns center LatLng of the box. Makes it possible to use BoundsBox as an InfoWindow anchor.
setContent(string) - Sets innerHTML of the div.
getContent() string Returns innerHTML of the div.
setClassName(string) - Sets CSS class of the div.
getClassName() string Returns CSS class of the div.
getDiv() html object Returns reference to the div.
getSize() Size Returns dimensions of the div as a Size object.
getImage() html object Returns reference to the optional image element. From 1.0
setImageSrc(); - Sets url of the optional image file. From 1.0
setOpacity(number) - Sets opacity of the overlay. Range 0...1 From 1.0
setZIndex(number) - Sets zIndex of the overlay relative to the pane. From 1.0
getZIndex() - Returns zIndex value of the div. From 1.0

BoundsBox events

Event Parameters Description
click Mouse event Fired when user clicks on the div. On overlapping divs, the topmost takes the click.
imageloaded - Fired when optional image is loaded. From 1.0
imageloaderror - Fired if optional image loading was not a succes. From 1.0
Other DOM event listeners can easily be attached to the div by getDiv() method.

New versions

BounsdBox is under continuous development.


More experiments

Overlays with km size (v1.1) New

Geocoder bounds with BoundsBox The first one (v0.1)