Version:
Popular examples
Map
Geo objects
Balloon and hint
Controls
Hotspots
Regions
Clustering
GeoQuery
Behaviors and events
Search on a map
Traffic
User's location
Routing
YMapsML
GeoXML
ObjectManager
Modular system
Panoramas
External modules

Custom balloon layout with autopositioning

Save as filesEdit on JSFiddle

To create your own balloon "from scratch", you can use the templateLayoutFactory factory. However, the balloon class must implement the IBalloon interface.

In order for the balloon to support autopositioning, meaning it automatically adjusts to the size of the content, you need to correctly state its current size. To do this, implement the getShape() method.

When you change the content of a balloon in the onSublayoutSizeChange() method, override the offset option and throw the shapechange event.