/*
 * @Description: ol
 * @Author: Napier
 * @LastEditors: Napier
 * @LastEditTime: 2021-09-06 12:20:24
 */

import View from 'ol/View'
import Map from 'ol/Map'
import Feature from 'ol/Feature'
import Overlay from 'ol/Overlay'
import Tile from 'ol/layer/Tile'
import Image from 'ol/layer/Image'
import Vector from 'ol/layer/Vector'
import XYZ from 'ol/source/XYZ'
import WMTS from 'ol/source/WMTS'
import VectorSource from 'ol/source/Vector'
import WFS from 'ol/format/WFS'
import GeoJSON from 'ol/format/GeoJSON'
import OSM from 'ol/source/OSM.js'
import TileWMS from 'ol/source/TileWMS.js'
import ImageWMS from 'ol/source/ImageWMS.js'
import Point from 'ol/geom/Point'
import Style from 'ol/style/Style'
import Stroke from 'ol/style/Stroke'
import Fill from 'ol/style/Fill'
import {transform, fromLonLat, toLonLat} from 'ol/proj'
import ImageStyle from 'ol/style/Image'
import Icon from 'ol/style/Icon'
import Draw from 'ol/interaction/Draw'
import Circle from 'ol/style/Circle'
import ZoomToExtent from 'ol/control/ZoomToExtent'
import { buffer } from 'ol/extent'
import {unByKey} from 'ol/Observable'

let ol = {
  View: View,
  Map: Map,
  Feature: Feature,
  Overlay: Overlay,
  observable: {
    unByKey: unByKey
  },
  geom: {
    Point: Point
  },
  layer: {
    Tile: Tile,
    Image: Image,
    Vector: Vector,
  },
  control: {
    ZoomToExtent: ZoomToExtent
  },
  source: {
    Vector: VectorSource,
    WMTS: WMTS,
    OSM: OSM,
    TileWMS: TileWMS,
    ImageWMS: ImageWMS,
    XYZ: XYZ,
  },
  format: {
    WFS: WFS,
    GeoJSON: GeoJSON,
  },
  style: {
    Style: Style,
    Stroke: Stroke,
    Fill: Fill,
    Image: ImageStyle,
    Icon: Icon,
    Circle: Circle,
  },
  interaction: {
    Draw: Draw
  },
  proj: {
    transform: transform,
    fromLonLat: fromLonLat,
    toLonLat: toLonLat,
  },
  extent: {
    buffer: buffer
  }
}

export default ol