mirror of
https://github.com/Maks1mS/free-ozon-dpr.git
synced 2024-12-23 18:42:59 +03:00
31 lines
657 B
JavaScript
31 lines
657 B
JavaScript
import 'ol/ol.css';
|
|
import Map from 'ol/Map';
|
|
import View from 'ol/View';
|
|
import TileLayer from 'ol/layer/Tile';
|
|
import { fromLonLat } from 'ol/proj';
|
|
import { XYZ } from 'ol/source';
|
|
|
|
const MAP_TARGET = 'map';
|
|
const MAP_CENTER = fromLonLat([37.57725139554275, 48.02287702854201]);
|
|
const MAP_ZOOM = 8.5;
|
|
|
|
const customTileSource = new TileLayer({
|
|
source: new XYZ({
|
|
url: 'https://tile-server.ozon.ru/tile/default/{z}/{x}/{y}.png'
|
|
})
|
|
});
|
|
|
|
export const view = new View({
|
|
center: MAP_CENTER,
|
|
zoom: MAP_ZOOM,
|
|
})
|
|
|
|
const map = new Map({
|
|
target: MAP_TARGET,
|
|
layers: [
|
|
customTileSource
|
|
],
|
|
view,
|
|
});
|
|
|
|
export default map; |