@sookoll/mapwrapper
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

mapwrapper

wrap for ol map

Install:

npm i ol
npm i @sookoll/mapwrapper

Usage:

import { Mapwrap, transform } from './main'

const mapwrap = new Mapwrap({
  projection: 'EPSG:3301',
  target: 'map',
})

let blid = null

mapwrap
  .center(transform('fromLonLat', [25, 59.5], 'EPSG:3301'))
  .zoom(5)
  .baseLayer(
    {
      id: 'ma-map',
      label: 'Kaart',
      type: 'XYZ',
      projection: 'EPSG:3301',
      url: 'https://tiles.maaamet.ee/tm/tms/1.0.0/kaart/{z}/{x}/{-y}.png',
    },
    (id) => (blid = id),
  )
  .changeBaseLayer(blid)
  .infoLayer({
    label: 'Mullakaart',
    type: 'TileWMS',
    projection: 'EPSG:3301',
    url: 'https://teenus.maaamet.ee/ows/mullakaart',
    params: {
      LAYERS: 'MULD_VEK_0,MULD_VEK_1,MULD_VEK_2',
      TILED: true,
      FORMAT: 'image/png',
      VERSION: '1.1.1',
    },
    tileSize: 1024,
    gutter: 20,
    visible: true,
    opacity: 0.7,
  })

Readme

Keywords

none

Package Sidebar

Install

npm i @sookoll/mapwrapper

Weekly Downloads

1

Version

1.0.3

License

MIT

Unpacked Size

98 kB

Total Files

60

Last publish

Collaborators

  • sookoll