├── vue-amap-gmap ├── static │ └── .gitkeep ├── config │ ├── prod.env.js │ ├── test.env.js │ ├── dev.env.js │ └── index.js ├── build │ ├── logo.png │ ├── vue-loader.conf.js │ ├── webpack.test.conf.js │ ├── build.js │ ├── check-versions.js │ ├── webpack.base.conf.js │ ├── utils.js │ ├── webpack.dev.conf.js │ └── webpack.prod.conf.js ├── src │ ├── assets │ │ └── logo.png │ ├── router │ │ └── index.js │ ├── App.vue │ ├── main.js │ ├── view │ │ └── gmapDemo.vue │ └── components │ │ └── gMap.vue ├── test │ ├── unit │ │ ├── .eslintrc │ │ ├── specs │ │ │ └── HelloWorld.spec.js │ │ ├── index.js │ │ └── karma.conf.js │ └── e2e │ │ ├── specs │ │ └── test.js │ │ ├── custom-assertions │ │ └── elementCount.js │ │ ├── nightwatch.conf.js │ │ └── runner.js ├── .editorconfig ├── .gitignore ├── .postcssrc.js ├── index.html ├── .babelrc ├── README.md └── package.json ├── .DS_Store ├── docs ├── static │ ├── fonts │ │ └── element-icons.6f0a763.ttf │ └── js │ │ ├── manifest.3ad1d5771e9b13dbdad2.js │ │ ├── manifest.3ad1d5771e9b13dbdad2.js.map │ │ ├── app.b71a7435fa79df84651d.js │ │ └── app.b71a7435fa79df84651d.js.map └── index.html ├── README.md ├── LICENSE └── .gitignore /vue-amap-gmap/static/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calamus0427/vue-gmap/master/.DS_Store -------------------------------------------------------------------------------- /vue-amap-gmap/config/prod.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | module.exports = { 3 | NODE_ENV: '"production"' 4 | } 5 | -------------------------------------------------------------------------------- /vue-amap-gmap/build/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calamus0427/vue-gmap/master/vue-amap-gmap/build/logo.png -------------------------------------------------------------------------------- /vue-amap-gmap/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calamus0427/vue-gmap/master/vue-amap-gmap/src/assets/logo.png -------------------------------------------------------------------------------- /docs/static/fonts/element-icons.6f0a763.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calamus0427/vue-gmap/master/docs/static/fonts/element-icons.6f0a763.ttf -------------------------------------------------------------------------------- /vue-amap-gmap/test/unit/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "mocha": true 4 | }, 5 | "globals": { 6 | "expect": true, 7 | "sinon": true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /vue-amap-gmap/config/test.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const merge = require('webpack-merge') 3 | const devEnv = require('./dev.env') 4 | 5 | module.exports = merge(devEnv, { 6 | NODE_ENV: '"testing"' 7 | }) 8 | -------------------------------------------------------------------------------- /vue-amap-gmap/config/dev.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const merge = require('webpack-merge') 3 | const prodEnv = require('./prod.env') 4 | 5 | module.exports = merge(prodEnv, { 6 | NODE_ENV: '"development"' 7 | }) 8 | -------------------------------------------------------------------------------- /vue-amap-gmap/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /vue-amap-gmap/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | npm-debug.log* 4 | yarn-debug.log* 5 | yarn-error.log* 6 | /test/unit/coverage/ 7 | /test/e2e/reports/ 8 | selenium-debug.log 9 | 10 | # Editor directories and files 11 | .idea 12 | .vscode 13 | *.suo 14 | *.ntvs* 15 | *.njsproj 16 | *.sln 17 | -------------------------------------------------------------------------------- /vue-amap-gmap/.postcssrc.js: -------------------------------------------------------------------------------- 1 | // https://github.com/michael-ciniawsky/postcss-load-config 2 | 3 | module.exports = { 4 | "plugins": { 5 | "postcss-import": {}, 6 | "postcss-url": {}, 7 | // to edit target browsers: use "browserslist" field in package.json 8 | "autoprefixer": {} 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /vue-amap-gmap/src/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Router from 'vue-router' 3 | import GMap from '@/view/gmapDemo' 4 | 5 | 6 | Vue.use(Router) 7 | 8 | export default new Router({ 9 | routes: [ 10 | { 11 | path: '/', 12 | name: 'GMap', 13 | component: GMap 14 | } 15 | ] 16 | }) 17 | -------------------------------------------------------------------------------- /vue-amap-gmap/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | vue-amap-gmap 7 | 8 | 9 |
10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /vue-amap-gmap/test/unit/specs/HelloWorld.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import HelloWorld from '@/components/HelloWorld' 3 | 4 | describe('HelloWorld.vue', () => { 5 | it('should render correct contents', () => { 6 | const Constructor = Vue.extend(HelloWorld) 7 | const vm = new Constructor().$mount() 8 | expect(vm.$el.querySelector('.hello h1').textContent) 9 | .to.equal('Welcome to Your Vue.js App') 10 | }) 11 | }) 12 | -------------------------------------------------------------------------------- /vue-amap-gmap/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["env", { 4 | "modules": false, 5 | "targets": { 6 | "browsers": ["> 1%", "last 2 versions", "not ie <= 8"] 7 | } 8 | }], 9 | "stage-2" 10 | ], 11 | "plugins": ["transform-vue-jsx", "transform-runtime"], 12 | "env": { 13 | "test": { 14 | "presets": ["env", "stage-2"], 15 | "plugins": ["transform-vue-jsx", "istanbul"] 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | vue-amap-gmap
-------------------------------------------------------------------------------- /vue-amap-gmap/test/unit/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | 3 | Vue.config.productionTip = false 4 | 5 | // require all test files (files that ends with .spec.js) 6 | const testsContext = require.context('./specs', true, /\.spec$/) 7 | testsContext.keys().forEach(testsContext) 8 | 9 | // require all src files except main.js for coverage. 10 | // you can also change this to match only the subset of files that 11 | // you want coverage for. 12 | const srcContext = require.context('../../src', true, /^\.\/(?!main(\.js)?$)/) 13 | srcContext.keys().forEach(srcContext) 14 | -------------------------------------------------------------------------------- /vue-amap-gmap/src/App.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 15 | 16 | 26 | -------------------------------------------------------------------------------- /vue-amap-gmap/test/e2e/specs/test.js: -------------------------------------------------------------------------------- 1 | // For authoring Nightwatch tests, see 2 | // http://nightwatchjs.org/guide#usage 3 | 4 | module.exports = { 5 | 'default e2e tests': function (browser) { 6 | // automatically uses dev Server port from /config.index.js 7 | // default: http://localhost:8080 8 | // see nightwatch.conf.js 9 | const devServer = browser.globals.devServerURL 10 | 11 | browser 12 | .url(devServer) 13 | .waitForElementVisible('#app', 5000) 14 | .assert.elementPresent('.hello') 15 | .assert.containsText('h1', 'Welcome to Your Vue.js App') 16 | .assert.elementCount('img', 1) 17 | .end() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /vue-amap-gmap/build/vue-loader.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const utils = require('./utils') 3 | const config = require('../config') 4 | const isProduction = process.env.NODE_ENV === 'production' 5 | const sourceMapEnabled = isProduction 6 | ? config.build.productionSourceMap 7 | : config.dev.cssSourceMap 8 | 9 | module.exports = { 10 | loaders: utils.cssLoaders({ 11 | sourceMap: sourceMapEnabled, 12 | extract: isProduction 13 | }), 14 | cssSourceMap: sourceMapEnabled, 15 | cacheBusting: config.dev.cacheBusting, 16 | transformToRequire: { 17 | video: ['src', 'poster'], 18 | source: 'src', 19 | img: 'src', 20 | image: 'xlink:href' 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /docs/static/js/manifest.3ad1d5771e9b13dbdad2.js: -------------------------------------------------------------------------------- 1 | !function(r){var n=window.webpackJsonp;window.webpackJsonp=function(e,u,c){for(var f,i,p,a=0,l=[];a has count: ' + count 12 | this.expected = count 13 | this.pass = function (val) { 14 | return val === this.expected 15 | } 16 | this.value = function (res) { 17 | return res.value 18 | } 19 | this.command = function (cb) { 20 | var self = this 21 | return this.api.execute(function (selector) { 22 | return document.querySelectorAll(selector).length 23 | }, [selector], function (res) { 24 | cb.call(self, res) 25 | }) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vue-amap-gmap 2 | 3 | > 基于vue、vue-amap 和 高德原生sdk的高德地图组件 4 | ## [项目预览](https://calamus0427.github.io/vue-gmap/index.html) 5 | 6 | 7 | ## 启动和构建 8 | 1. 先把项目的KEYS替换为你自己申请的KEY值 9 | 2. 启动 10 | 11 | ``` bash 12 | # install dependencies 13 | npm install 14 | 15 | # serve with hot reload at localhost:8080 16 | npm run dev 17 | 18 | # build for production with minification 19 | npm run build 20 | 21 | # build for production and view the bundle analyzer report 22 | npm run build --report 23 | 24 | # run unit tests 25 | npm run unit 26 | 27 | # run e2e tests 28 | npm run e2e 29 | 30 | # run all tests 31 | npm test 32 | ``` 33 | 34 | ## 参考资料 35 | [vue-amap文档](https://elemefe.github.io/vue-amap/#/zh-cn/custom/custom) 36 | vue-amap安装 37 | ```bash 38 | npm install vue-amap --save 39 | ``` 40 | [地理位置编码转换](https://lbs.amap.com/api/javascript-api/guide/services/geocoder/?sug_index=0) 41 | [高德地图文档](https://lbs.amap.com/api/) 42 | [申请高德key](https://lbs.amap.com/dev/key/app) 43 | -------------------------------------------------------------------------------- /vue-amap-gmap/README.md: -------------------------------------------------------------------------------- 1 | # vue-amap-gmap 2 | 3 | > 基于vue、vue-amap 和 高德原生sdk的高德地图组件 4 | ## [项目预览](https://calamus0427.github.io/vue-gmap/index.html) 5 | 6 | 7 | ## 启动和构建 8 | 1. 先把项目的KEYS替换为你自己申请的KEY值 9 | 2. 启动 10 | 11 | ``` bash 12 | # install dependencies 13 | npm install 14 | 15 | # serve with hot reload at localhost:8080 16 | npm run dev 17 | 18 | # build for production with minification 19 | npm run build 20 | 21 | # build for production and view the bundle analyzer report 22 | npm run build --report 23 | 24 | # run unit tests 25 | npm run unit 26 | 27 | # run e2e tests 28 | npm run e2e 29 | 30 | # run all tests 31 | npm test 32 | ``` 33 | 34 | ## 参考资料 35 | [vue-amap文档](https://elemefe.github.io/vue-amap/#/zh-cn/custom/custom) 36 | vue-amap安装 37 | ```bash 38 | npm install vue-amap --save 39 | ``` 40 | [地理位置编码转换](https://lbs.amap.com/api/javascript-api/guide/services/geocoder/?sug_index=0) 41 | [高德地图文档](https://lbs.amap.com/api/) 42 | [申请高德key](https://lbs.amap.com/dev/key/app) 43 | -------------------------------------------------------------------------------- /vue-amap-gmap/build/webpack.test.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | // This is the webpack config used for unit tests. 3 | 4 | const utils = require('./utils') 5 | const webpack = require('webpack') 6 | const merge = require('webpack-merge') 7 | const baseWebpackConfig = require('./webpack.base.conf') 8 | 9 | const webpackConfig = merge(baseWebpackConfig, { 10 | // use inline sourcemap for karma-sourcemap-loader 11 | module: { 12 | rules: utils.styleLoaders() 13 | }, 14 | devtool: '#inline-source-map', 15 | resolveLoader: { 16 | alias: { 17 | // necessary to to make lang="scss" work in test when using vue-loader's ?inject option 18 | // see discussion at https://github.com/vuejs/vue-loader/issues/724 19 | 'scss-loader': 'sass-loader' 20 | } 21 | }, 22 | plugins: [ 23 | new webpack.DefinePlugin({ 24 | 'process.env': require('../config/test.env') 25 | }) 26 | ] 27 | }) 28 | 29 | // no need for app entry during tests 30 | delete webpackConfig.entry 31 | 32 | module.exports = webpackConfig 33 | -------------------------------------------------------------------------------- /vue-amap-gmap/src/main.js: -------------------------------------------------------------------------------- 1 | // The Vue build version to load with the `import` command 2 | // (runtime-only or standalone) has been set in webpack.base.conf with an alias. 3 | import Vue from 'vue' 4 | import App from './App' 5 | import router from './router' 6 | import VueAMap from 'vue-amap' 7 | import ElementUI from 'element-ui'; 8 | import 'element-ui/lib/theme-chalk/index.css'; 9 | 10 | Vue.config.productionTip = false 11 | 12 | Vue.use(VueAMap) 13 | Vue.use(ElementUI); 14 | VueAMap.initAMapApiLoader({ 15 | key: '8703164b6d9a53e64195238e3e17b1f3', 16 | plugin: ['AMap.TruckDriving', 'AMap.RangingTool', 'AMap.MouseTool', 'AMap.PolyEditor', 'AMap.CircleEditor', 'AMap.Autocomplete', 'AMap.EllipseEditor', 'AMap.RectangleEditor', 'AMap.PlaceSearch', 'AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PolyEditor', 'AMap.CircleEditor', 'AMap.Geocoder', 'Geolocation'], 17 | uiVersion: '1.0' 18 | }) 19 | 20 | 21 | /* eslint-disable no-new */ 22 | new Vue({ 23 | el: '#app', 24 | router, 25 | components: { App }, 26 | template: '' 27 | }) 28 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 あやめ 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vue-amap-gmap/test/unit/karma.conf.js: -------------------------------------------------------------------------------- 1 | // This is a karma config file. For more details see 2 | // http://karma-runner.github.io/0.13/config/configuration-file.html 3 | // we are also using it with karma-webpack 4 | // https://github.com/webpack/karma-webpack 5 | 6 | var webpackConfig = require('../../build/webpack.test.conf') 7 | 8 | module.exports = function karmaConfig (config) { 9 | config.set({ 10 | // to run in additional browsers: 11 | // 1. install corresponding karma launcher 12 | // http://karma-runner.github.io/0.13/config/browsers.html 13 | // 2. add it to the `browsers` array below. 14 | browsers: ['PhantomJS'], 15 | frameworks: ['mocha', 'sinon-chai', 'phantomjs-shim'], 16 | reporters: ['spec', 'coverage'], 17 | files: ['./index.js'], 18 | preprocessors: { 19 | './index.js': ['webpack', 'sourcemap'] 20 | }, 21 | webpack: webpackConfig, 22 | webpackMiddleware: { 23 | noInfo: true 24 | }, 25 | coverageReporter: { 26 | dir: './coverage', 27 | reporters: [ 28 | { type: 'lcov', subdir: '.' }, 29 | { type: 'text-summary' } 30 | ] 31 | } 32 | }) 33 | } 34 | -------------------------------------------------------------------------------- /vue-amap-gmap/test/e2e/nightwatch.conf.js: -------------------------------------------------------------------------------- 1 | require('babel-register') 2 | var config = require('../../config') 3 | 4 | // http://nightwatchjs.org/gettingstarted#settings-file 5 | module.exports = { 6 | src_folders: ['test/e2e/specs'], 7 | output_folder: 'test/e2e/reports', 8 | custom_assertions_path: ['test/e2e/custom-assertions'], 9 | 10 | selenium: { 11 | start_process: true, 12 | server_path: require('selenium-server').path, 13 | host: '127.0.0.1', 14 | port: 4444, 15 | cli_args: { 16 | 'webdriver.chrome.driver': require('chromedriver').path 17 | } 18 | }, 19 | 20 | test_settings: { 21 | default: { 22 | selenium_port: 4444, 23 | selenium_host: 'localhost', 24 | silent: true, 25 | globals: { 26 | devServerURL: 'http://localhost:' + (process.env.PORT || config.dev.port) 27 | } 28 | }, 29 | 30 | chrome: { 31 | desiredCapabilities: { 32 | browserName: 'chrome', 33 | javascriptEnabled: true, 34 | acceptSslCerts: true 35 | } 36 | }, 37 | 38 | firefox: { 39 | desiredCapabilities: { 40 | browserName: 'firefox', 41 | javascriptEnabled: true, 42 | acceptSslCerts: true 43 | } 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /vue-amap-gmap/build/build.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | require('./check-versions')() 3 | 4 | process.env.NODE_ENV = 'production' 5 | 6 | const ora = require('ora') 7 | const rm = require('rimraf') 8 | const path = require('path') 9 | const chalk = require('chalk') 10 | const webpack = require('webpack') 11 | const config = require('../config') 12 | const webpackConfig = require('./webpack.prod.conf') 13 | 14 | const spinner = ora('building for production...') 15 | spinner.start() 16 | 17 | rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { 18 | if (err) throw err 19 | webpack(webpackConfig, (err, stats) => { 20 | spinner.stop() 21 | if (err) throw err 22 | process.stdout.write(stats.toString({ 23 | colors: true, 24 | modules: false, 25 | children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. 26 | chunks: false, 27 | chunkModules: false 28 | }) + '\n\n') 29 | 30 | if (stats.hasErrors()) { 31 | console.log(chalk.red(' Build failed with errors.\n')) 32 | process.exit(1) 33 | } 34 | 35 | console.log(chalk.cyan(' Build complete.\n')) 36 | console.log(chalk.yellow( 37 | ' Tip: built files are meant to be served over an HTTP server.\n' + 38 | ' Opening index.html over file:// won\'t work.\n' 39 | )) 40 | }) 41 | }) 42 | -------------------------------------------------------------------------------- /vue-amap-gmap/build/check-versions.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const chalk = require('chalk') 3 | const semver = require('semver') 4 | const packageConfig = require('../package.json') 5 | const shell = require('shelljs') 6 | 7 | function exec (cmd) { 8 | return require('child_process').execSync(cmd).toString().trim() 9 | } 10 | 11 | const versionRequirements = [ 12 | { 13 | name: 'node', 14 | currentVersion: semver.clean(process.version), 15 | versionRequirement: packageConfig.engines.node 16 | } 17 | ] 18 | 19 | if (shell.which('npm')) { 20 | versionRequirements.push({ 21 | name: 'npm', 22 | currentVersion: exec('npm --version'), 23 | versionRequirement: packageConfig.engines.npm 24 | }) 25 | } 26 | 27 | module.exports = function () { 28 | const warnings = [] 29 | 30 | for (let i = 0; i < versionRequirements.length; i++) { 31 | const mod = versionRequirements[i] 32 | 33 | if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { 34 | warnings.push(mod.name + ': ' + 35 | chalk.red(mod.currentVersion) + ' should be ' + 36 | chalk.green(mod.versionRequirement) 37 | ) 38 | } 39 | } 40 | 41 | if (warnings.length) { 42 | console.log('') 43 | console.log(chalk.yellow('To use this template, you must update following to modules:')) 44 | console.log() 45 | 46 | for (let i = 0; i < warnings.length; i++) { 47 | const warning = warnings[i] 48 | console.log(' ' + warning) 49 | } 50 | 51 | console.log() 52 | process.exit(1) 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /vue-amap-gmap/test/e2e/runner.js: -------------------------------------------------------------------------------- 1 | // 1. start the dev server using production config 2 | process.env.NODE_ENV = 'testing' 3 | 4 | const webpack = require('webpack') 5 | const DevServer = require('webpack-dev-server') 6 | 7 | const webpackConfig = require('../../build/webpack.prod.conf') 8 | const devConfigPromise = require('../../build/webpack.dev.conf') 9 | 10 | let server 11 | 12 | devConfigPromise.then(devConfig => { 13 | const devServerOptions = devConfig.devServer 14 | const compiler = webpack(webpackConfig) 15 | server = new DevServer(compiler, devServerOptions) 16 | const port = devServerOptions.port 17 | const host = devServerOptions.host 18 | return server.listen(port, host) 19 | }) 20 | .then(() => { 21 | // 2. run the nightwatch test suite against it 22 | // to run in additional browsers: 23 | // 1. add an entry in test/e2e/nightwatch.conf.js under "test_settings" 24 | // 2. add it to the --env flag below 25 | // or override the environment flag, for example: `npm run e2e -- --env chrome,firefox` 26 | // For more information on Nightwatch's config file, see 27 | // http://nightwatchjs.org/guide#settings-file 28 | let opts = process.argv.slice(2) 29 | if (opts.indexOf('--config') === -1) { 30 | opts = opts.concat(['--config', 'test/e2e/nightwatch.conf.js']) 31 | } 32 | if (opts.indexOf('--env') === -1) { 33 | opts = opts.concat(['--env', 'chrome']) 34 | } 35 | 36 | const spawn = require('cross-spawn') 37 | const runner = spawn('./node_modules/.bin/nightwatch', opts, { stdio: 'inherit' }) 38 | 39 | runner.on('exit', function (code) { 40 | server.close() 41 | process.exit(code) 42 | }) 43 | 44 | runner.on('error', function (err) { 45 | server.close() 46 | throw err 47 | }) 48 | }) 49 | -------------------------------------------------------------------------------- /vue-amap-gmap/config/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | // Template version: 1.3.1 3 | // see http://vuejs-templates.github.io/webpack for documentation. 4 | 5 | const path = require('path') 6 | 7 | module.exports = { 8 | dev: { 9 | 10 | // Paths 11 | assetsSubDirectory: 'static', 12 | assetsPublicPath: '/', 13 | proxyTable: {}, 14 | 15 | // Various Dev Server settings 16 | host: 'localhost', // can be overwritten by process.env.HOST 17 | port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined 18 | autoOpenBrowser: false, 19 | errorOverlay: true, 20 | notifyOnErrors: true, 21 | poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- 22 | 23 | 24 | /** 25 | * Source Maps 26 | */ 27 | 28 | // https://webpack.js.org/configuration/devtool/#development 29 | devtool: 'cheap-module-eval-source-map', 30 | 31 | // If you have problems debugging vue-files in devtools, 32 | // set this to false - it *may* help 33 | // https://vue-loader.vuejs.org/en/options.html#cachebusting 34 | cacheBusting: true, 35 | 36 | cssSourceMap: true 37 | }, 38 | 39 | build: { 40 | // Template for index.html 41 | index: path.resolve(__dirname, '../dist/index.html'), 42 | 43 | // Paths 44 | assetsRoot: path.resolve(__dirname, '../dist'), 45 | assetsSubDirectory: 'static', 46 | assetsPublicPath: './', 47 | 48 | /** 49 | * Source Maps 50 | */ 51 | 52 | productionSourceMap: true, 53 | // https://webpack.js.org/configuration/devtool/#production 54 | devtool: '#source-map', 55 | 56 | // Gzip off by default as many popular static hosts such as 57 | // Surge or Netlify already gzip all static assets for you. 58 | // Before setting to `true`, make sure to: 59 | // npm install --save-dev compression-webpack-plugin 60 | productionGzip: false, 61 | productionGzipExtensions: ['js', 'css'], 62 | 63 | // Run the build command with an extra argument to 64 | // View the bundle analyzer report after build finishes: 65 | // `npm run build --report` 66 | // Set to `true` or `false` to always turn it on or off 67 | bundleAnalyzerReport: process.env.npm_config_report 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /vue-amap-gmap/build/webpack.base.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const path = require('path') 3 | const utils = require('./utils') 4 | const config = require('../config') 5 | const vueLoaderConfig = require('./vue-loader.conf') 6 | 7 | function resolve (dir) { 8 | return path.join(__dirname, '..', dir) 9 | } 10 | 11 | 12 | 13 | module.exports = { 14 | context: path.resolve(__dirname, '../'), 15 | entry: { 16 | app: './src/main.js' 17 | }, 18 | output: { 19 | path: config.build.assetsRoot, 20 | filename: '[name].js', 21 | publicPath: process.env.NODE_ENV === 'production' 22 | ? config.build.assetsPublicPath 23 | : config.dev.assetsPublicPath 24 | }, 25 | resolve: { 26 | extensions: ['.js', '.vue', '.json'], 27 | alias: { 28 | 'vue$': 'vue/dist/vue.esm.js', 29 | '@': resolve('src'), 30 | } 31 | }, 32 | module: { 33 | rules: [ 34 | { 35 | test: /\.vue$/, 36 | loader: 'vue-loader', 37 | options: vueLoaderConfig 38 | }, 39 | { 40 | test: /\.js$/, 41 | loader: 'babel-loader', 42 | include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] 43 | }, 44 | { 45 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, 46 | loader: 'url-loader', 47 | options: { 48 | limit: 10000, 49 | name: utils.assetsPath('img/[name].[hash:7].[ext]') 50 | } 51 | }, 52 | { 53 | test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, 54 | loader: 'url-loader', 55 | options: { 56 | limit: 10000, 57 | name: utils.assetsPath('media/[name].[hash:7].[ext]') 58 | } 59 | }, 60 | { 61 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, 62 | loader: 'url-loader', 63 | options: { 64 | limit: 10000, 65 | name: utils.assetsPath('fonts/[name].[hash:7].[ext]') 66 | } 67 | } 68 | ] 69 | }, 70 | node: { 71 | // prevent webpack from injecting useless setImmediate polyfill because Vue 72 | // source contains it (although only uses it if it's native). 73 | setImmediate: false, 74 | // prevent webpack from injecting mocks to Node native modules 75 | // that does not make sense for the client 76 | dgram: 'empty', 77 | fs: 'empty', 78 | net: 'empty', 79 | tls: 'empty', 80 | child_process: 'empty' 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /vue-amap-gmap/src/view/gmapDemo.vue: -------------------------------------------------------------------------------- 1 | 36 | 37 | 78 | 79 | 89 | -------------------------------------------------------------------------------- /vue-amap-gmap/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue-amap-gmap", 3 | "version": "1.0.0", 4 | "description": "gmap", 5 | "author": "calamus0427 <1211994507@qq.com>", 6 | "private": true, 7 | "scripts": { 8 | "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", 9 | "start": "npm run dev", 10 | "unit": "cross-env BABEL_ENV=test karma start test/unit/karma.conf.js --single-run", 11 | "e2e": "node test/e2e/runner.js", 12 | "test": "npm run unit && npm run e2e", 13 | "build": "node build/build.js" 14 | }, 15 | "dependencies": { 16 | "element-ui": "^2.4.6", 17 | "vue": "^2.5.2", 18 | "vue-amap": "^0.5.8", 19 | "vue-router": "^3.0.1" 20 | }, 21 | "devDependencies": { 22 | "autoprefixer": "^7.1.2", 23 | "babel-core": "^6.22.1", 24 | "babel-helper-vue-jsx-merge-props": "^2.0.3", 25 | "babel-loader": "^7.1.1", 26 | "babel-plugin-istanbul": "^4.1.1", 27 | "babel-plugin-syntax-jsx": "^6.18.0", 28 | "babel-plugin-transform-runtime": "^6.22.0", 29 | "babel-plugin-transform-vue-jsx": "^3.5.0", 30 | "babel-preset-env": "^1.3.2", 31 | "babel-preset-stage-2": "^6.22.0", 32 | "babel-register": "^6.22.0", 33 | "chai": "^4.1.2", 34 | "chalk": "^2.0.1", 35 | "chromedriver": "^2.27.2", 36 | "copy-webpack-plugin": "^4.0.1", 37 | "cross-env": "^5.0.1", 38 | "cross-spawn": "^5.0.1", 39 | "css-loader": "^0.28.0", 40 | "extract-text-webpack-plugin": "^3.0.0", 41 | "file-loader": "^1.1.4", 42 | "friendly-errors-webpack-plugin": "^1.6.1", 43 | "html-webpack-plugin": "^2.30.1", 44 | "inject-loader": "^3.0.0", 45 | "karma": "^1.4.1", 46 | "karma-coverage": "^1.1.1", 47 | "karma-mocha": "^1.3.0", 48 | "karma-phantomjs-launcher": "^1.0.2", 49 | "karma-phantomjs-shim": "^1.4.0", 50 | "karma-sinon-chai": "^1.3.1", 51 | "karma-sourcemap-loader": "^0.3.7", 52 | "karma-spec-reporter": "0.0.31", 53 | "karma-webpack": "^2.0.2", 54 | "mocha": "^3.2.0", 55 | "nightwatch": "^0.9.12", 56 | "node-notifier": "^5.1.2", 57 | "optimize-css-assets-webpack-plugin": "^3.2.0", 58 | "ora": "^1.2.0", 59 | "phantomjs-prebuilt": "^2.1.14", 60 | "portfinder": "^1.0.13", 61 | "postcss-import": "^11.0.0", 62 | "postcss-loader": "^2.0.8", 63 | "postcss-url": "^7.2.1", 64 | "rimraf": "^2.6.0", 65 | "selenium-server": "^3.0.1", 66 | "semver": "^5.3.0", 67 | "shelljs": "^0.7.6", 68 | "sinon": "^4.0.0", 69 | "sinon-chai": "^2.8.0", 70 | "uglifyjs-webpack-plugin": "^1.1.1", 71 | "url-loader": "^0.5.8", 72 | "vue-loader": "^13.3.0", 73 | "vue-style-loader": "^3.0.1", 74 | "vue-template-compiler": "^2.5.2", 75 | "webpack": "^3.6.0", 76 | "webpack-bundle-analyzer": "^2.9.0", 77 | "webpack-dev-server": "^2.9.1", 78 | "webpack-merge": "^4.1.0" 79 | }, 80 | "engines": { 81 | "node": ">= 6.0.0", 82 | "npm": ">= 3.0.0" 83 | }, 84 | "browserslist": [ 85 | "> 1%", 86 | "last 2 versions", 87 | "not ie <= 8" 88 | ] 89 | } 90 | -------------------------------------------------------------------------------- /vue-amap-gmap/build/utils.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const path = require('path') 3 | const config = require('../config') 4 | const ExtractTextPlugin = require('extract-text-webpack-plugin') 5 | const packageConfig = require('../package.json') 6 | 7 | exports.assetsPath = function (_path) { 8 | const assetsSubDirectory = process.env.NODE_ENV === 'production' 9 | ? config.build.assetsSubDirectory 10 | : config.dev.assetsSubDirectory 11 | 12 | return path.posix.join(assetsSubDirectory, _path) 13 | } 14 | 15 | exports.cssLoaders = function (options) { 16 | options = options || {} 17 | 18 | const cssLoader = { 19 | loader: 'css-loader', 20 | options: { 21 | sourceMap: options.sourceMap 22 | } 23 | } 24 | 25 | const postcssLoader = { 26 | loader: 'postcss-loader', 27 | options: { 28 | sourceMap: options.sourceMap 29 | } 30 | } 31 | 32 | // generate loader string to be used with extract text plugin 33 | function generateLoaders (loader, loaderOptions) { 34 | const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] 35 | 36 | if (loader) { 37 | loaders.push({ 38 | loader: loader + '-loader', 39 | options: Object.assign({}, loaderOptions, { 40 | sourceMap: options.sourceMap 41 | }) 42 | }) 43 | } 44 | 45 | // Extract CSS when that option is specified 46 | // (which is the case during production build) 47 | if (options.extract) { 48 | return ExtractTextPlugin.extract({ 49 | use: loaders, 50 | fallback: 'vue-style-loader' 51 | }) 52 | } else { 53 | return ['vue-style-loader'].concat(loaders) 54 | } 55 | } 56 | 57 | // https://vue-loader.vuejs.org/en/configurations/extract-css.html 58 | return { 59 | css: generateLoaders(), 60 | postcss: generateLoaders(), 61 | less: generateLoaders('less'), 62 | sass: generateLoaders('sass', { indentedSyntax: true }), 63 | scss: generateLoaders('sass'), 64 | stylus: generateLoaders('stylus'), 65 | styl: generateLoaders('stylus') 66 | } 67 | } 68 | 69 | // Generate loaders for standalone style files (outside of .vue) 70 | exports.styleLoaders = function (options) { 71 | const output = [] 72 | const loaders = exports.cssLoaders(options) 73 | 74 | for (const extension in loaders) { 75 | const loader = loaders[extension] 76 | output.push({ 77 | test: new RegExp('\\.' + extension + '$'), 78 | use: loader 79 | }) 80 | } 81 | 82 | return output 83 | } 84 | 85 | exports.createNotifierCallback = () => { 86 | const notifier = require('node-notifier') 87 | 88 | return (severity, errors) => { 89 | if (severity !== 'error') return 90 | 91 | const error = errors[0] 92 | const filename = error.file && error.file.split('!').pop() 93 | 94 | notifier.notify({ 95 | title: packageConfig.name, 96 | message: severity + ': ' + error.name, 97 | subtitle: filename || '', 98 | icon: path.join(__dirname, 'logo.png') 99 | }) 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /vue-amap-gmap/build/webpack.dev.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const utils = require('./utils') 3 | const webpack = require('webpack') 4 | const config = require('../config') 5 | const merge = require('webpack-merge') 6 | const path = require('path') 7 | const baseWebpackConfig = require('./webpack.base.conf') 8 | const CopyWebpackPlugin = require('copy-webpack-plugin') 9 | const HtmlWebpackPlugin = require('html-webpack-plugin') 10 | const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') 11 | const portfinder = require('portfinder') 12 | 13 | const HOST = process.env.HOST 14 | const PORT = process.env.PORT && Number(process.env.PORT) 15 | 16 | const devWebpackConfig = merge(baseWebpackConfig, { 17 | module: { 18 | rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) 19 | }, 20 | // cheap-module-eval-source-map is faster for development 21 | devtool: config.dev.devtool, 22 | 23 | // these devServer options should be customized in /config/index.js 24 | devServer: { 25 | clientLogLevel: 'warning', 26 | historyApiFallback: { 27 | rewrites: [ 28 | { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, 29 | ], 30 | }, 31 | hot: true, 32 | contentBase: false, // since we use CopyWebpackPlugin. 33 | compress: true, 34 | host: HOST || config.dev.host, 35 | port: PORT || config.dev.port, 36 | open: config.dev.autoOpenBrowser, 37 | overlay: config.dev.errorOverlay 38 | ? { warnings: false, errors: true } 39 | : false, 40 | publicPath: config.dev.assetsPublicPath, 41 | proxy: config.dev.proxyTable, 42 | quiet: true, // necessary for FriendlyErrorsPlugin 43 | watchOptions: { 44 | poll: config.dev.poll, 45 | } 46 | }, 47 | plugins: [ 48 | new webpack.DefinePlugin({ 49 | 'process.env': require('../config/dev.env') 50 | }), 51 | new webpack.HotModuleReplacementPlugin(), 52 | new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. 53 | new webpack.NoEmitOnErrorsPlugin(), 54 | // https://github.com/ampedandwired/html-webpack-plugin 55 | new HtmlWebpackPlugin({ 56 | filename: 'index.html', 57 | template: 'index.html', 58 | inject: true 59 | }), 60 | // copy custom static assets 61 | new CopyWebpackPlugin([ 62 | { 63 | from: path.resolve(__dirname, '../static'), 64 | to: config.dev.assetsSubDirectory, 65 | ignore: ['.*'] 66 | } 67 | ]) 68 | ] 69 | }) 70 | 71 | module.exports = new Promise((resolve, reject) => { 72 | portfinder.basePort = process.env.PORT || config.dev.port 73 | portfinder.getPort((err, port) => { 74 | if (err) { 75 | reject(err) 76 | } else { 77 | // publish the new Port, necessary for e2e tests 78 | process.env.PORT = port 79 | // add port to devServer config 80 | devWebpackConfig.devServer.port = port 81 | 82 | // Add FriendlyErrorsPlugin 83 | devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ 84 | compilationSuccessInfo: { 85 | messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], 86 | }, 87 | onErrors: config.dev.notifyOnErrors 88 | ? utils.createNotifierCallback() 89 | : undefined 90 | })) 91 | 92 | resolve(devWebpackConfig) 93 | } 94 | }) 95 | }) 96 | -------------------------------------------------------------------------------- /docs/static/js/manifest.3ad1d5771e9b13dbdad2.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["webpack:///webpack/bootstrap f3d24cf422b63b6cf949"],"names":["parentJsonpFunction","window","chunkIds","moreModules","executeModules","moduleId","chunkId","result","i","resolves","length","installedChunks","push","Object","prototype","hasOwnProperty","call","modules","shift","__webpack_require__","s","installedModules","2","exports","module","l","m","c","d","name","getter","o","defineProperty","configurable","enumerable","get","n","__esModule","object","property","p","oe","err","console","error"],"mappings":"aACA,IAAAA,EAAAC,OAAA,aACAA,OAAA,sBAAAC,EAAAC,EAAAC,GAIA,IADA,IAAAC,EAAAC,EAAAC,EAAAC,EAAA,EAAAC,KACQD,EAAAN,EAAAQ,OAAoBF,IAC5BF,EAAAJ,EAAAM,GACAG,EAAAL,IACAG,EAAAG,KAAAD,EAAAL,GAAA,IAEAK,EAAAL,GAAA,EAEA,IAAAD,KAAAF,EACAU,OAAAC,UAAAC,eAAAC,KAAAb,EAAAE,KACAY,EAAAZ,GAAAF,EAAAE,IAIA,IADAL,KAAAE,EAAAC,EAAAC,GACAK,EAAAC,QACAD,EAAAS,OAAAT,GAEA,GAAAL,EACA,IAAAI,EAAA,EAAYA,EAAAJ,EAAAM,OAA2BF,IACvCD,EAAAY,IAAAC,EAAAhB,EAAAI,IAGA,OAAAD,GAIA,IAAAc,KAGAV,GACAW,EAAA,GAIA,SAAAH,EAAAd,GAGA,GAAAgB,EAAAhB,GACA,OAAAgB,EAAAhB,GAAAkB,QAGA,IAAAC,EAAAH,EAAAhB,IACAG,EAAAH,EACAoB,GAAA,EACAF,YAUA,OANAN,EAAAZ,GAAAW,KAAAQ,EAAAD,QAAAC,IAAAD,QAAAJ,GAGAK,EAAAC,GAAA,EAGAD,EAAAD,QAKAJ,EAAAO,EAAAT,EAGAE,EAAAQ,EAAAN,EAGAF,EAAAS,EAAA,SAAAL,EAAAM,EAAAC,GACAX,EAAAY,EAAAR,EAAAM,IACAhB,OAAAmB,eAAAT,EAAAM,GACAI,cAAA,EACAC,YAAA,EACAC,IAAAL,KAMAX,EAAAiB,EAAA,SAAAZ,GACA,IAAAM,EAAAN,KAAAa,WACA,WAA2B,OAAAb,EAAA,SAC3B,WAAiC,OAAAA,GAEjC,OADAL,EAAAS,EAAAE,EAAA,IAAAA,GACAA,GAIAX,EAAAY,EAAA,SAAAO,EAAAC,GAAsD,OAAA1B,OAAAC,UAAAC,eAAAC,KAAAsB,EAAAC,IAGtDpB,EAAAqB,EAAA,KAGArB,EAAAsB,GAAA,SAAAC,GAA8D,MAApBC,QAAAC,MAAAF,GAAoBA","file":"static/js/manifest.3ad1d5771e9b13dbdad2.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t2: 0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"./\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap f3d24cf422b63b6cf949"],"sourceRoot":""} -------------------------------------------------------------------------------- /vue-amap-gmap/build/webpack.prod.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const path = require('path') 3 | const utils = require('./utils') 4 | const webpack = require('webpack') 5 | const config = require('../config') 6 | const merge = require('webpack-merge') 7 | const baseWebpackConfig = require('./webpack.base.conf') 8 | const CopyWebpackPlugin = require('copy-webpack-plugin') 9 | const HtmlWebpackPlugin = require('html-webpack-plugin') 10 | const ExtractTextPlugin = require('extract-text-webpack-plugin') 11 | const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') 12 | const UglifyJsPlugin = require('uglifyjs-webpack-plugin') 13 | 14 | const env = process.env.NODE_ENV === 'testing' 15 | ? require('../config/test.env') 16 | : require('../config/prod.env') 17 | 18 | const webpackConfig = merge(baseWebpackConfig, { 19 | module: { 20 | rules: utils.styleLoaders({ 21 | sourceMap: config.build.productionSourceMap, 22 | extract: true, 23 | usePostCSS: true 24 | }) 25 | }, 26 | devtool: config.build.productionSourceMap ? config.build.devtool : false, 27 | output: { 28 | path: config.build.assetsRoot, 29 | filename: utils.assetsPath('js/[name].[chunkhash].js'), 30 | chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') 31 | }, 32 | plugins: [ 33 | // http://vuejs.github.io/vue-loader/en/workflow/production.html 34 | new webpack.DefinePlugin({ 35 | 'process.env': env 36 | }), 37 | new UglifyJsPlugin({ 38 | uglifyOptions: { 39 | compress: { 40 | warnings: false 41 | } 42 | }, 43 | sourceMap: config.build.productionSourceMap, 44 | parallel: true 45 | }), 46 | // extract css into its own file 47 | new ExtractTextPlugin({ 48 | filename: utils.assetsPath('css/[name].[contenthash].css'), 49 | // Setting the following option to `false` will not extract CSS from codesplit chunks. 50 | // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. 51 | // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, 52 | // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 53 | allChunks: true, 54 | }), 55 | // Compress extracted CSS. We are using this plugin so that possible 56 | // duplicated CSS from different components can be deduped. 57 | new OptimizeCSSPlugin({ 58 | cssProcessorOptions: config.build.productionSourceMap 59 | ? { safe: true, map: { inline: false } } 60 | : { safe: true } 61 | }), 62 | // generate dist index.html with correct asset hash for caching. 63 | // you can customize output by editing /index.html 64 | // see https://github.com/ampedandwired/html-webpack-plugin 65 | new HtmlWebpackPlugin({ 66 | filename: process.env.NODE_ENV === 'testing' 67 | ? 'index.html' 68 | : config.build.index, 69 | template: 'index.html', 70 | inject: true, 71 | minify: { 72 | removeComments: true, 73 | collapseWhitespace: true, 74 | removeAttributeQuotes: true 75 | // more options: 76 | // https://github.com/kangax/html-minifier#options-quick-reference 77 | }, 78 | // necessary to consistently work with multiple chunks via CommonsChunkPlugin 79 | chunksSortMode: 'dependency' 80 | }), 81 | // keep module.id stable when vendor modules does not change 82 | new webpack.HashedModuleIdsPlugin(), 83 | // enable scope hoisting 84 | new webpack.optimize.ModuleConcatenationPlugin(), 85 | // split vendor js into its own file 86 | new webpack.optimize.CommonsChunkPlugin({ 87 | name: 'vendor', 88 | minChunks (module) { 89 | // any required modules inside node_modules are extracted to vendor 90 | return ( 91 | module.resource && 92 | /\.js$/.test(module.resource) && 93 | module.resource.indexOf( 94 | path.join(__dirname, '../node_modules') 95 | ) === 0 96 | ) 97 | } 98 | }), 99 | // extract webpack runtime and module manifest to its own file in order to 100 | // prevent vendor hash from being updated whenever app bundle is updated 101 | new webpack.optimize.CommonsChunkPlugin({ 102 | name: 'manifest', 103 | minChunks: Infinity 104 | }), 105 | // This instance extracts shared chunks from code splitted chunks and bundles them 106 | // in a separate chunk, similar to the vendor chunk 107 | // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk 108 | new webpack.optimize.CommonsChunkPlugin({ 109 | name: 'app', 110 | async: 'vendor-async', 111 | children: true, 112 | minChunks: 3 113 | }), 114 | 115 | // copy custom static assets 116 | new CopyWebpackPlugin([ 117 | { 118 | from: path.resolve(__dirname, '../static'), 119 | to: config.build.assetsSubDirectory, 120 | ignore: ['.*'] 121 | } 122 | ]) 123 | ] 124 | }) 125 | 126 | if (config.build.productionGzip) { 127 | const CompressionWebpackPlugin = require('compression-webpack-plugin') 128 | 129 | webpackConfig.plugins.push( 130 | new CompressionWebpackPlugin({ 131 | asset: '[path].gz[query]', 132 | algorithm: 'gzip', 133 | test: new RegExp( 134 | '\\.(' + 135 | config.build.productionGzipExtensions.join('|') + 136 | ')$' 137 | ), 138 | threshold: 10240, 139 | minRatio: 0.8 140 | }) 141 | ) 142 | } 143 | 144 | if (config.build.bundleAnalyzerReport) { 145 | const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin 146 | webpackConfig.plugins.push(new BundleAnalyzerPlugin()) 147 | } 148 | 149 | module.exports = webpackConfig 150 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.suo 8 | *.user 9 | *.userosscache 10 | *.sln.docstates 11 | 12 | # User-specific files (MonoDevelop/Xamarin Studio) 13 | *.userprefs 14 | 15 | # Build results 16 | [Dd]ebug/ 17 | [Dd]ebugPublic/ 18 | [Rr]elease/ 19 | [Rr]eleases/ 20 | x64/ 21 | x86/ 22 | bld/ 23 | [Bb]in/ 24 | [Oo]bj/ 25 | [Ll]og/ 26 | 27 | # Visual Studio 2015/2017 cache/options directory 28 | .vs/ 29 | # Uncomment if you have tasks that create the project's static files in wwwroot 30 | #wwwroot/ 31 | 32 | # Visual Studio 2017 auto generated files 33 | Generated\ Files/ 34 | 35 | # MSTest test Results 36 | [Tt]est[Rr]esult*/ 37 | [Bb]uild[Ll]og.* 38 | 39 | # NUNIT 40 | *.VisualState.xml 41 | TestResult.xml 42 | 43 | # Build Results of an ATL Project 44 | [Dd]ebugPS/ 45 | [Rr]eleasePS/ 46 | dlldata.c 47 | 48 | # Benchmark Results 49 | BenchmarkDotNet.Artifacts/ 50 | 51 | # .NET Core 52 | project.lock.json 53 | project.fragment.lock.json 54 | artifacts/ 55 | **/Properties/launchSettings.json 56 | 57 | # StyleCop 58 | StyleCopReport.xml 59 | 60 | # Files built by Visual Studio 61 | *_i.c 62 | *_p.c 63 | *_i.h 64 | *.ilk 65 | *.meta 66 | *.obj 67 | *.iobj 68 | *.pch 69 | *.pdb 70 | *.ipdb 71 | *.pgc 72 | *.pgd 73 | *.rsp 74 | *.sbr 75 | *.tlb 76 | *.tli 77 | *.tlh 78 | *.tmp 79 | *.tmp_proj 80 | *.log 81 | *.vspscc 82 | *.vssscc 83 | .builds 84 | *.pidb 85 | *.svclog 86 | *.scc 87 | 88 | # Chutzpah Test files 89 | _Chutzpah* 90 | 91 | # Visual C++ cache files 92 | ipch/ 93 | *.aps 94 | *.ncb 95 | *.opendb 96 | *.opensdf 97 | *.sdf 98 | *.cachefile 99 | *.VC.db 100 | *.VC.VC.opendb 101 | 102 | # Visual Studio profiler 103 | *.psess 104 | *.vsp 105 | *.vspx 106 | *.sap 107 | 108 | # Visual Studio Trace Files 109 | *.e2e 110 | 111 | # TFS 2012 Local Workspace 112 | $tf/ 113 | 114 | # Guidance Automation Toolkit 115 | *.gpState 116 | 117 | # ReSharper is a .NET coding add-in 118 | _ReSharper*/ 119 | *.[Rr]e[Ss]harper 120 | *.DotSettings.user 121 | 122 | # JustCode is a .NET coding add-in 123 | .JustCode 124 | 125 | # TeamCity is a build add-in 126 | _TeamCity* 127 | 128 | # DotCover is a Code Coverage Tool 129 | *.dotCover 130 | 131 | # AxoCover is a Code Coverage Tool 132 | .axoCover/* 133 | !.axoCover/settings.json 134 | 135 | # Visual Studio code coverage results 136 | *.coverage 137 | *.coveragexml 138 | 139 | # NCrunch 140 | _NCrunch_* 141 | .*crunch*.local.xml 142 | nCrunchTemp_* 143 | 144 | # MightyMoose 145 | *.mm.* 146 | AutoTest.Net/ 147 | 148 | # Web workbench (sass) 149 | .sass-cache/ 150 | 151 | # Installshield output folder 152 | [Ee]xpress/ 153 | 154 | # DocProject is a documentation generator add-in 155 | DocProject/buildhelp/ 156 | DocProject/Help/*.HxT 157 | DocProject/Help/*.HxC 158 | DocProject/Help/*.hhc 159 | DocProject/Help/*.hhk 160 | DocProject/Help/*.hhp 161 | DocProject/Help/Html2 162 | DocProject/Help/html 163 | 164 | # Click-Once directory 165 | publish/ 166 | 167 | # Publish Web Output 168 | *.[Pp]ublish.xml 169 | *.azurePubxml 170 | # Note: Comment the next line if you want to checkin your web deploy settings, 171 | # but database connection strings (with potential passwords) will be unencrypted 172 | *.pubxml 173 | *.publishproj 174 | 175 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 176 | # checkin your Azure Web App publish settings, but sensitive information contained 177 | # in these scripts will be unencrypted 178 | PublishScripts/ 179 | 180 | # NuGet Packages 181 | *.nupkg 182 | # The packages folder can be ignored because of Package Restore 183 | **/[Pp]ackages/* 184 | # except build/, which is used as an MSBuild target. 185 | !**/[Pp]ackages/build/ 186 | # Uncomment if necessary however generally it will be regenerated when needed 187 | #!**/[Pp]ackages/repositories.config 188 | # NuGet v3's project.json files produces more ignorable files 189 | *.nuget.props 190 | *.nuget.targets 191 | 192 | # Microsoft Azure Build Output 193 | csx/ 194 | *.build.csdef 195 | 196 | # Microsoft Azure Emulator 197 | ecf/ 198 | rcf/ 199 | 200 | # Windows Store app package directories and files 201 | AppPackages/ 202 | BundleArtifacts/ 203 | Package.StoreAssociation.xml 204 | _pkginfo.txt 205 | *.appx 206 | 207 | # Visual Studio cache files 208 | # files ending in .cache can be ignored 209 | *.[Cc]ache 210 | # but keep track of directories ending in .cache 211 | !*.[Cc]ache/ 212 | 213 | # Others 214 | ClientBin/ 215 | ~$* 216 | *~ 217 | *.dbmdl 218 | *.dbproj.schemaview 219 | *.jfm 220 | *.pfx 221 | *.publishsettings 222 | orleans.codegen.cs 223 | 224 | # Including strong name files can present a security risk 225 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 226 | #*.snk 227 | 228 | # Since there are multiple workflows, uncomment next line to ignore bower_components 229 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 230 | #bower_components/ 231 | 232 | # RIA/Silverlight projects 233 | Generated_Code/ 234 | 235 | # Backup & report files from converting an old project file 236 | # to a newer Visual Studio version. Backup files are not needed, 237 | # because we have git ;-) 238 | _UpgradeReport_Files/ 239 | Backup*/ 240 | UpgradeLog*.XML 241 | UpgradeLog*.htm 242 | ServiceFabricBackup/ 243 | *.rptproj.bak 244 | 245 | # SQL Server files 246 | *.mdf 247 | *.ldf 248 | *.ndf 249 | 250 | # Business Intelligence projects 251 | *.rdl.data 252 | *.bim.layout 253 | *.bim_*.settings 254 | *.rptproj.rsuser 255 | 256 | # Microsoft Fakes 257 | FakesAssemblies/ 258 | 259 | # GhostDoc plugin setting file 260 | *.GhostDoc.xml 261 | 262 | # Node.js Tools for Visual Studio 263 | .ntvs_analysis.dat 264 | node_modules/ 265 | 266 | # Visual Studio 6 build log 267 | *.plg 268 | 269 | # Visual Studio 6 workspace options file 270 | *.opt 271 | 272 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 273 | *.vbw 274 | 275 | # Visual Studio LightSwitch build output 276 | **/*.HTMLClient/GeneratedArtifacts 277 | **/*.DesktopClient/GeneratedArtifacts 278 | **/*.DesktopClient/ModelManifest.xml 279 | **/*.Server/GeneratedArtifacts 280 | **/*.Server/ModelManifest.xml 281 | _Pvt_Extensions 282 | 283 | # Paket dependency manager 284 | .paket/paket.exe 285 | paket-files/ 286 | 287 | # FAKE - F# Make 288 | .fake/ 289 | 290 | # JetBrains Rider 291 | .idea/ 292 | *.sln.iml 293 | 294 | # CodeRush 295 | .cr/ 296 | 297 | # Python Tools for Visual Studio (PTVS) 298 | __pycache__/ 299 | *.pyc 300 | 301 | # Cake - Uncomment if you are using it 302 | # tools/** 303 | # !tools/packages.config 304 | 305 | # Tabs Studio 306 | *.tss 307 | 308 | # Telerik's JustMock configuration file 309 | *.jmconfig 310 | 311 | # BizTalk build output 312 | *.btp.cs 313 | *.btm.cs 314 | *.odx.cs 315 | *.xsd.cs 316 | 317 | # OpenCover UI analysis results 318 | OpenCover/ 319 | 320 | # Azure Stream Analytics local run output 321 | ASALocalRun/ 322 | 323 | # MSBuild Binary and Structured Log 324 | *.binlog 325 | 326 | # NVidia Nsight GPU debugger configuration file 327 | *.nvuser 328 | 329 | # MFractors (Xamarin productivity tool) working folder 330 | .mfractor/ 331 | -------------------------------------------------------------------------------- /docs/static/js/app.b71a7435fa79df84651d.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([1],{NHnr:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n("7+uW"),a={name:"App",mounted:function(){console.log("%c【calamus】 kiz.calamus@gmail.com\n%cwww.calamus.xyz \nwww.github.com/calamus0427 ","color:#E1244E;font-size:16px;","color:#9e9e9e;font-size:14px")}},i={render:function(){var e=this.$createElement,t=this._self._c||e;return t("div",{attrs:{id:"app"}},[t("router-view")],1)},staticRenderFns:[]};var l=n("VU/8")(a,i,!1,function(e){n("k/rE")},null,null).exports,r=n("/ocq"),s=n("bOdI"),c=n.n(s),p=n("/IwO"),u=n.n(p),d=new u.a.AMapManager,m={name:"GMap",props:{vid:{type:String,default:"amap-demo"},flex:{type:Number,default:0},center:{type:Array,default:function(){return[121.59996,31.197646]}},zoom:{type:Number,default:16},rotateEnable:{type:Boolean,default:!0},resizeEnable:{type:Boolean,default:!0},mapStyle:{type:String,default:"normal"},chooseArea:{type:Boolean,default:!0}},data:function(){var e=this,t=this;return{amapManager:d,map:null,AMap:null,geocoder:null,ruler:null,mouseTool:null,mPolygon:null,flagBit:!1,renderFenceOk:!1,fenceArr:[],mapCenter:[],svgChoose:"",chooseVisible:!1,bubble:!0,clickable:!0,minHeight:300,loaded:!1,markers:[],inputSearch:"",ellipse:{},rectangle:{},searchOption:{city:"西安",citylimit:!1},currentAddress:"",currentPosition:[],events:{init:function(e){var n=document.getElementById("addmPolygon"),o=document.getElementById("clearPolygon");t.mouseTool=new AMap.MouseTool(e),AMap.event.addDomListener(n,"click",function(e){t.mouseTool.measureArea(),t.flagBit=!0},!1),AMap.event.addDomListener(o,"click",function(){t.mouseTool.close(!0),t.flagBit=!1},!1),t.mouseTool.on("draw",function(e){t.flagBit=!1,t.mouseTool.close(!1);e.obj.getPath().map(function(e){return[e.lng,e.lat]})}),e.getCity(function(e){console.log(" map init success ",e)});var a=document.getElementById("measureLine"),i=document.getElementById("measureLineDel");t.ruler=new AMap.RangingTool(e);new AMap.Icon({size:new AMap.Size(19,31),image:"https://webapi.amap.com/theme/v1.3/markers/n/mark_b1.png"}),new AMap.Icon({size:new AMap.Size(19,31),image:"https://webapi.amap.com/theme/v1.3/markers/n/mark_b2.png"}),new AMap.Pixel(-9,-31);AMap.event.addDomListener(a,"click",function(e){t.ruler.turnOn(),t.flagBit=!0},!1),AMap.event.addListener(t.ruler,"end",function(e){t.ruler.turnOff(!1),t.flagBit=!1}),AMap.event.addDomListener(i,"click",function(){t.ruler.turnOff(!0),t.flagBit=!1},!1)},moveend:function(){},zoomchange:function(){},click:function(n){if(!e.flagBit){e.chooseVisible=!0;var o=n.lnglat,a=o.lng,i=o.lat;e.mapCenter=[a,i],e.getAddress([a,i]);t.getAddress([a,i])}}},plugin:["AMap.RangingTool","ToolBar","MapType","Scale","AMap.EllipseEditor","AMap.RectangleEditor","AMap.PolyEditor","AMap.MouseTool"],circle:{editable:!1,visible:!1,center:[121.5273285,31.21515044],radius:1e3,fillOpacity:.5,events:{click:function(){console.log("click circle")}}},polygon:{id:"1",visible:!1,editable:!1,draggable:!0,path:[],events:{click:function(){console.log("click polygon")}}}}},created:function(){this.AMap=window.AMap},mounted:function(){this.initMap()},computed:{flexHeight:function(){return(document.documentElement.clientHeight-this.flex>this.minHeight?document.documentElement.clientHeight-this.flex:this.minHeight)+"px"}},watch:{svgChoose:function(e,t){e}},methods:{initMap:function(){var e=this;p.lazyAMapApiLoaderInstance.load().then(function(){e.map=new AMap.Map("amapContainer",{center:new AMap.LngLat(e.center[0],e.center[1])}),e.geocoder=new AMap.Geocoder({radius:1e3,extensions:"all"}),e.getAddress([121.59996,31.197646]),e.getLocation("上海市")}),this.mapCenter=this.center},getAddress:function(e){var t=this;return this.geocoder.getAddress(e,function(n,o){"complete"===n&&"OK"===o.info&&o&&o.regeocode&&(t.currentAddress=o.regeocode.formattedAddress,t.$emit("click",{lat:e[0],lng:e[1],address:t.currentAddress}),t.$nextTick())}),this.currentAddress},getLocation:function(e){var t=this;return this.geocoder.getLocation(e,function(e,n){if("complete"===e&&"OK"===n.info){var o=n.geocodes[0].location,a=o.lng,i=o.lat;t.currentPosition=[a,i]}}),this.currentPosition},addMarker:function(){var e=121.5+Math.round(1e3*Math.random())/1e4,t=31.197646+Math.round(500*Math.random())/1e4;this.markers.push([e,t])},onSearchResult:function(e){var t=this,n=0,o=0;if(e.length>0){e.forEach(function(e){var a=e.lng,i=e.lat,l=e.address;o+=a,n+=i,t.markers.push({poi:[e.lng,e.lat],address:l})});var a={lng:o/e.length,lat:n/e.length};this.mapCenter=[a.lng,a.lat]}},markerClick:function(e){console.log("markerClick",e)},changeSvg:function(e){console.log(e)},addCircle:function(){this.circle.visible=!0},editCircle:function(){this.circle.editable=!0},exitCircle:function(){this.circle.editable=!1},removeCircle:function(){this.circle.editable=!1,this.circle.visible=!1},addEllipse:function(){this.ellipse=new AMap.Ellipse(c()({map:this.map,center:this.mapCenter,radius:[4e3,6e3],strokeColor:"red",strokeWeight:10,strokeOpacity:.5,strokeDasharray:[30,10],strokeStyle:"dashed",fillColor:"blue",fillOpacity:.5,zIndex:10,bubble:!0,cursor:"pointer"},"bubble",!1)),this.ellipse.setMap(this.map)},editEllipse:function(){return new AMap.EllipseEditor(this.map,this.ellipse).open()},exitEllipse:function(){return new AMap.EllipseEditor(this.map,this.ellipse).close()},addPolygon:function(){this.mapCenter;var e=[this.mapCenter[0],this.mapCenter[1]],t=[this.mapCenter[0]+.002,this.mapCenter[1]],n=[this.mapCenter[0]+.002,this.mapCenter[1]+.002],o=[this.mapCenter[0],this.mapCenter[1]+.002];this.polygon.path=[e,t,n,o,e],this.polygon.visible=!0},editPolygon:function(){this.polygon.editable=!0},exitPolygon:function(){this.polygon.editable=!1},removePolygon:function(){this.polygon.editable=!1,this.polygon.visible=!1}}},g={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"amap-container",style:{height:e.flexHeight}},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.chooseArea,expression:"chooseArea"}],staticClass:"svgBtn"},[n("el-select",{attrs:{placeholder:"请选择选择区域"},on:{change:e.changeSvg},model:{value:e.svgChoose,callback:function(t){e.svgChoose=t},expression:"svgChoose"}},[n("el-option",{attrs:{label:"圆",value:"1"}}),e._v(" "),n("el-option",{attrs:{label:"折线",value:"2"}}),e._v(" "),n("el-option",{attrs:{label:"多边形",value:"5"}}),e._v(" "),n("el-option",{attrs:{label:"自定义多边形",value:"6"}})],1),e._v(" "),n("el-button-group",{directives:[{name:"show",rawName:"v-show",value:1==e.svgChoose,expression:"svgChoose == 1"}]},[n("el-button",{on:{click:e.addCircle}},[e._v("添加圆")]),e._v(" "),n("el-button",{on:{click:e.editCircle}},[e._v("编辑圆")]),e._v(" "),n("el-button",{on:{click:e.exitCircle}},[e._v("结束编辑圆")]),e._v(" "),n("el-button",{on:{click:e.removeCircle}},[e._v("del circle")])],1),e._v(" "),n("el-button-group",{directives:[{name:"show",rawName:"v-show",value:5==e.svgChoose,expression:"svgChoose == 5"}]},[n("el-button",{on:{click:e.addPolygon}},[e._v("添加多边形")]),e._v(" "),n("el-button",{on:{click:e.editPolygon}},[e._v("编辑多边形")]),e._v(" "),n("el-button",{on:{click:e.exitPolygon}},[e._v("结束编辑多边形")]),e._v(" "),n("el-button",{on:{click:e.removePolygon}},[e._v("del多边形")])],1),e._v(" "),n("el-button-group",{directives:[{name:"show",rawName:"v-show",value:6==e.svgChoose,expression:"svgChoose == 6"}]},[n("el-button",{attrs:{id:"addmPolygon"}},[e._v("添加自定义多边形")]),e._v(" "),n("el-button",{attrs:{id:"clearPolygon"}},[e._v("删除多边形")])],1),e._v(" "),n("el-button-group",{directives:[{name:"show",rawName:"v-show",value:2==e.svgChoose,expression:"svgChoose == 2"}]},[n("el-button",{attrs:{id:"measureLine"}},[e._v("两点测距离")]),e._v(" "),n("el-button",{attrs:{id:"measureLineDel"}},[e._v("删除直线")])],1)],1),e._v(" "),n("el-amap-search-box",{staticClass:"search-box",attrs:{"search-option":e.searchOption,"on-search-result":e.onSearchResult},model:{value:e.inputSearch,callback:function(t){e.inputSearch=t},expression:"inputSearch"}}),e._v(" "),n("el-amap",{attrs:{vid:e.vid,center:e.mapCenter,zoom:e.zoom,rotateEnable:e.rotateEnable,resizeEnable:e.resizeEnable,mapStyle:e.mapStyle,"amap-manager":e.amapManager,plugin:e.plugin,events:e.events}},[n("el-amap-marker",{staticClass:"aaaaa",attrs:{zIndex:"2000",icon:"http://pevw4ryx8.bkt.clouddn.com/default_2x-fs.png",clickable:e.clickable,position:e.mapCenter},on:{click:function(t){return t.stopPropagation(),e.markerClick(t)}}}),e._v(" "),e._l(e.markers,function(t,o){return n("el-amap-marker",{key:o,attrs:{cursor:"pointer",bubble:e.bubble,clickable:e.clickable,position:t.poi,title:t.address},on:{click:function(t){return t.stopPropagation(),e.markerClick(t)}}})}),e._v(" "),n("el-amap-circle",{attrs:{visible:e.circle.visible,editable:e.circle.editable,center:e.mapCenter,radius:e.circle.radius,"fill-opacity":e.circle.fillOpacity,events:e.circle.events}}),e._v(" "),n("el-amap-polygon",{attrs:{visible:e.polygon.visible,editable:e.polygon.editable,vid:e.polygon.id,path:e.polygon.path,draggable:e.polygon.draggable,events:e.polygon.events}})],2)],1)},staticRenderFns:[]};var h={name:"demo3D",components:{GMap:n("VU/8")(m,g,!1,function(e){n("c6Jh")},"data-v-2f584b34",null).exports},data:function(){return{vid:"amap-vue",poi:{lat:"",lng:""},address:""}},mounted:function(){},methods:{choose:function(e){this.poi.lat=e.lat,this.poi.lng=e.lng,this.address=e.address}}},v={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("div",[e._v("当前点击位置:"+e._s(e.poi.lat)+","+e._s(e.poi.lng)+",城市为: "+e._s(e.address))]),e._v(" "),n("g-map",{attrs:{vid:e.vid},on:{click:e.choose}})],1)},staticRenderFns:[]};var f=n("VU/8")(h,v,!1,function(e){n("nZHr")},"data-v-32c84186",null).exports;o.default.use(r.a);var b=new r.a({routes:[{path:"/",name:"GMap",component:f}]}),y=n("zL8q"),A=n.n(y);n("tvR6");o.default.config.productionTip=!1,o.default.use(u.a),o.default.use(A.a),u.a.initAMapApiLoader({key:"8703164b6d9a53e64195238e3e17b1f3",plugin:["AMap.RangingTool","AMap.MouseTool","AMap.PolyEditor","AMap.CircleEditor","AMap.Autocomplete","AMap.EllipseEditor","AMap.RectangleEditor","AMap.PlaceSearch","AMap.Scale","AMap.OverView","AMap.ToolBar","AMap.MapType","AMap.PolyEditor","AMap.CircleEditor","AMap.Geocoder","Geolocation"],uiVersion:"1.0"}),new o.default({el:"#app",router:b,components:{App:l},template:""})},c6Jh:function(e,t){},"k/rE":function(e,t){},nZHr:function(e,t){},tvR6:function(e,t){}},["NHnr"]); 2 | //# sourceMappingURL=app.b71a7435fa79df84651d.js.map -------------------------------------------------------------------------------- /vue-amap-gmap/src/components/gMap.vue: -------------------------------------------------------------------------------- 1 | 56 | 658 | 692 | -------------------------------------------------------------------------------- /docs/static/js/app.b71a7435fa79df84651d.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["webpack:///src/App.vue","webpack:///./src/App.vue?caf5","webpack:///./src/App.vue","webpack:///src/components/gMap.vue","webpack:///./src/components/gMap.vue?d4b6","webpack:///./src/components/gMap.vue","webpack:///src/view/gmapDemo.vue","webpack:///./src/view/gmapDemo.vue?33a4","webpack:///./src/view/gmapDemo.vue","webpack:///./src/router/index.js","webpack:///./src/main.js"],"names":["App","name","mounted","console","log","selectortype_template_index_0_src_App","render","_h","this","$createElement","_c","_self","attrs","id","staticRenderFns","src_App","__webpack_require__","normalizeComponent","ssrContext","amapManager","dist_default","a","AMapManager","gMap","props","vid","type","String","default","flex","Number","center","Array","zoom","rotateEnable","Boolean","resizeEnable","mapStyle","chooseArea","data","_this","self","map","AMap","geocoder","ruler","mouseTool","mPolygon","flagBit","renderFenceOk","fenceArr","mapCenter","svgChoose","chooseVisible","bubble","clickable","minHeight","loaded","markers","inputSearch","ellipse","rectangle","searchOption","city","citylimit","currentAddress","currentPosition","events","init","addPolygonButton","document","getElementById","clearPolygonButton","MouseTool","event","addDomListener","resData","measureArea","close","on","obj","getPath","item","lng","lat","getCity","result","measureLine","measureLineDel","RangingTool","Icon","size","Size","image","Pixel","turnOn","addListener","e","turnOff","moveend","zoomchange","click","_e$lnglat","lnglat","getAddress","plugin","circle","editable","visible","radius","fillOpacity","polygon","draggable","path","created","window","initMap","computed","flexHeight","documentElement","clientHeight","watch","newVal","oldVal","methods","_this2","dist","load","then","Map","LngLat","Geocoder","extensions","getLocation","location","_this3","status","info","regeocode","formattedAddress","$emit","address","$nextTick","_this4","_result$geocodes$0$lo","geocodes","addMarker","Math","round","random","push","onSearchResult","pois","_this5","latSum","lngSum","length","forEach","poi","markerClick","res","changeSvg","addCircle","editCircle","exitCircle","removeCircle","addEllipse","Ellipse","defineProperty_default","strokeColor","strokeWeight","strokeOpacity","strokeDasharray","strokeStyle","fillColor","zIndex","cursor","setMap","editEllipse","EllipseEditor","open","exitEllipse","addPolygon","map2","map3","map4","map5","editPolygon","exitPolygon","removePolygon","components_gMap","_vm","staticClass","style","height","directives","rawName","value","expression","placeholder","change","model","callback","$$v","label","_v","search-option","on-search-result","amap-manager","icon","position","$event","stopPropagation","_l","marker","index","key","title","fill-opacity","gmapDemo","components","GMap","gMap_normalizeComponent","choose","view_gmapDemo","_s","src_view_gmapDemo","gmapDemo_normalizeComponent","vue_esm","use","vue_router_esm","router","routes","component","config","productionTip","element_ui_common_default","initAMapApiLoader","uiVersion","el","template"],"mappings":"qHAOAA,GACAC,KAAA,MACAC,QAFA,WAGAC,QAAAC,IAAA,yJCPeC,GAD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AAA2G,EAAAkC,GAAAlC,EAAAjC,IAAA3E,KAAA,SAAA4G,EAAAkC,GAAAlC,EAAAlD,YAAAkD,EAAAc,GAAA,KAAAnM,EAAA,SAAgJE,OAAOa,IAAAsK,EAAAtK,KAAcsD,IAAKsB,MAAA0F,EAAAgC,WAAoB,IAEvPjN,oBCChC,IAuBeoN,EAvBUlN,EAAQ,OAcjBmN,CACdR,EACAK,GAT6B,EAV/B,SAAoB9M,GAClBF,EAAQ,SAaS,kBAEU,MAUG,QCrBhCoN,EAAA,QAAIC,IAAIC,EAAA,GAEO,IAAAC,EAAA,IAAID,EAAA,GACjBE,SAEIvH,KAAM,IACNhH,KAAM,OACNwO,UAAWP,qCCHjBE,EAAA,QAAIM,OAAOC,eAAgB,EAE3BP,EAAA,QAAIC,IAAIjN,EAAAC,GACR+M,EAAA,QAAIC,IAAIO,EAAAvN,GACRD,EAAAC,EAAQwN,mBACNrB,IAAK,mCACL/G,QAAS,mBAAoB,iBAAkB,kBAAmB,oBAAqB,oBAAqB,qBAAsB,uBAAwB,mBAAoB,aAAc,gBAAiB,eAAgB,eAAgB,kBAAmB,oBAAqB,gBAAiB,eACtSqI,UAAW,QAKb,IAAIV,EAAA,SACFW,GAAI,OACJR,SACAX,YAAc5N,IAAAe,GACdiO,SAAU","file":"static/js/app.b71a7435fa79df84651d.js","sourcesContent":["\n\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/App.vue","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{\"id\":\"app\"}},[_c('router-view')],1)}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-ae5576ea\",\"hasScoped\":false,\"transformToRequire\":{\"video\":[\"src\",\"poster\"],\"source\":\"src\",\"img\":\"src\",\"image\":\"xlink:href\"},\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/App.vue\n// module id = null\n// module chunks = ","function injectStyle (ssrContext) {\n require(\"!!../node_modules/extract-text-webpack-plugin/dist/loader.js?{\\\"omit\\\":1,\\\"remove\\\":true}!vue-style-loader!css-loader?{\\\"sourceMap\\\":true}!../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-ae5576ea\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../node_modules/vue-loader/lib/selector?type=styles&index=0!./App.vue\")\n}\nvar normalizeComponent = require(\"!../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../node_modules/vue-loader/lib/selector?type=script&index=0!./App.vue\"\nimport __vue_script__ from \"!!babel-loader!../node_modules/vue-loader/lib/selector?type=script&index=0!./App.vue\"\n/* template */\nimport __vue_template__ from \"!!../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-ae5576ea\\\",\\\"hasScoped\\\":false,\\\"transformToRequire\\\":{\\\"video\\\":[\\\"src\\\",\\\"poster\\\"],\\\"source\\\":\\\"src\\\",\\\"img\\\":\\\"src\\\",\\\"image\\\":\\\"xlink:href\\\"},\\\"buble\\\":{\\\"transforms\\\":{}}}!../node_modules/vue-loader/lib/selector?type=template&index=0!./App.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/App.vue\n// module id = null\n// module chunks = ","\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/components/gMap.vue","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"amap-container\",style:({height: _vm.flexHeight})},[_c('div',{directives:[{name:\"show\",rawName:\"v-show\",value:(_vm.chooseArea),expression:\"chooseArea\"}],staticClass:\"svgBtn\"},[_c('el-select',{attrs:{\"placeholder\":\"请选择选择区域\"},on:{\"change\":_vm.changeSvg},model:{value:(_vm.svgChoose),callback:function ($$v) {_vm.svgChoose=$$v},expression:\"svgChoose\"}},[_c('el-option',{attrs:{\"label\":\"圆\",\"value\":\"1\"}}),_vm._v(\" \"),_c('el-option',{attrs:{\"label\":\"折线\",\"value\":\"2\"}}),_vm._v(\" \"),_c('el-option',{attrs:{\"label\":\"多边形\",\"value\":\"5\"}}),_vm._v(\" \"),_c('el-option',{attrs:{\"label\":\"自定义多边形\",\"value\":\"6\"}})],1),_vm._v(\" \"),_c('el-button-group',{directives:[{name:\"show\",rawName:\"v-show\",value:(_vm.svgChoose == 1),expression:\"svgChoose == 1\"}]},[_c('el-button',{on:{\"click\":_vm.addCircle}},[_vm._v(\"添加圆\")]),_vm._v(\" \"),_c('el-button',{on:{\"click\":_vm.editCircle}},[_vm._v(\"编辑圆\")]),_vm._v(\" \"),_c('el-button',{on:{\"click\":_vm.exitCircle}},[_vm._v(\"结束编辑圆\")]),_vm._v(\" \"),_c('el-button',{on:{\"click\":_vm.removeCircle}},[_vm._v(\"del circle\")])],1),_vm._v(\" \"),_c('el-button-group',{directives:[{name:\"show\",rawName:\"v-show\",value:(_vm.svgChoose == 5),expression:\"svgChoose == 5\"}]},[_c('el-button',{on:{\"click\":_vm.addPolygon}},[_vm._v(\"添加多边形\")]),_vm._v(\" \"),_c('el-button',{on:{\"click\":_vm.editPolygon}},[_vm._v(\"编辑多边形\")]),_vm._v(\" \"),_c('el-button',{on:{\"click\":_vm.exitPolygon}},[_vm._v(\"结束编辑多边形\")]),_vm._v(\" \"),_c('el-button',{on:{\"click\":_vm.removePolygon}},[_vm._v(\"del多边形\")])],1),_vm._v(\" \"),_c('el-button-group',{directives:[{name:\"show\",rawName:\"v-show\",value:(_vm.svgChoose == 6),expression:\"svgChoose == 6\"}]},[_c('el-button',{attrs:{\"id\":\"addmPolygon\"}},[_vm._v(\"添加自定义多边形\")]),_vm._v(\" \"),_c('el-button',{attrs:{\"id\":\"clearPolygon\"}},[_vm._v(\"删除多边形\")])],1),_vm._v(\" \"),_c('el-button-group',{directives:[{name:\"show\",rawName:\"v-show\",value:(_vm.svgChoose == 2),expression:\"svgChoose == 2\"}]},[_c('el-button',{attrs:{\"id\":\"measureLine\"}},[_vm._v(\"两点测距离\")]),_vm._v(\" \"),_c('el-button',{attrs:{\"id\":\"measureLineDel\"}},[_vm._v(\"删除直线\")])],1)],1),_vm._v(\" \"),_c('el-amap-search-box',{staticClass:\"search-box\",attrs:{\"search-option\":_vm.searchOption,\"on-search-result\":_vm.onSearchResult},model:{value:(_vm.inputSearch),callback:function ($$v) {_vm.inputSearch=$$v},expression:\"inputSearch\"}}),_vm._v(\" \"),_c('el-amap',{attrs:{\"vid\":_vm.vid,\"center\":_vm.mapCenter,\"zoom\":_vm.zoom,\"rotateEnable\":_vm.rotateEnable,\"resizeEnable\":_vm.resizeEnable,\"mapStyle\":_vm.mapStyle,\"amap-manager\":_vm.amapManager,\"plugin\":_vm.plugin,\"events\":_vm.events}},[_c('el-amap-marker',{staticClass:\"aaaaa\",attrs:{\"zIndex\":\"2000\",\"icon\":\"http://pevw4ryx8.bkt.clouddn.com/default_2x-fs.png\",\"clickable\":_vm.clickable,\"position\":_vm.mapCenter},on:{\"click\":function($event){$event.stopPropagation();return _vm.markerClick($event)}}}),_vm._v(\" \"),_vm._l((_vm.markers),function(marker,index){return _c('el-amap-marker',{key:index,attrs:{\"cursor\":\"pointer\",\"bubble\":_vm.bubble,\"clickable\":_vm.clickable,\"position\":marker.poi,\"title\":marker.address},on:{\"click\":function($event){$event.stopPropagation();return _vm.markerClick($event)}}})}),_vm._v(\" \"),_c('el-amap-circle',{attrs:{\"visible\":_vm.circle.visible,\"editable\":_vm.circle.editable,\"center\":_vm.mapCenter,\"radius\":_vm.circle.radius,\"fill-opacity\":_vm.circle.fillOpacity,\"events\":_vm.circle.events}}),_vm._v(\" \"),_c('el-amap-polygon',{attrs:{\"visible\":_vm.polygon.visible,\"editable\":_vm.polygon.editable,\"vid\":_vm.polygon.id,\"path\":_vm.polygon.path,\"draggable\":_vm.polygon.draggable,\"events\":_vm.polygon.events}})],2)],1)}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-2f584b34\",\"hasScoped\":true,\"transformToRequire\":{\"video\":[\"src\",\"poster\"],\"source\":\"src\",\"img\":\"src\",\"image\":\"xlink:href\"},\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/components/gMap.vue\n// module id = null\n// module chunks = ","function injectStyle (ssrContext) {\n require(\"!!../../node_modules/extract-text-webpack-plugin/dist/loader.js?{\\\"omit\\\":1,\\\"remove\\\":true}!vue-style-loader!css-loader?{\\\"sourceMap\\\":true}!../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-2f584b34\\\",\\\"scoped\\\":true,\\\"hasInlineConfig\\\":false}!../../node_modules/vue-loader/lib/selector?type=styles&index=0!./gMap.vue\")\n}\nvar normalizeComponent = require(\"!../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../node_modules/vue-loader/lib/selector?type=script&index=0!./gMap.vue\"\nimport __vue_script__ from \"!!babel-loader!../../node_modules/vue-loader/lib/selector?type=script&index=0!./gMap.vue\"\n/* template */\nimport __vue_template__ from \"!!../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-2f584b34\\\",\\\"hasScoped\\\":true,\\\"transformToRequire\\\":{\\\"video\\\":[\\\"src\\\",\\\"poster\\\"],\\\"source\\\":\\\"src\\\",\\\"img\\\":\\\"src\\\",\\\"image\\\":\\\"xlink:href\\\"},\\\"buble\\\":{\\\"transforms\\\":{}}}!../../node_modules/vue-loader/lib/selector?type=template&index=0!./gMap.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = \"data-v-2f584b34\"\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/components/gMap.vue\n// module id = null\n// module chunks = ","\n\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/view/gmapDemo.vue","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('div',[_vm._v(\"当前点击位置:\"+_vm._s(_vm.poi.lat)+\",\"+_vm._s(_vm.poi.lng)+\",城市为: \"+_vm._s(_vm.address))]),_vm._v(\" \"),_c('g-map',{attrs:{\"vid\":_vm.vid},on:{\"click\":_vm.choose}})],1)}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-32c84186\",\"hasScoped\":true,\"transformToRequire\":{\"video\":[\"src\",\"poster\"],\"source\":\"src\",\"img\":\"src\",\"image\":\"xlink:href\"},\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/view/gmapDemo.vue\n// module id = null\n// module chunks = ","function injectStyle (ssrContext) {\n require(\"!!../../node_modules/extract-text-webpack-plugin/dist/loader.js?{\\\"omit\\\":1,\\\"remove\\\":true}!vue-style-loader!css-loader?{\\\"sourceMap\\\":true}!../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-32c84186\\\",\\\"scoped\\\":true,\\\"hasInlineConfig\\\":false}!../../node_modules/vue-loader/lib/selector?type=styles&index=0!./gmapDemo.vue\")\n}\nvar normalizeComponent = require(\"!../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../node_modules/vue-loader/lib/selector?type=script&index=0!./gmapDemo.vue\"\nimport __vue_script__ from \"!!babel-loader!../../node_modules/vue-loader/lib/selector?type=script&index=0!./gmapDemo.vue\"\n/* template */\nimport __vue_template__ from \"!!../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-32c84186\\\",\\\"hasScoped\\\":true,\\\"transformToRequire\\\":{\\\"video\\\":[\\\"src\\\",\\\"poster\\\"],\\\"source\\\":\\\"src\\\",\\\"img\\\":\\\"src\\\",\\\"image\\\":\\\"xlink:href\\\"},\\\"buble\\\":{\\\"transforms\\\":{}}}!../../node_modules/vue-loader/lib/selector?type=template&index=0!./gmapDemo.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = \"data-v-32c84186\"\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/view/gmapDemo.vue\n// module id = null\n// module chunks = ","import Vue from 'vue'\nimport Router from 'vue-router'\nimport GMap from '@/view/gmapDemo'\n\n\nVue.use(Router)\n\nexport default new Router({\n routes: [\n {\n path: '/',\n name: 'GMap',\n component: GMap\n }\n ]\n})\n\n\n\n// WEBPACK FOOTER //\n// ./src/router/index.js","// The Vue build version to load with the `import` command\n// (runtime-only or standalone) has been set in webpack.base.conf with an alias.\nimport Vue from 'vue'\nimport App from './App'\nimport router from './router'\nimport VueAMap from 'vue-amap'\nimport ElementUI from 'element-ui';\nimport 'element-ui/lib/theme-chalk/index.css';\n\nVue.config.productionTip = false\n\nVue.use(VueAMap)\nVue.use(ElementUI);\nVueAMap.initAMapApiLoader({\n key: '8703164b6d9a53e64195238e3e17b1f3',\n plugin: ['AMap.RangingTool', 'AMap.MouseTool', 'AMap.PolyEditor', 'AMap.CircleEditor', 'AMap.Autocomplete', 'AMap.EllipseEditor', 'AMap.RectangleEditor', 'AMap.PlaceSearch', 'AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PolyEditor', 'AMap.CircleEditor', 'AMap.Geocoder', 'Geolocation'],\n uiVersion: '1.0'\n})\n\n\n/* eslint-disable no-new */\nnew Vue({\n el: '#app',\n router,\n components: { App },\n template: ''\n})\n\n\n\n// WEBPACK FOOTER //\n// ./src/main.js"],"sourceRoot":""} --------------------------------------------------------------------------------