Comment on page
To dictate & restrict what the map can and should do, regardless of its contents, it needs some guidance!
It provides options that can be categorized into three main parts:
Changing these properties after the map has already been built for the first time will have no effect: they only apply on initialisation.
One part of
MapOptionsresponsibilities is to define how the map should be positioned when first loaded. There's two ways to do this (that are incompatible):
- by bounds (circumscribed):
- by bounds (inscribed):
- by coordinates (circumscribed):
It is possible to also set the map's
initialRotationin degrees, if you don't want it North (0°) facing initially.
If rotation is enabled/allowed, if using
initialCameraFit, prefer defining it by coordinates for a more intended/tight fit.
One part of
MapOptionsresponsibilities is to define the restrictions and limitations of the map and what users can/cannot do with it.
Some of the options are described elsewhere in this documentation, in context. In addition, the API docs show all the available options, and below is a partial list of options:
- camera bounds inside bounds:
- camera center inside bounds:
- unconstrained (default):
minZoomSets a hard limit on the maximum and minimum amounts that the map can be zoomed
maxZoom(or in addition to), consider setting
TileLayerinstead, to allow tiles to scale (and lose quality) on the final zoom level, instead of setting a hard limit.
Last modified 1mo ago