Socket
Book a DemoInstallSign in
Socket

@yandex/ymaps3-minimap

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@yandex/ymaps3-minimap

Yandex Maps JS API 3.0 example ymaps3-minimap

latest
npmnpm
Version
0.0.4
Version published
Weekly downloads
2.3K
8.97%
Maintainers
2
Weekly downloads
 
Created
Source

ymaps3-minimap package

Yandex JS API package

npm version NPM Downloads

How use

The package is located in the dist folder:

  • dist/types TypeScript types
  • dist/esm es6 modules for direct connection in your project
  • dist/index.js Yandex JS Module

Recommended use ymaps3-minimap as usual npm package:

npm install @yandex/ymaps3-minimap

and dynamic import

main();
async function main() {
  await ymaps3.ready;
  const {YMap, YMapDefaultSchemeLayer, YMapDefaultFeaturesLayer, YMapControls} = ymaps3;

  const {YMapMiniMap} = await import('@yandex/ymaps3-minimap');

  let collapsed = false;

  map = new YMap(document.getElementById('app'), {location: LOCATION});

  map.addChild(new YMapDefaultSchemeLayer({}));
  map.addChild(new YMapDefaultFeaturesLayer({}));

  const onButtonClick = () => {
    collapsed = !collapsed;
    minimap.update({collapsed});
  };

  const minimap = new YMapMiniMap({size: [200, 200], zoomOffset: 5, collapsed, onButtonClick});
  map.addChild(new YMapControls({position: 'left bottom'}).addChild(minimap));
}

You also need to import css styles into your project:

/* index.css */
@import '@yandex/ymaps3-minimap/dist/esm/index.css';

Usage without npm

You can use CDN with module loading handler in JS API on your page.

By default ymaps3.import can load self modules. If you want also load your package, should register cdn:

ymaps3.import.registerCdn('https://cdn.jsdelivr.net/npm/{package}', '@yandex/ymaps3-minimap@latest');

Just use ymaps3.import:

await ymaps3.ready;
const {YMapMiniMap} = await ymaps3.import('@yandex/ymaps3-minimap');

YMapMiniMap props description

NameTypeDefaultDescription
size[number, number][128, 90]Size of the mini-map in pixels.
zoomOffsetnumber5Difference in zoom levels between the overview map and the main map.
zoomRange{min: number; max: number}Zoom range of the mini-map. Can be used to fix the zoom level.
showBoundsbooleantrueDisplay the boundaries of the main map's visible area on the mini-map.
controllablebooleantrueAbility to control the main map through the mini-map interface. Moving the mini-map will move the main map.
collapsedbooleanfalseState of the mini-map: collapsed or expanded.
showCollapsedControlbooleantrueShow control for collapsing/expanding the mini-map.
boundsDrawingStyleDrawingStyleStyle for rendering the polygon of the main map's visible area boundaries on the mini-map.
locationYMapLocationRequestFixed center and zoom level of the mini-map, if required.
onButtonClickfunctionCollapse button control click.
cameraYMapCameraRequestMini-map camera, if required. By default, the mini-map camera matches the main map's camera.

FAQs

Package last updated on 18 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts