Documentation
Reference
2.1.53 (current version)
collection
interactivityModel
Interfaces

overlay.Rectangle

Extends IOverlay.

Polygon overlay. By default, the overlays have not been added to package.full (the standard set of modules). To create your own overlay instance, use overlay.storage.

Constructor | Fields | Events | Methods

Constructor

overlay.Rectangle(geometry[, data[, options]])

Parameters:

ParameterDefault valueDescription
geometry *
[no-highlight[

* Mandatory parameter/option.

]no-highlight]

Type: IPixelRectangleGeometry

Pixel geometry of a shape.

data

Type: Object

Data.

options

Type: Object

Options.

options.borderRadius

Type: Number

Radius of rounded corners.

options.fill

Type: String

Whether there is fill.

options.fillColor

Type: String

Fill color graphics.style.color.

options.fillImageHref

Type: String

Background image. When this option is enabled, the "fillColor" value is ignored.

options.fillMethod 'stretch'

Type: String

Type of background fill. Accepts one of two values:

  • stretch - The background image stretches to fit the size of the overlay.
  • tile - The background image is repeated, without changing its size. This is similar to background-repeat in CSS. It can be used for filling a shape with a template.

options.fillOpacity

Type: Number

Fill transparency.

options.interactive true

Type: Boolean

Disables the object's reaction to DOM events.

options.opacity

Type: Number

Overall transparency.

options.outline

Type: String

Whether there is an outline.

options.separateContainer

Type: Boolean

It is drawn on a separate layer.

options.strokeColor

Type: String

Line color graphics.style.color.

options.strokeOpacity

Type: Number

Contour transparency.

options.strokeStyle

Type: Number[]|String

Contour style (not supported in Canvas mode) graphics.style.stroke.

options.strokeWidth

Type: Number

Line width.

* Mandatory parameter/option.

Fields

NameTypeDescription
eventsIEventManager

Event manager.

Inherited from IDomEventEmitter.

optionsIOptionManager

Options manager.

Inherited from ICustomizable.

Events

NameDescription
click

Single left-click on the object. When using, keep in mind that mouse events are emulated when a touch screen is used. More information is available in domEvent.manager.

Inherited from IDomEventEmitter.

contextmenu

Calls the element's context menu. When using, keep in mind that mouse events are emulated when a touch screen is used. More information is available in domEvent.manager.

Inherited from IDomEventEmitter.

datachange

Data change. Data fields:

  • oldData - Old data.
  • newData - New data.

Inherited from IOverlay.

dblclick

Double left-click on the object. When using, keep in mind that mouse events are emulated when a touch screen is used. More information is available in domEvent.manager.

Inherited from IDomEventEmitter.

emptinesschange

Change to the empty overlay flag. Instance of the Event class.

Inherited from IOverlay.

geometrychange

Changed geometry. Data fields:

  • oldGeometry - Old pixel geometry.
  • newGeometry - New pixel geometry.

Inherited from IOverlay.

mapchange

Map reference changed. Data fields:

  • oldMap - Old map.
  • newMap - New map.

Inherited from IOverlay.

mousedown

Pressing the mouse button over the object. When using, keep in mind that mouse events are emulated when a touch screen is used. More information is available in domEvent.manager.

Inherited from IDomEventEmitter.

mouseenter

Pointing the cursor at the object. When using, keep in mind that mouse events are emulated when a touch screen is used. More information is available in domEvent.manager.

Inherited from IDomEventEmitter.

mouseleave

Moving the cursor off of the object. When using, keep in mind that mouse events are emulated when a touch screen is used. More information is available in domEvent.manager.

Inherited from IDomEventEmitter.

mousemove

Moving the cursor over the object. When using, keep in mind that mouse events are emulated when a touch screen is used. More information is available in domEvent.manager.

Inherited from IDomEventEmitter.

mouseup

Letting go of the mouse button over an object. When using, keep in mind that mouse events are emulated when a touch screen is used. More information is available in domEvent.manager.

Inherited from IDomEventEmitter.

multitouchend

End of multitouch. This event is only available on devices that support multitouch. Returns an implementation of the IMultiTouchEvent interface.

Inherited from IDomEventEmitter.

multitouchmove

Repeating event during multitouch. This event is only available on devices that support multitouch. Returns an implementation of the IMultiTouchEvent interface with information about touches. Defines the touches property, which contains a list of touches. Every touch is described by an object that contains the following fields:

  • clientX - X coordinate of the touch relative to the viewable area of the browser.
  • clientY - Y coordinate of the touch relative to the viewable area of the browser.
  • pageX - X coordinate of the touch relative to the beginning of the document.
  • pageY - Y coordinate of the touch relative to the beginning of the document.

Inherited from IDomEventEmitter.

multitouchstart

Start of multitouch. This event is only available on devices that support multitouch. Returns an implementation of the IMultiTouchEvent interface with information about touches. Defines the touches property, which contains a list of touches. Every touch is described by an object that contains the following fields:

  • clientX - X coordinate of the touch relative to the viewable area of the browser.
  • clientY - Y coordinate of the touch relative to the viewable area of the browser.
  • pageX - X coordinate of the touch relative to the beginning of the document.
  • pageY - Y coordinate of the touch relative to the beginning of the document.

Inherited from IDomEventEmitter.

optionschange

Change to the object options.

Inherited from ICustomizable.

shapechange

Change to the shape of the area spanning the overlay. Instance of the Event class.

Inherited from IOverlay.

wheel

Mouse wheel scrolling. When using, keep in mind that mouse events are emulated when a touch screen is used. More information is available in domEvent.manager.

Inherited from IDomEventEmitter.

Methods

NameReturnsDescription
getData()

Object

Returns the overlay data object.

Inherited from IOverlay.

getGeometry()

IPixelGeometry

Returns the current pixel geometry.

Inherited from IOverlay.

getMap()

Map|null

Returns reference to the current map.

Inherited from IOverlay.

getShape()

IShape|null

Returns a shape that defines the area spanning the overlay in global pixel coordinates, or null if it is not possible to plot the shape.

Inherited from IOverlay.

isEmpty()

Boolean

Returns true if the layout is empty, i.e. it does not have any content. This indicator is used for hiding empty objects such as hints, balloons, and others.

Inherited from IOverlay.

setData(data)

Sets the overlay data.

Inherited from IOverlay.

setGeometry(geometry)

Sets the overlay pixel geometry.

Inherited from IOverlay.

setMap(map)

Sets the map on which to display the overlay.

Inherited from IOverlay.