@yandex/ymaps3-types
Version:
Types for ymaps3 maps library
40 lines (39 loc) • 1.23 kB
TypeScript
import type { Projection } from "../../common/types";
/**
* @class Mercator projection onto a sphere.
* Used by many mapping services, in particular OpenStreetMap.
* @name projection.sphericalMercator
* @augments Projection
* @static
* @deprecated Use [Web Mercator package](https://www.npmjs.com/package/@yandex/ymaps3-web-mercator-projection) instead.
* @example
* ```js
* const {SphericalMercator} = await ymaps3.import('@yandex/ymaps3-spherical-mercator-projection@0.0.1');
* // Create a map in the spherical Mercator projection
* const map = new ymaps3.YMap(document.getElementById('YMapsID'), {
* location: {
* center: [37, 55],
* zoom: 6
* },
* projection: new SphericalMercator()
* });
* const dataSourceProps = {
* raster: {
* type: 'ground',
* fetchTile: "https://tile.openstreetmap.org/{{z}}/{{y}}/{{x}}"
* }
* };
* // Add osm tiles
* const dataSource = new ymaps3.YMapTileDataSource({
* id: "osmSource",
* ...dataSourceProps,
* });
*
* const layer = new ymaps3.YMapLayer({
* id: "osm",
* source: "osmSource",
* type: "ground",
* });
* ```
*/
export declare const SphericalMercator: new () => Projection;