ValyroUI Русская версия

Tile Map

Lightweight tile map: markers, route, popup cards, zoom. Pro · Charts and analytics › Maps and matrices

Installation

npx valyro-cli@latest login
npx valyro-cli@latest add tile-map
npm install valyro-ui-pro

import 'valyro-ui-pro/styles.css';
import { TileMap } from 'valyro-ui-pro';

Props

PropTypeDefault
centerLatLngMap center (controlled).
defaultCenterLatLngInitial center when uncontrolled.
onCenterChange(center: LatLng) => voidCalled with the new center when it changes.
zoomnumberZoom level, 0 (world) to 19 (street).
defaultZoomnumberInitial zoom when uncontrolled.
onZoomChange(zoom: number) => voidCalled with the new zoom when it changes.
minZoomnumber2Farthest zoom out allowed. Default 2.
maxZoomnumber18Closest zoom in allowed. Default 18.
tileUrlstring'https://tile.openstreetmap.org/{z}/{x}/{y}.png'Raster tile template with {z}, {x}, {y} and optional {s} (a, b, c) and {r} (@2x). Default: OpenStreetMap.
darkTileUrlstringTiles for dark color schemes; without it the light tiles are inverted.
markersMapMarker[][]Pins.
routesMapRoute[][]Polylines: a delivery route, a track.
activeMarkerstring | nullMarker whose popup is open (controlled).
defaultActiveMarkerstring | nullInitial activeMarker when uncontrolled.
onActiveMarkerChange(id: string | null) => voidCalled with the new activeMarker when it changes.
heightnumber | string420CSS height of the map. Default 420px.
controlsbooleantrueZoom and full-screen buttons. Default true.
scrollZoom'modifier' | 'always''modifier'modifier: the wheel zooms only with Ctrl / ⌘ (the page keeps scrolling); always: it always zooms.
childrenReactNodeOverlay content: a route card, a search box. Position it yourself.
labelsPartial<TileMapLabels>Overrides for the built-in English text; keys left out keep their defaults.

Related components

Previous: Map Chart · Next: Cohort Retention Matrix · All Charts and analytics