import Vue from 'vue'
import VueRouter from 'vue-router'
import App from './components/App.vue'
import routes from './routes'
import SlMap, { addAlarmFlash, drawGeometry, flightRending, drawBezierLine, addVectorLabelJG, addPicAndText, add_oval, removeOverLayeById, ContextMenu, clearClusterFeatures, addSvg, web3857ToWgs84, wgs84Toweb3857, createLayer, createProjection, MapServiceType, MapType, GeometryType, printMap, constantSpeedObj, UtilDB, mapSearch, HistoryTrack, getDeviceByExtent, arrToRoute, createPointCluster, Overview, addClick, clearOverLay, clearInterModifyAndSelect, lineShowDistant, insertfun, visibleLikeSpatial, clearSpatial, flyTo, drawCircle1000, loadClusterFeatures, removeLayersExceptMap, getTwoPointsLength, drawCircleSymbol, addPoiVectors, addVector, findByIdToLayer, deleteIndexDBFolder, findRoadZY, findPosByCityName, getSubWayLine, intersectRoute, flying, addExtent, filterKey, bd09togcj02, createSelectInfoPop, geoQuery, radarChart, moveingLine, gcj_encrypt, addMultiHugePoints, addHugePointsGif, addHugePoints, queryGeometry, revAddressSearch, findFreeHandRoad, addressSearch, saveFreeHandRoad, flashingPoints, filterKeySearch, addSZPic, clearLikeSpatial } from '../components/index.js'
import DocPreview from './components/DocPreview.vue'
import TextField from './components/TextField.vue'
import VueMaterial from 'vue-material'
import Prism from 'prismjs'
import ElementUI from 'element-ui';
import 'prismjs/themes/prism-tomorrow.css'
import 'material-design-icons/iconfont/material-icons.css'
import 'vue-material/dist/vue-material.css'
// import './fonts/iconfont.css'
import './fonts/selfDefinedStyle.css' //全局样式方便在sl-map中的js动态标签调用
import 'element-ui/lib/theme-chalk/index.css';
import DataTables from 'vue-data-tables'
Vue.use(VueMaterial)
Vue.use(VueRouter)
Vue.use(ElementUI);
Vue.use(SlMap)
Vue.use(DataTables)
Vue.material.registerTheme({
    white: {
        primary: 'white',
        accent: 'black'
    }
})
Vue.component('doc-preview', DocPreview)
Vue.component('text-field', TextField)

Vue.prototype.createLayer = createLayer
Vue.prototype.wgs84Toweb3857 = wgs84Toweb3857
Vue.prototype.web3857ToWgs84 = web3857ToWgs84
Vue.prototype.addSvg = addSvg
Vue.prototype.createProjection = createProjection
Vue.prototype.MapServiceType = MapServiceType
Vue.prototype.MapType = MapType
Vue.prototype.GeometryType = GeometryType
Vue.prototype.ContextMenu = ContextMenu
Vue.prototype.filterKeySearch = filterKeySearch
Vue.prototype.flashingPoints = flashingPoints
Vue.prototype.addressSearch = addressSearch
Vue.prototype.revAddressSearch = revAddressSearch
Vue.prototype.intersectRoute = intersectRoute
Vue.prototype.saveFreeHandRoad = saveFreeHandRoad
Vue.prototype.visibleLikeSpatial = visibleLikeSpatial
Vue.prototype.addMultiHugePoints = addMultiHugePoints
Vue.prototype.clearLikeSpatial = clearLikeSpatial
Vue.prototype.queryGeometry = queryGeometry
Vue.prototype.addHugePoints = addHugePoints
Vue.prototype.addHugePointsGif = addHugePointsGif
Vue.prototype.gcj_encrypt = gcj_encrypt
Vue.prototype.bd09togcj02 = bd09togcj02
Vue.prototype.findFreeHandRoad = findFreeHandRoad
Vue.prototype.printMap = printMap
Vue.prototype.HistoryTrack = HistoryTrack
Vue.prototype.UtilDB = UtilDB //将自定义的类引入到工程项目中
Vue.prototype.constantSpeedObj = constantSpeedObj
Vue.prototype.mapSearch = mapSearch
Vue.prototype.getDeviceByExtent = getDeviceByExtent
Vue.prototype.createPointCluster = createPointCluster
Vue.prototype.clearClusterFeatures = clearClusterFeatures
Vue.prototype.addAlarmFlash = addAlarmFlash
Vue.prototype.flightRending = flightRending
Vue.prototype.removeOverLayeById = removeOverLayeById
Vue.prototype.Overview = Overview
Vue.prototype.getSubWayLine = getSubWayLine
Vue.prototype.findPosByCityName = findPosByCityName
Vue.prototype.findRoadZY = findRoadZY
Vue.prototype.deleteIndexDBFolder = deleteIndexDBFolder
Vue.prototype.addClick = addClick
Vue.prototype.addExtent = addExtent
Vue.prototype.drawBezierLine = drawBezierLine
Vue.prototype.addPicAndText = addPicAndText
Vue.prototype.addVectorLabelJG = addVectorLabelJG
Vue.prototype.clearSpatial = clearSpatial
Vue.prototype.drawGeometry = drawGeometry
Vue.prototype.removeLayersExceptMap = removeLayersExceptMap
Vue.prototype.flyTo = flyTo
Vue.prototype.drawCircle1000 = drawCircle1000
Vue.prototype.clearInterModifyAndSelect = clearInterModifyAndSelect
Vue.prototype.clearOverLay = clearOverLay
Vue.prototype.insertfun = insertfun
Vue.prototype.lineShowDistant = lineShowDistant
Vue.prototype.arrToRoute = arrToRoute
Vue.prototype.add_oval = add_oval
Vue.prototype.loadClusterFeatures = loadClusterFeatures
Vue.prototype.drawCircleSymbol = drawCircleSymbol
Vue.prototype.getTwoPointsLength = getTwoPointsLength
Vue.prototype.createSelectInfoPop = createSelectInfoPop
Vue.prototype.addVector = addVector
Vue.prototype.addPoiVectors = addPoiVectors
Vue.prototype.findByIdToLayer = findByIdToLayer
Vue.prototype.moveingLine = moveingLine
Vue.prototype.flying = flying
Vue.prototype.filterKey = filterKey
Vue.prototype.radarChart = radarChart
Vue.prototype.addSZPic = addSZPic
Vue.prototype.geoQuery = geoQuery
const router = new VueRouter({
    routes
})

router.afterEach(route => {
    Vue.nextTick(Prism.highlightAll)
})

export default new Vue({
    el: '#app',
    router,
    render: h => h(App)
})