'init'
0 parents
Showing
53 changed files
with
4007 additions
and
0 deletions
.babelrc
0 → 100644
.editorconfig
0 → 100644
.gitignore
0 → 100644
.postcssrc.js
0 → 100644
README.md
0 → 100644
| 1 | # mybox | ||
| 2 | |||
| 3 | > A Vue.js project | ||
| 4 | |||
| 5 | ## Build Setup | ||
| 6 | |||
| 7 | ``` bash | ||
| 8 | # install dependencies | ||
| 9 | npm install | ||
| 10 | |||
| 11 | # serve with hot reload at localhost:8080 | ||
| 12 | npm run dev | ||
| 13 | |||
| 14 | # build for production with minification | ||
| 15 | npm run build | ||
| 16 | |||
| 17 | # build for production and view the bundle analyzer report | ||
| 18 | npm run build --report | ||
| 19 | ``` | ||
| 20 | |||
| 21 | For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader). |
build/build.js
0 → 100644
| 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 | }) |
build/check-versions.js
0 → 100644
| 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 | } |
build/logo.png
0 → 100644
6.69 KB
build/utils.js
0 → 100644
| 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 | } |
build/vue-loader.conf.js
0 → 100644
| 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 | } |
build/webpack.base.conf.js
0 → 100644
| 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 | externals: { | ||
| 19 | 'mapbox-gl': 'mapboxgl', | ||
| 20 | }, | ||
| 21 | output: { | ||
| 22 | path: config.build.assetsRoot, | ||
| 23 | filename: '[name].js', | ||
| 24 | publicPath: process.env.NODE_ENV === 'production' | ||
| 25 | ? config.build.assetsPublicPath | ||
| 26 | : config.dev.assetsPublicPath | ||
| 27 | }, | ||
| 28 | resolve: { | ||
| 29 | extensions: ['.js', '.vue', '.json'], | ||
| 30 | alias: { | ||
| 31 | 'vue$': 'vue/dist/vue.esm.js', | ||
| 32 | '@': resolve('src'), | ||
| 33 | } | ||
| 34 | }, | ||
| 35 | module: { | ||
| 36 | rules: [ | ||
| 37 | { | ||
| 38 | test: /\.vue$/, | ||
| 39 | loader: 'vue-loader', | ||
| 40 | options: vueLoaderConfig | ||
| 41 | }, | ||
| 42 | { | ||
| 43 | test: /\.js$/, | ||
| 44 | loader: 'babel-loader', | ||
| 45 | include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] | ||
| 46 | }, | ||
| 47 | { | ||
| 48 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, | ||
| 49 | loader: 'url-loader', | ||
| 50 | options: { | ||
| 51 | limit: 10000, | ||
| 52 | name: utils.assetsPath('img/[name].[hash:7].[ext]') | ||
| 53 | } | ||
| 54 | }, | ||
| 55 | { | ||
| 56 | test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, | ||
| 57 | loader: 'url-loader', | ||
| 58 | options: { | ||
| 59 | limit: 10000, | ||
| 60 | name: utils.assetsPath('media/[name].[hash:7].[ext]') | ||
| 61 | } | ||
| 62 | }, | ||
| 63 | { | ||
| 64 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, | ||
| 65 | loader: 'url-loader', | ||
| 66 | options: { | ||
| 67 | limit: 10000, | ||
| 68 | name: utils.assetsPath('fonts/[name].[hash:7].[ext]') | ||
| 69 | } | ||
| 70 | } | ||
| 71 | ] | ||
| 72 | }, | ||
| 73 | node: { | ||
| 74 | // prevent webpack from injecting useless setImmediate polyfill because Vue | ||
| 75 | // source contains it (although only uses it if it's native). | ||
| 76 | setImmediate: false, | ||
| 77 | // prevent webpack from injecting mocks to Node native modules | ||
| 78 | // that does not make sense for the client | ||
| 79 | dgram: 'empty', | ||
| 80 | fs: 'empty', | ||
| 81 | net: 'empty', | ||
| 82 | tls: 'empty', | ||
| 83 | child_process: 'empty' | ||
| 84 | } | ||
| 85 | } |
build/webpack.dev.conf.js
0 → 100644
| 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 | }) |
build/webpack.prod.conf.js
0 → 100644
| 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 = require('../config/prod.env') | ||
| 15 | |||
| 16 | const webpackConfig = merge(baseWebpackConfig, { | ||
| 17 | module: { | ||
| 18 | rules: utils.styleLoaders({ | ||
| 19 | sourceMap: config.build.productionSourceMap, | ||
| 20 | extract: true, | ||
| 21 | usePostCSS: true | ||
| 22 | }) | ||
| 23 | }, | ||
| 24 | devtool: config.build.productionSourceMap ? config.build.devtool : false, | ||
| 25 | output: { | ||
| 26 | path: config.build.assetsRoot, | ||
| 27 | filename: utils.assetsPath('js/[name].[chunkhash].js'), | ||
| 28 | chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') | ||
| 29 | }, | ||
| 30 | plugins: [ | ||
| 31 | // http://vuejs.github.io/vue-loader/en/workflow/production.html | ||
| 32 | new webpack.DefinePlugin({ | ||
| 33 | 'process.env': env | ||
| 34 | }), | ||
| 35 | new UglifyJsPlugin({ | ||
| 36 | uglifyOptions: { | ||
| 37 | compress: { | ||
| 38 | warnings: false | ||
| 39 | } | ||
| 40 | }, | ||
| 41 | sourceMap: config.build.productionSourceMap, | ||
| 42 | parallel: true | ||
| 43 | }), | ||
| 44 | // extract css into its own file | ||
| 45 | new ExtractTextPlugin({ | ||
| 46 | filename: utils.assetsPath('css/[name].[contenthash].css'), | ||
| 47 | // Setting the following option to `false` will not extract CSS from codesplit chunks. | ||
| 48 | // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. | ||
| 49 | // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, | ||
| 50 | // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 | ||
| 51 | allChunks: true, | ||
| 52 | }), | ||
| 53 | // Compress extracted CSS. We are using this plugin so that possible | ||
| 54 | // duplicated CSS from different components can be deduped. | ||
| 55 | new OptimizeCSSPlugin({ | ||
| 56 | cssProcessorOptions: config.build.productionSourceMap | ||
| 57 | ? { safe: true, map: { inline: false } } | ||
| 58 | : { safe: true } | ||
| 59 | }), | ||
| 60 | // generate dist index.html with correct asset hash for caching. | ||
| 61 | // you can customize output by editing /index.html | ||
| 62 | // see https://github.com/ampedandwired/html-webpack-plugin | ||
| 63 | new HtmlWebpackPlugin({ | ||
| 64 | filename: config.build.index, | ||
| 65 | template: 'index.html', | ||
| 66 | inject: true, | ||
| 67 | minify: { | ||
| 68 | removeComments: true, | ||
| 69 | collapseWhitespace: true, | ||
| 70 | removeAttributeQuotes: true | ||
| 71 | // more options: | ||
| 72 | // https://github.com/kangax/html-minifier#options-quick-reference | ||
| 73 | }, | ||
| 74 | // necessary to consistently work with multiple chunks via CommonsChunkPlugin | ||
| 75 | chunksSortMode: 'dependency' | ||
| 76 | }), | ||
| 77 | // keep module.id stable when vendor modules does not change | ||
| 78 | new webpack.HashedModuleIdsPlugin(), | ||
| 79 | // enable scope hoisting | ||
| 80 | new webpack.optimize.ModuleConcatenationPlugin(), | ||
| 81 | // split vendor js into its own file | ||
| 82 | new webpack.optimize.CommonsChunkPlugin({ | ||
| 83 | name: 'vendor', | ||
| 84 | minChunks (module) { | ||
| 85 | // any required modules inside node_modules are extracted to vendor | ||
| 86 | return ( | ||
| 87 | module.resource && | ||
| 88 | /\.js$/.test(module.resource) && | ||
| 89 | module.resource.indexOf( | ||
| 90 | path.join(__dirname, '../node_modules') | ||
| 91 | ) === 0 | ||
| 92 | ) | ||
| 93 | } | ||
| 94 | }), | ||
| 95 | // extract webpack runtime and module manifest to its own file in order to | ||
| 96 | // prevent vendor hash from being updated whenever app bundle is updated | ||
| 97 | new webpack.optimize.CommonsChunkPlugin({ | ||
| 98 | name: 'manifest', | ||
| 99 | minChunks: Infinity | ||
| 100 | }), | ||
| 101 | // This instance extracts shared chunks from code splitted chunks and bundles them | ||
| 102 | // in a separate chunk, similar to the vendor chunk | ||
| 103 | // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk | ||
| 104 | new webpack.optimize.CommonsChunkPlugin({ | ||
| 105 | name: 'app', | ||
| 106 | async: 'vendor-async', | ||
| 107 | children: true, | ||
| 108 | minChunks: 3 | ||
| 109 | }), | ||
| 110 | |||
| 111 | // copy custom static assets | ||
| 112 | new CopyWebpackPlugin([ | ||
| 113 | { | ||
| 114 | from: path.resolve(__dirname, '../static'), | ||
| 115 | to: config.build.assetsSubDirectory, | ||
| 116 | ignore: ['.*'] | ||
| 117 | } | ||
| 118 | ]) | ||
| 119 | ] | ||
| 120 | }) | ||
| 121 | |||
| 122 | if (config.build.productionGzip) { | ||
| 123 | const CompressionWebpackPlugin = require('compression-webpack-plugin') | ||
| 124 | |||
| 125 | webpackConfig.plugins.push( | ||
| 126 | new CompressionWebpackPlugin({ | ||
| 127 | asset: '[path].gz[query]', | ||
| 128 | algorithm: 'gzip', | ||
| 129 | test: new RegExp( | ||
| 130 | '\\.(' + | ||
| 131 | config.build.productionGzipExtensions.join('|') + | ||
| 132 | ')$' | ||
| 133 | ), | ||
| 134 | threshold: 10240, | ||
| 135 | minRatio: 0.8 | ||
| 136 | }) | ||
| 137 | ) | ||
| 138 | } | ||
| 139 | |||
| 140 | if (config.build.bundleAnalyzerReport) { | ||
| 141 | const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin | ||
| 142 | webpackConfig.plugins.push(new BundleAnalyzerPlugin()) | ||
| 143 | } | ||
| 144 | |||
| 145 | module.exports = webpackConfig |
config/dev.env.js
0 → 100644
config/index.js
0 → 100644
| 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 | // '/api':{ | ||
| 15 | // target: 'http://support.supermap.com.cn:8090', //源地址 | ||
| 16 | // changeOrigin: true, //改变源 | ||
| 17 | // pathRewrite: { | ||
| 18 | // '^/api': 'http://support.supermap.com.cn:8090' //路径重写 | ||
| 19 | // } | ||
| 20 | // } | ||
| 21 | }, | ||
| 22 | |||
| 23 | // Various Dev Server settings | ||
| 24 | host: 'localhost', // can be overwritten by process.env.HOST | ||
| 25 | port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined | ||
| 26 | autoOpenBrowser: false, | ||
| 27 | errorOverlay: true, | ||
| 28 | notifyOnErrors: true, | ||
| 29 | poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- | ||
| 30 | |||
| 31 | |||
| 32 | /** | ||
| 33 | * Source Maps | ||
| 34 | */ | ||
| 35 | |||
| 36 | // https://webpack.js.org/configuration/devtool/#development | ||
| 37 | devtool: 'cheap-module-eval-source-map', | ||
| 38 | |||
| 39 | // If you have problems debugging vue-files in devtools, | ||
| 40 | // set this to false - it *may* help | ||
| 41 | // https://vue-loader.vuejs.org/en/options.html#cachebusting | ||
| 42 | cacheBusting: true, | ||
| 43 | |||
| 44 | cssSourceMap: true | ||
| 45 | }, | ||
| 46 | |||
| 47 | build: { | ||
| 48 | // Template for index.html | ||
| 49 | index: path.resolve(__dirname, '../dist/index.html'), | ||
| 50 | |||
| 51 | // Paths | ||
| 52 | assetsRoot: path.resolve(__dirname, '../dist'), | ||
| 53 | assetsSubDirectory: 'static', | ||
| 54 | assetsPublicPath: '/', | ||
| 55 | |||
| 56 | /** | ||
| 57 | * Source Maps | ||
| 58 | */ | ||
| 59 | |||
| 60 | productionSourceMap: true, | ||
| 61 | // https://webpack.js.org/configuration/devtool/#production | ||
| 62 | devtool: '#source-map', | ||
| 63 | |||
| 64 | // Gzip off by default as many popular static hosts such as | ||
| 65 | // Surge or Netlify already gzip all static assets for you. | ||
| 66 | // Before setting to `true`, make sure to: | ||
| 67 | // npm install --save-dev compression-webpack-plugin | ||
| 68 | productionGzip: false, | ||
| 69 | productionGzipExtensions: ['js', 'css'], | ||
| 70 | |||
| 71 | // Run the build command with an extra argument to | ||
| 72 | // View the bundle analyzer report after build finishes: | ||
| 73 | // `npm run build --report` | ||
| 74 | // Set to `true` or `false` to always turn it on or off | ||
| 75 | bundleAnalyzerReport: process.env.npm_config_report | ||
| 76 | } | ||
| 77 | } |
config/prod.env.js
0 → 100644
index.html
0 → 100644
| 1 | <!DOCTYPE html> | ||
| 2 | <html> | ||
| 3 | <head> | ||
| 4 | <meta charset="utf-8"> | ||
| 5 | <meta name="viewport" content="width=device-width,initial-scale=1.0"> | ||
| 6 | <title>SuperMap Mapbox GL VUE示例</title> | ||
| 7 | <script src="./static/js/mapbox-gl-enhance.js"></script> | ||
| 8 | <script src="./static//js/styles.js"></script> | ||
| 9 | <link href='./static/css/mapbox-gl.css' rel='stylesheet' /> | ||
| 10 | </head> | ||
| 11 | <body style="padding: 0px; margin: 0px;"> | ||
| 12 | <div id="app"></div> | ||
| 13 | <!-- built files will be auto injected --> | ||
| 14 | </body> | ||
| 15 | </html> |
package-lock.json
0 → 100644
This diff could not be displayed because it is too large.
package.json
0 → 100644
| 1 | { | ||
| 2 | "name": "mybox", | ||
| 3 | "version": "1.0.0", | ||
| 4 | "description": "A Vue.js project", | ||
| 5 | "author": "leone", | ||
| 6 | "private": true, | ||
| 7 | "scripts": { | ||
| 8 | "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", | ||
| 9 | "serve": "npm run dev", | ||
| 10 | "build": "node build/build.js" | ||
| 11 | }, | ||
| 12 | "dependencies": { | ||
| 13 | "@mapbox/mapbox-gl-draw": "^1.1.2", | ||
| 14 | "@supermap/iclient-mapboxgl": "^10.0.0", | ||
| 15 | "ant-design-vue": "^1.4.10", | ||
| 16 | "jquery": "^3.4.1", | ||
| 17 | "mapbox-gl": "^1.6.0", | ||
| 18 | "mapbox-gl-compare": "^0.3.0", | ||
| 19 | "vue": "^2.5.2", | ||
| 20 | "vue-router": "^3.0.1" | ||
| 21 | }, | ||
| 22 | "devDependencies": { | ||
| 23 | "autoprefixer": "^7.1.2", | ||
| 24 | "babel-core": "^6.22.1", | ||
| 25 | "babel-helper-vue-jsx-merge-props": "^2.0.3", | ||
| 26 | "babel-loader": "^7.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 | "chalk": "^2.0.1", | ||
| 33 | "copy-webpack-plugin": "^4.0.1", | ||
| 34 | "css-loader": "^0.28.0", | ||
| 35 | "extract-text-webpack-plugin": "^3.0.0", | ||
| 36 | "file-loader": "^1.1.4", | ||
| 37 | "friendly-errors-webpack-plugin": "^1.6.1", | ||
| 38 | "html-webpack-plugin": "^2.30.1", | ||
| 39 | "node-notifier": "^5.1.2", | ||
| 40 | "optimize-css-assets-webpack-plugin": "^3.2.0", | ||
| 41 | "ora": "^1.2.0", | ||
| 42 | "portfinder": "^1.0.13", | ||
| 43 | "postcss-import": "^11.0.0", | ||
| 44 | "postcss-loader": "^2.0.8", | ||
| 45 | "postcss-url": "^7.2.1", | ||
| 46 | "rimraf": "^2.6.0", | ||
| 47 | "semver": "^5.3.0", | ||
| 48 | "shelljs": "^0.7.6", | ||
| 49 | "uglifyjs-webpack-plugin": "^1.1.1", | ||
| 50 | "url-loader": "^0.5.8", | ||
| 51 | "vue-loader": "^13.3.0", | ||
| 52 | "vue-style-loader": "^3.0.1", | ||
| 53 | "vue-template-compiler": "^2.5.2", | ||
| 54 | "webpack": "^3.6.0", | ||
| 55 | "webpack-bundle-analyzer": "^2.9.0", | ||
| 56 | "webpack-dev-server": "^2.9.1", | ||
| 57 | "webpack-merge": "^4.1.0" | ||
| 58 | }, | ||
| 59 | "engines": { | ||
| 60 | "node": ">= 6.0.0", | ||
| 61 | "npm": ">= 3.0.0" | ||
| 62 | }, | ||
| 63 | "browserslist": [ | ||
| 64 | "> 1%", | ||
| 65 | "last 2 versions", | ||
| 66 | "not ie <= 8" | ||
| 67 | ] | ||
| 68 | } |
src/App.vue
0 → 100644
| 1 | <!-- | ||
| 2 | * @Author: jiangbotao | ||
| 3 | * @Date: 2019-12-12 17:40:15 | ||
| 4 | * @LastEditors: jiangbotao | ||
| 5 | * @LastEditTime: 2019-12-12 17:51:38 | ||
| 6 | * @FilePath: \mymapbox\src\App.vue | ||
| 7 | --> | ||
| 8 | <template> | ||
| 9 | <div id="app"> | ||
| 10 | <router-view/> | ||
| 11 | </div> | ||
| 12 | </template> | ||
| 13 | |||
| 14 | <script> | ||
| 15 | export default { | ||
| 16 | name: 'App' | ||
| 17 | } | ||
| 18 | </script> | ||
| 19 | |||
| 20 | <style> | ||
| 21 | #app { | ||
| 22 | |||
| 23 | } | ||
| 24 | </style> |
src/assets/logo.png
0 → 100644
6.69 KB
src/components/3d/Map_3dbuilding.vue
0 → 100644
| 1 | <!-- | ||
| 2 | * @Author: jiangbotao | ||
| 3 | * @Date: 2019-12-09 23:17:48 | ||
| 4 | * @LastEditors: jiangbotao | ||
| 5 | * @LastEditTime: 2019-12-10 17:42:21 | ||
| 6 | * @FilePath: \mymapbox\src\components\Map3857.vue | ||
| 7 | --> | ||
| 8 | <template> | ||
| 9 | <div > | ||
| 10 | <div id="map"></div> | ||
| 11 | </div> | ||
| 12 | </template> | ||
| 13 | |||
| 14 | <script> | ||
| 15 | import mapboxgl from 'mapbox-gl'; | ||
| 16 | import MapboxDraw from '@mapbox/mapbox-gl-draw'; | ||
| 17 | import { Logo } from '@supermap/iclient-mapboxgl'; | ||
| 18 | import '@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css'; | ||
| 19 | |||
| 20 | export default { | ||
| 21 | name: 'RasterTiles', | ||
| 22 | data () { | ||
| 23 | return { | ||
| 24 | |||
| 25 | } | ||
| 26 | }, | ||
| 27 | mounted(){ | ||
| 28 | var iServerUrl = "http://iclient.supermap.io/iserver/services/map-city/rest/maps/city/tileFeature.mvt?_cache=false&returnAttributes=true&compressTolerance=-1&width=512&height=512&viewBounds={bbox-epsg-3857}"; | ||
| 29 | |||
| 30 | var buildingLayer, heightField = "floor", ratio = 15, layerId = "buildings", | ||
| 31 | center = [106.540545, 29.531714]; | ||
| 32 | |||
| 33 | var map = new mapboxgl.Map({ | ||
| 34 | container: 'map', | ||
| 35 | style: mapboxgl.supermap.map.getDefaultVectorTileStyle(iServerUrl), | ||
| 36 | pitch: 60, | ||
| 37 | bearing: 290, | ||
| 38 | center: center, | ||
| 39 | zoom: 12 | ||
| 40 | }); | ||
| 41 | map.addControl(new mapboxgl.NavigationControl(), 'top-left'); | ||
| 42 | } | ||
| 43 | } | ||
| 44 | </script> | ||
| 45 | |||
| 46 | <style scoped> | ||
| 47 | #map { | ||
| 48 | position: absolute; | ||
| 49 | height: 100%; | ||
| 50 | width: 100%; | ||
| 51 | background-color: white | ||
| 52 | } | ||
| 53 | </style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
src/components/basic/Map_info.vue
0 → 100644
| 1 | <!-- | ||
| 2 | * @Author: jiangbotao | ||
| 3 | * @Date: 2019-12-09 23:17:48 | ||
| 4 | * @LastEditors: jiangbotao | ||
| 5 | * @LastEditTime: 2019-12-12 16:31:06 | ||
| 6 | * @FilePath: \mymapbox\src\components\Map3857.vue | ||
| 7 | --> | ||
| 8 | <template> | ||
| 9 | <div > | ||
| 10 | <div id="map"></div> | ||
| 11 | </div> | ||
| 12 | </template> | ||
| 13 | |||
| 14 | <script> | ||
| 15 | import mapboxgl from 'mapbox-gl'; | ||
| 16 | import { Logo, MapService } from '@supermap/iclient-mapboxgl'; | ||
| 17 | export default { | ||
| 18 | name: 'HelloWorld', | ||
| 19 | |||
| 20 | data () { | ||
| 21 | return { | ||
| 22 | |||
| 23 | } | ||
| 24 | }, | ||
| 25 | mounted(){ | ||
| 26 | var map, host = "http://support.supermap.com.cn:8090"; | ||
| 27 | var url = host + "/iserver/services/map-world/rest/maps/World"; | ||
| 28 | |||
| 29 | var map = new mapboxgl.Map({ | ||
| 30 | container: 'map', | ||
| 31 | style: { | ||
| 32 | "version": 8, | ||
| 33 | "sources": { | ||
| 34 | "raster-tiles": { | ||
| 35 | "attribution": 'attribution', | ||
| 36 | "type": "raster", | ||
| 37 | "tiles": [host + '/iserver/services/maps/rest/maps/World/zxyTileImage.png?prjCoordSys={"epsgCode":3857}&z={z}&x={x}&y={y}'], | ||
| 38 | "tileSize": 256, | ||
| 39 | }, | ||
| 40 | }, | ||
| 41 | "layers": [{ | ||
| 42 | "id": "simple-tiles", | ||
| 43 | "type": "raster", | ||
| 44 | "source": "raster-tiles", | ||
| 45 | "minzoom": 0, | ||
| 46 | "maxzoom": 22 | ||
| 47 | }] | ||
| 48 | }, | ||
| 49 | center: [-74.50, 40], | ||
| 50 | maxZoom: 18, | ||
| 51 | zoom: 2 | ||
| 52 | }); | ||
| 53 | map.addControl(new mapboxgl.NavigationControl(), 'top-left'); | ||
| 54 | |||
| 55 | map.on('load', function () { | ||
| 56 | mapService(); | ||
| 57 | }); | ||
| 58 | |||
| 59 | function mapService() { | ||
| 60 | var getMapStatusService = new SuperMap.MapService(url, { | ||
| 61 | serverType: SuperMap.ServerType.ISERVER, | ||
| 62 | eventListeners: { | ||
| 63 | processCompleted: callback | ||
| 64 | }, | ||
| 65 | }); | ||
| 66 | getMapStatusService.processAsync(); | ||
| 67 | } | ||
| 68 | |||
| 69 | function callback(serviceResult) { | ||
| 70 | var result = serviceResult.result; | ||
| 71 | var innerHTML = ''; | ||
| 72 | innerHTML += "Bounds:" + JSON.stringify(result.bounds) + "<br>"; | ||
| 73 | new mapboxgl.Popup({closeOnClick: false}) | ||
| 74 | .setLngLat([-96, 37.8]) | ||
| 75 | .setHTML(innerHTML + "</br>") | ||
| 76 | .addTo(map); | ||
| 77 | } | ||
| 78 | } | ||
| 79 | } | ||
| 80 | </script> | ||
| 81 | |||
| 82 | <style scoped> | ||
| 83 | #map { | ||
| 84 | position: absolute; | ||
| 85 | height: 100%; | ||
| 86 | width: 100%; | ||
| 87 | background-color: white | ||
| 88 | } | ||
| 89 | </style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
src/components/basic/Map_measure.vue
0 → 100644
| 1 | <!-- | ||
| 2 | * @Author: jiangbotao | ||
| 3 | * @Date: 2019-12-09 23:17:48 | ||
| 4 | * @LastEditors: jiangbotao | ||
| 5 | * @LastEditTime: 2019-12-12 18:37:31 | ||
| 6 | * @FilePath: \mymapbox\src\components\Map3857.vue | ||
| 7 | --> | ||
| 8 | <template> | ||
| 9 | <div > | ||
| 10 | <div id="map"></div> | ||
| 11 | </div> | ||
| 12 | </template> | ||
| 13 | |||
| 14 | <script> | ||
| 15 | import Vue from 'vue' | ||
| 16 | import { message } from'ant-design-vue'; | ||
| 17 | Vue.use(message) | ||
| 18 | |||
| 19 | import mapboxgl from 'mapbox-gl'; | ||
| 20 | import { Logo, MeasureService } from '@supermap/iclient-mapboxgl'; | ||
| 21 | import '@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css'; | ||
| 22 | import MapboxDraw from '@mapbox/mapbox-gl-draw'; | ||
| 23 | export default { | ||
| 24 | name: 'HelloWorld', | ||
| 25 | data () { | ||
| 26 | return { | ||
| 27 | msg: 'aaa' | ||
| 28 | } | ||
| 29 | }, | ||
| 30 | mounted(){ | ||
| 31 | var map, host = "http://support.supermap.com.cn:8090"; | ||
| 32 | var url = host + "/iserver/services/map-world/rest/maps/World"; | ||
| 33 | |||
| 34 | var map = new mapboxgl.Map({ | ||
| 35 | container: 'map', | ||
| 36 | style: { | ||
| 37 | "version": 8, | ||
| 38 | "sources": { | ||
| 39 | "raster-tiles": { | ||
| 40 | "attribution": 'attribution', | ||
| 41 | "type": "raster", | ||
| 42 | "tiles": [host + '/iserver/services/maps/rest/maps/World/zxyTileImage.png?prjCoordSys={"epsgCode":3857}&z={z}&x={x}&y={y}'], | ||
| 43 | "tileSize": 256, | ||
| 44 | }, | ||
| 45 | }, | ||
| 46 | "layers": [{ | ||
| 47 | "id": "simple-tiles", | ||
| 48 | "type": "raster", | ||
| 49 | "source": "raster-tiles", | ||
| 50 | "minzoom": 0, | ||
| 51 | "maxzoom": 22 | ||
| 52 | }] | ||
| 53 | }, | ||
| 54 | center: [110.143, 30.236], | ||
| 55 | maxZoom: 18, | ||
| 56 | zoom: 4 | ||
| 57 | }); | ||
| 58 | map.addControl(new mapboxgl.NavigationControl(), 'top-left'); | ||
| 59 | |||
| 60 | var draw = new MapboxDraw({ | ||
| 61 | displayControlsDefault: false, | ||
| 62 | controls: { | ||
| 63 | line_string: true, | ||
| 64 | polygon: true, | ||
| 65 | trash: true | ||
| 66 | } | ||
| 67 | }); | ||
| 68 | map.addControl(draw, "top-left"); | ||
| 69 | |||
| 70 | function measure(e) { | ||
| 71 | const type = e.features[0].geometry.type; | ||
| 72 | var param = new SuperMap.MeasureParameters(e.features[0]); | ||
| 73 | if(type === 'LineString'){ | ||
| 74 | new MeasureService(url).measureDistance(param, function (serviceResult) { | ||
| 75 | var distance = serviceResult.result.distance; | ||
| 76 | var unit = serviceResult.result.unit; | ||
| 77 | message.info('当前长度: '+ distance+" "+unit); | ||
| 78 | }); | ||
| 79 | }else{ | ||
| 80 | new MeasureService(url).measureArea(param, function (serviceResult) { | ||
| 81 | var area = serviceResult.result.area; | ||
| 82 | var unit = serviceResult.result.unit; | ||
| 83 | var rounded_area = Math.round(area * 100) / 100; | ||
| 84 | message.info('当前面积: '+ rounded_area+" 平方"+unit); | ||
| 85 | }); | ||
| 86 | } | ||
| 87 | } | ||
| 88 | |||
| 89 | function removeMsg() { | ||
| 90 | } | ||
| 91 | |||
| 92 | map.on('draw.create', measure); | ||
| 93 | map.on('draw.delete', removeMsg); | ||
| 94 | } | ||
| 95 | } | ||
| 96 | </script> | ||
| 97 | |||
| 98 | <style scoped> | ||
| 99 | #map { | ||
| 100 | position: absolute; | ||
| 101 | height: 100%; | ||
| 102 | width: 100%; | ||
| 103 | background-color: white | ||
| 104 | } | ||
| 105 | </style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
src/components/basic/Map_mvt.vue
0 → 100644
| 1 | <!-- | ||
| 2 | * @Author: jiangbotao | ||
| 3 | * @Date: 2019-12-09 23:17:48 | ||
| 4 | * @LastEditors: jiangbotao | ||
| 5 | * @LastEditTime: 2019-12-10 16:43:29 | ||
| 6 | * @FilePath: \mymapbox\src\components\Map3857.vue | ||
| 7 | --> | ||
| 8 | <template> | ||
| 9 | <div > | ||
| 10 | <div id="map"></div> | ||
| 11 | </div> | ||
| 12 | </template> | ||
| 13 | |||
| 14 | <script> | ||
| 15 | import mapboxgl from 'mapbox-gl'; | ||
| 16 | import MapboxDraw from '@mapbox/mapbox-gl-draw'; | ||
| 17 | import { Logo } from '@supermap/iclient-mapboxgl'; | ||
| 18 | import '@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css'; | ||
| 19 | |||
| 20 | export default { | ||
| 21 | name: 'MVT', | ||
| 22 | data () { | ||
| 23 | return { | ||
| 24 | |||
| 25 | } | ||
| 26 | }, | ||
| 27 | mounted(){ | ||
| 28 | var map = new mapboxgl.Map({ | ||
| 29 | container: 'map', | ||
| 30 | attributionControl: false, | ||
| 31 | style: 'http://support.supermap.com.cn:8090/iserver/services/map-mvt-China/rest/maps/China/tileFeature/vectorstyles.json?type=MapBox_GL&styleonly=true', | ||
| 32 | center: [110.143, 30.236], // starting position | ||
| 33 | zoom: 3 // starting zoom | ||
| 34 | }); | ||
| 35 | map.addControl(new Logo(), 'bottom-right'); | ||
| 36 | map.addControl(new mapboxgl.NavigationControl(), 'top-left'); | ||
| 37 | map.addControl(new mapboxgl.ScaleControl({})); | ||
| 38 | map.addControl(new mapboxgl.FullscreenControl(),'top-right'); | ||
| 39 | map.addControl(new mapboxgl.GeolocateControl({ | ||
| 40 | positionOptions: { | ||
| 41 | enableHighAccuracy: true | ||
| 42 | }, | ||
| 43 | trackUserLocation: true | ||
| 44 | }),'top-left'); | ||
| 45 | map.addControl(new mapboxgl.AttributionControl({compact: true})); | ||
| 46 | var Draw = new MapboxDraw(); | ||
| 47 | map.addControl(Draw,'top-left'); | ||
| 48 | } | ||
| 49 | } | ||
| 50 | </script> | ||
| 51 | |||
| 52 | <style scoped> | ||
| 53 | #map { | ||
| 54 | position: absolute; | ||
| 55 | height: 100%; | ||
| 56 | width: 100%; | ||
| 57 | background-color: white | ||
| 58 | } | ||
| 59 | </style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
src/components/basic/Map_rastertiles.vue
0 → 100644
| 1 | <!-- | ||
| 2 | * @Author: jiangbotao | ||
| 3 | * @Date: 2019-12-09 23:17:48 | ||
| 4 | * @LastEditors: jiangbotao | ||
| 5 | * @LastEditTime: 2019-12-10 17:42:07 | ||
| 6 | * @FilePath: \mymapbox\src\components\Map3857.vue | ||
| 7 | --> | ||
| 8 | <template> | ||
| 9 | <div > | ||
| 10 | <div id="map"></div> | ||
| 11 | </div> | ||
| 12 | </template> | ||
| 13 | |||
| 14 | <script> | ||
| 15 | import mapboxgl from 'mapbox-gl'; | ||
| 16 | import MapboxDraw from '@mapbox/mapbox-gl-draw'; | ||
| 17 | import { Logo } from '@supermap/iclient-mapboxgl'; | ||
| 18 | import '@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css'; | ||
| 19 | |||
| 20 | export default { | ||
| 21 | name: 'RasterTiles', | ||
| 22 | data () { | ||
| 23 | return { | ||
| 24 | |||
| 25 | } | ||
| 26 | }, | ||
| 27 | mounted(){ | ||
| 28 | var map, host = "http://support.supermap.com.cn:8090"; | ||
| 29 | var url = host + "/iserver/services/map-world/rest/maps/World"; | ||
| 30 | var map = new mapboxgl.Map({ | ||
| 31 | container: 'map', | ||
| 32 | attributionControl: false, | ||
| 33 | style: { | ||
| 34 | "version": 8, | ||
| 35 | "sources": { | ||
| 36 | "raster-tiles": { | ||
| 37 | "attribution": 'SuperMap Mapbox GL', | ||
| 38 | "type": "raster", | ||
| 39 | "tiles": [host + '/iserver/services/map-china400/rest/maps/China/zxyTileImage.png?z={z}&x={x}&y={y}'], | ||
| 40 | "tileSize": 256 | ||
| 41 | } | ||
| 42 | }, | ||
| 43 | "layers": [{ | ||
| 44 | "id": "simple-tiles", | ||
| 45 | "type": "raster", | ||
| 46 | "source": "raster-tiles", | ||
| 47 | "minzoom": 0, | ||
| 48 | "maxzoom": 22 | ||
| 49 | }] | ||
| 50 | }, | ||
| 51 | center: [110.143, 30.236], // starting position | ||
| 52 | zoom: 3 // starting zoom | ||
| 53 | }); | ||
| 54 | map.addControl(new Logo(), 'bottom-right'); | ||
| 55 | map.addControl(new mapboxgl.NavigationControl(), 'top-left'); | ||
| 56 | map.addControl(new mapboxgl.ScaleControl({})); | ||
| 57 | map.addControl(new mapboxgl.FullscreenControl(),'top-right'); | ||
| 58 | map.addControl(new mapboxgl.GeolocateControl({ | ||
| 59 | positionOptions: { | ||
| 60 | enableHighAccuracy: true | ||
| 61 | }, | ||
| 62 | trackUserLocation: true | ||
| 63 | }),'top-left'); | ||
| 64 | map.addControl(new mapboxgl.AttributionControl({compact: true})); | ||
| 65 | var Draw = new MapboxDraw(); | ||
| 66 | map.addControl(Draw,'top-left'); | ||
| 67 | } | ||
| 68 | } | ||
| 69 | </script> | ||
| 70 | |||
| 71 | <style scoped> | ||
| 72 | #map { | ||
| 73 | position: absolute; | ||
| 74 | height: 100%; | ||
| 75 | width: 100%; | ||
| 76 | background-color: white | ||
| 77 | } | ||
| 78 | </style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
src/components/basic/Map_split.vue
0 → 100644
| 1 | <!-- | ||
| 2 | * @Author: jiangbotao | ||
| 3 | * @Date: 2019-12-09 23:17:48 | ||
| 4 | * @LastEditors: jiangbotao | ||
| 5 | * @LastEditTime: 2019-12-10 16:24:38 | ||
| 6 | * @FilePath: \mymapbox\src\components\Map3857.vue | ||
| 7 | --> | ||
| 8 | <template> | ||
| 9 | <div > | ||
| 10 | <div id='before' class='map'></div> | ||
| 11 | <div id='after' class='map'></div> | ||
| 12 | </div> | ||
| 13 | </template> | ||
| 14 | |||
| 15 | <script> | ||
| 16 | import mapboxgl from 'mapbox-gl'; | ||
| 17 | import Compare from 'mapbox-gl-compare'; | ||
| 18 | import { Logo, MapService } from '@supermap/iclient-mapboxgl'; | ||
| 19 | export default { | ||
| 20 | name: 'HelloWorld', | ||
| 21 | |||
| 22 | data () { | ||
| 23 | return { | ||
| 24 | |||
| 25 | } | ||
| 26 | }, | ||
| 27 | mounted(){ | ||
| 28 | var host = "http://support.supermap.com.cn:8090", | ||
| 29 | chinaUrl = host + '/iserver/services/map-china400/rest/maps/China/zxyTileImage.png?z={z}&x={x}&y={y}', | ||
| 30 | chinaDarkUrl = host + '/iserver/services/map-china400/rest/maps/ChinaDark/zxyTileImage.png?z={z}&x={x}&y={y}', | ||
| 31 | attribution = "<a href='https://www.mapbox.com/about/maps/' target='_blank'>© Mapbox </a>" + | ||
| 32 | " with <span>© <a href='http://iclient.supermap.io' target='_blank'>SuperMap iClient</a> | </span>" + | ||
| 33 | " Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' target='_blank'>SuperMap iServer</a></span> "; | ||
| 34 | var beforeMap = new mapboxgl.Map({ | ||
| 35 | container: 'before', | ||
| 36 | style: { | ||
| 37 | "version": 8, | ||
| 38 | "sources": { | ||
| 39 | "raster-tiles": { | ||
| 40 | "attribution": attribution, | ||
| 41 | "type": "raster", | ||
| 42 | "tiles": [chinaUrl], | ||
| 43 | "tileSize": 256, | ||
| 44 | }, | ||
| 45 | }, | ||
| 46 | "layers": [{ | ||
| 47 | "id": "before", | ||
| 48 | "type": "raster", | ||
| 49 | "source": "raster-tiles", | ||
| 50 | "minzoom": 0, | ||
| 51 | "maxzoom": 22 | ||
| 52 | }], | ||
| 53 | }, | ||
| 54 | center: [0, 0], | ||
| 55 | zoom: 0 | ||
| 56 | }); | ||
| 57 | beforeMap.addControl(new mapboxgl.NavigationControl(), 'top-left'); | ||
| 58 | var afterMap = new mapboxgl.Map({ | ||
| 59 | container: 'after', | ||
| 60 | style: { | ||
| 61 | "version": 8, | ||
| 62 | "sources": { | ||
| 63 | "raster-tiles": { | ||
| 64 | "type": "raster", | ||
| 65 | "tiles": [chinaDarkUrl], | ||
| 66 | "tileSize": 256, | ||
| 67 | }, | ||
| 68 | }, | ||
| 69 | "layers": [{ | ||
| 70 | "id": "after", | ||
| 71 | "type": "raster", | ||
| 72 | "source": "raster-tiles", | ||
| 73 | "minzoom": 0, | ||
| 74 | "maxzoom": 22 | ||
| 75 | }], | ||
| 76 | }, | ||
| 77 | center: [0, 0], | ||
| 78 | zoom: 0 | ||
| 79 | }); | ||
| 80 | |||
| 81 | //mapbox 卷帘(对比)控件 | ||
| 82 | var map = new mapboxgl.Compare(beforeMap, afterMap, { | ||
| 83 | // Set this to enable comparing two maps by mouse movement: | ||
| 84 | // mousemove: true | ||
| 85 | }); | ||
| 86 | } | ||
| 87 | } | ||
| 88 | </script> | ||
| 89 | |||
| 90 | <style scoped> | ||
| 91 | .map { | ||
| 92 | position: absolute; | ||
| 93 | height: 100%; | ||
| 94 | width: 100%; | ||
| 95 | background-color: white | ||
| 96 | } | ||
| 97 | </style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | <!-- | ||
| 2 | * @Author: jiangbotao | ||
| 3 | * @Date: 2019-12-10 14:16:04 | ||
| 4 | * @LastEditors: jiangbotao | ||
| 5 | * @LastEditTime: 2019-12-10 16:53:43 | ||
| 6 | * @FilePath: \mymapbox\src\components\Map_filter_sql.vue | ||
| 7 | --> | ||
| 8 | <template> | ||
| 9 | <div > | ||
| 10 | <div id="map"></div> | ||
| 11 | </div> | ||
| 12 | </template> | ||
| 13 | |||
| 14 | <script> | ||
| 15 | import mapboxgl from 'mapbox-gl'; | ||
| 16 | import { Logo, FeatureService, QueryService } from '@supermap/iclient-mapboxgl'; | ||
| 17 | export default { | ||
| 18 | name: 'HelloWorld', | ||
| 19 | data () { | ||
| 20 | return { | ||
| 21 | |||
| 22 | } | ||
| 23 | }, | ||
| 24 | mounted(){ | ||
| 25 | var map, host = "http://support.supermap.com.cn:8090"; | ||
| 26 | var url = host + "/iserver/services/map-world/rest/maps/World"; | ||
| 27 | var dataUrl = host + "/iserver/services/data-world/rest/data"; | ||
| 28 | |||
| 29 | var map = new mapboxgl.Map({ | ||
| 30 | container: 'map', | ||
| 31 | style: { | ||
| 32 | "version": 8, | ||
| 33 | "sources": { | ||
| 34 | "raster-tiles": { | ||
| 35 | "attribution": 'attribution', | ||
| 36 | "type": "raster", | ||
| 37 | "tiles": [host + '/iserver/services/maps/rest/maps/World/zxyTileImage.png?prjCoordSys={"epsgCode":3857}&z={z}&x={x}&y={y}'], | ||
| 38 | "tileSize": 256, | ||
| 39 | }, | ||
| 40 | }, | ||
| 41 | "layers": [{ | ||
| 42 | "id": "simple-tiles", | ||
| 43 | "type": "raster", | ||
| 44 | "source": "raster-tiles", | ||
| 45 | "minzoom": 0, | ||
| 46 | "maxzoom": 22 | ||
| 47 | }], | ||
| 48 | }, | ||
| 49 | center: [110.143, 30.236], | ||
| 50 | maxZoom: 18, | ||
| 51 | zoom: 2 | ||
| 52 | }); | ||
| 53 | map.addControl(new Logo(), 'bottom-right'); | ||
| 54 | map.addControl(new mapboxgl.NavigationControl(), 'top-left'); | ||
| 55 | map.on('load', function () { | ||
| 56 | query(); | ||
| 57 | }); | ||
| 58 | |||
| 59 | function query() { | ||
| 60 | var sw = new mapboxgl.LngLat(0, 0); | ||
| 61 | var ne = new mapboxgl.LngLat(60, 30); | ||
| 62 | var lngLatBounds = new mapboxgl.LngLatBounds(sw, ne); | ||
| 63 | |||
| 64 | var boundsParam = new SuperMap.GetFeaturesByBoundsParameters({ | ||
| 65 | datasetNames: ["World:Capitals"], | ||
| 66 | bounds: lngLatBounds | ||
| 67 | }); | ||
| 68 | |||
| 69 | new FeatureService(dataUrl).getFeaturesByBounds(boundsParam, function (serviceResult) { | ||
| 70 | map.addSource("queryDatas", { | ||
| 71 | "type": "geojson", | ||
| 72 | "data": serviceResult.result.features | ||
| 73 | }); | ||
| 74 | map.addLayer({ | ||
| 75 | "id": "queryDatas", | ||
| 76 | "type": "circle", | ||
| 77 | "source": "queryDatas", | ||
| 78 | "paint": { | ||
| 79 | "circle-radius": 6, /* 圆的直径,单位像素 */ | ||
| 80 | "circle-color": "blue", /* 圆的颜色 */ | ||
| 81 | "circle-opacity": 0.5 /* 圆的颜色 */ | ||
| 82 | }, | ||
| 83 | }); | ||
| 84 | }); | ||
| 85 | } | ||
| 86 | } | ||
| 87 | } | ||
| 88 | </script> | ||
| 89 | |||
| 90 | <style scoped> | ||
| 91 | #map { | ||
| 92 | position: absolute; | ||
| 93 | height: 100%; | ||
| 94 | width: 100%; | ||
| 95 | background-color: white | ||
| 96 | } | ||
| 97 | </style> |
| 1 | <!-- | ||
| 2 | * @Author: jiangbotao | ||
| 3 | * @Date: 2019-12-10 14:16:04 | ||
| 4 | * @LastEditors: jiangbotao | ||
| 5 | * @LastEditTime: 2019-12-12 18:25:00 | ||
| 6 | * @FilePath: \mymapbox\src\components\Map_filter_sql.vue | ||
| 7 | --> | ||
| 8 | <template> | ||
| 9 | <div > | ||
| 10 | <div id="map"></div> | ||
| 11 | </div> | ||
| 12 | </template> | ||
| 13 | |||
| 14 | <script> | ||
| 15 | import mapboxgl from 'mapbox-gl'; | ||
| 16 | import { Logo, FeatureService, QueryService } from '@supermap/iclient-mapboxgl'; | ||
| 17 | export default { | ||
| 18 | name: 'HelloWorld', | ||
| 19 | data () { | ||
| 20 | return { | ||
| 21 | |||
| 22 | } | ||
| 23 | }, | ||
| 24 | mounted(){ | ||
| 25 | var map, host = "http://support.supermap.com.cn:8090"; | ||
| 26 | var url = host + "/iserver/services/map-world/rest/maps/World"; | ||
| 27 | var dataUrl = host + "/iserver/services/data-world/rest/data"; | ||
| 28 | |||
| 29 | var map = new mapboxgl.Map({ | ||
| 30 | container: 'map', | ||
| 31 | style: { | ||
| 32 | "version": 8, | ||
| 33 | "sources": { | ||
| 34 | "raster-tiles": { | ||
| 35 | "attribution": 'attribution', | ||
| 36 | "type": "raster", | ||
| 37 | "tiles": [host + '/iserver/services/maps/rest/maps/World/zxyTileImage.png?prjCoordSys={"epsgCode":3857}&z={z}&x={x}&y={y}'], | ||
| 38 | "tileSize": 256, | ||
| 39 | }, | ||
| 40 | }, | ||
| 41 | "layers": [{ | ||
| 42 | "id": "simple-tiles", | ||
| 43 | "type": "raster", | ||
| 44 | "source": "raster-tiles", | ||
| 45 | "minzoom": 0, | ||
| 46 | "maxzoom": 22 | ||
| 47 | }], | ||
| 48 | }, | ||
| 49 | center: [0, 0], | ||
| 50 | maxZoom: 18, | ||
| 51 | zoom: 2 | ||
| 52 | }); | ||
| 53 | map.addControl(new Logo(), 'bottom-right'); | ||
| 54 | map.addControl(new mapboxgl.NavigationControl(), 'top-left'); | ||
| 55 | |||
| 56 | map.on('load', function () { | ||
| 57 | var queryBufferGeometry = { | ||
| 58 | "type": "Polygon", | ||
| 59 | "coordinates": [[[-20, 20], [-20, -20], [20, -20], [20, 20], [-20, 20]]] | ||
| 60 | }; | ||
| 61 | map.addLayer({ | ||
| 62 | "id": "queryPolygon", | ||
| 63 | "type": "fill", | ||
| 64 | "source": { | ||
| 65 | "type": "geojson", | ||
| 66 | "data": { | ||
| 67 | "type": "Feature", | ||
| 68 | "geometry": queryBufferGeometry | ||
| 69 | } | ||
| 70 | }, | ||
| 71 | "paint": { | ||
| 72 | "fill-color": "rgba(0, 0, 255, 0.1)", | ||
| 73 | 'fill-outline-color': "red", | ||
| 74 | }, | ||
| 75 | }); | ||
| 76 | query(queryBufferGeometry); | ||
| 77 | }); | ||
| 78 | |||
| 79 | function query(queryBufferGeometry) { | ||
| 80 | var bufferParam = new SuperMap.GetFeaturesByBufferParameters({ | ||
| 81 | datasetNames: ["World:Capitals"], | ||
| 82 | bufferDistance: 30, // 30度 | ||
| 83 | geometry: queryBufferGeometry | ||
| 84 | }); | ||
| 85 | new mapboxgl.Popup().setText(' = 30').setLngLat([0, 0]).addTo(map); | ||
| 86 | new FeatureService(dataUrl).getFeaturesByBuffer(bufferParam, function (serviceResult) { | ||
| 87 | map.addSource("queryDatas", { | ||
| 88 | "type": "geojson", | ||
| 89 | "data": serviceResult.result.features | ||
| 90 | }); | ||
| 91 | map.addLayer({ | ||
| 92 | "id": "queryDatas", | ||
| 93 | "type": "circle", | ||
| 94 | "source": "queryDatas", | ||
| 95 | "paint": { | ||
| 96 | "circle-radius": 6, /* 圆的直径,单位像素 */ | ||
| 97 | "circle-color": "blue", /* 圆的颜色 */ | ||
| 98 | "circle-opacity": 0.5 /* 圆的颜色 */ | ||
| 99 | }, | ||
| 100 | }); | ||
| 101 | }); | ||
| 102 | } | ||
| 103 | } | ||
| 104 | } | ||
| 105 | </script> | ||
| 106 | |||
| 107 | <style scoped> | ||
| 108 | #map { | ||
| 109 | position: absolute; | ||
| 110 | height: 100%; | ||
| 111 | width: 100%; | ||
| 112 | background-color: white | ||
| 113 | } | ||
| 114 | </style> |
src/components/features/Map_feature_draw.vue
0 → 100644
| 1 | <!-- | ||
| 2 | * @Author: jiangbotao | ||
| 3 | * @Date: 2019-12-10 14:16:04 | ||
| 4 | * @LastEditors: jiangbotao | ||
| 5 | * @LastEditTime: 2019-12-10 17:03:22 | ||
| 6 | * @FilePath: \mymapbox\src\components\Map_filter_sql.vue | ||
| 7 | --> | ||
| 8 | <template> | ||
| 9 | <div > | ||
| 10 | <div id="map"></div> | ||
| 11 | </div> | ||
| 12 | </template> | ||
| 13 | |||
| 14 | <script> | ||
| 15 | import mapboxgl from 'mapbox-gl'; | ||
| 16 | import { Logo, FeatureService, QueryService } from '@supermap/iclient-mapboxgl'; | ||
| 17 | import MapboxDraw from '@mapbox/mapbox-gl-draw'; | ||
| 18 | import '@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css'; | ||
| 19 | |||
| 20 | export default { | ||
| 21 | name: 'HelloWorld', | ||
| 22 | data () { | ||
| 23 | return { | ||
| 24 | |||
| 25 | } | ||
| 26 | }, | ||
| 27 | mounted(){ | ||
| 28 | var map, host = "http://support.supermap.com.cn:8090"; | ||
| 29 | var url = host + "/iserver/services/map-world/rest/maps/World"; | ||
| 30 | var dataUrl = host + "/iserver/services/data-world/rest/data"; | ||
| 31 | |||
| 32 | var map = new mapboxgl.Map({ | ||
| 33 | container: 'map', | ||
| 34 | style: { | ||
| 35 | "version": 8, | ||
| 36 | "sources": { | ||
| 37 | "raster-tiles": { | ||
| 38 | "attribution": 'attribution', | ||
| 39 | "type": "raster", | ||
| 40 | "tiles": [host + '/iserver/services/maps/rest/maps/World/zxyTileImage.png?prjCoordSys={"epsgCode":3857}&z={z}&x={x}&y={y}'], | ||
| 41 | "tileSize": 256, | ||
| 42 | }, | ||
| 43 | }, | ||
| 44 | "layers": [{ | ||
| 45 | "id": "simple-tiles", | ||
| 46 | "type": "raster", | ||
| 47 | "source": "raster-tiles", | ||
| 48 | "minzoom": 0, | ||
| 49 | "maxzoom": 22 | ||
| 50 | }], | ||
| 51 | }, | ||
| 52 | center: [0, 0], | ||
| 53 | maxZoom: 18, | ||
| 54 | zoom: 2 | ||
| 55 | }); | ||
| 56 | map.addControl(new Logo(), 'bottom-right'); | ||
| 57 | map.addControl(new mapboxgl.NavigationControl(), 'top-left'); | ||
| 58 | var draw = new MapboxDraw({ | ||
| 59 | displayControlsDefault: false, | ||
| 60 | controls: { | ||
| 61 | polygon: true, | ||
| 62 | trash: true | ||
| 63 | } | ||
| 64 | }); | ||
| 65 | map.addControl(draw, "top-left"); | ||
| 66 | function measure(e) { | ||
| 67 | console.log(e.features[0].geometry); | ||
| 68 | query(e.features[0].geometry); | ||
| 69 | } | ||
| 70 | |||
| 71 | function removeMsg() { | ||
| 72 | } | ||
| 73 | |||
| 74 | map.on('draw.create', measure); | ||
| 75 | map.on('draw.delete', removeMsg); | ||
| 76 | |||
| 77 | function query(queryPolygonGeometry) { | ||
| 78 | var geometryParam = new SuperMap.GetFeaturesByGeometryParameters({ | ||
| 79 | datasetNames: ["World:Countries"], | ||
| 80 | geometry: queryPolygonGeometry, | ||
| 81 | spatialQueryMode: "INTERSECT" | ||
| 82 | }); | ||
| 83 | new FeatureService(dataUrl).getFeaturesByGeometry(geometryParam, function (serviceResult) { | ||
| 84 | map.addSource("queryDatas", { | ||
| 85 | "type": "geojson", | ||
| 86 | "data": serviceResult.result.features | ||
| 87 | }); | ||
| 88 | map.addLayer({ | ||
| 89 | "id": "queryDatas", | ||
| 90 | "type": "fill", | ||
| 91 | "source": "queryDatas", | ||
| 92 | "paint": { | ||
| 93 | "fill-color": "#FF3300", /* 填充的颜色 */ | ||
| 94 | "fill-opacity": 0.6 /* 透明度 */ | ||
| 95 | }, | ||
| 96 | }); | ||
| 97 | }); | ||
| 98 | } | ||
| 99 | } | ||
| 100 | } | ||
| 101 | </script> | ||
| 102 | |||
| 103 | <style scoped> | ||
| 104 | #map { | ||
| 105 | position: absolute; | ||
| 106 | height: 100%; | ||
| 107 | width: 100%; | ||
| 108 | background-color: white | ||
| 109 | } | ||
| 110 | </style> |
src/components/features/Map_feature_geo.vue
0 → 100644
| 1 | <!-- | ||
| 2 | * @Author: jiangbotao | ||
| 3 | * @Date: 2019-12-10 14:16:04 | ||
| 4 | * @LastEditors: jiangbotao | ||
| 5 | * @LastEditTime: 2019-12-10 17:01:03 | ||
| 6 | * @FilePath: \mymapbox\src\components\Map_filter_sql.vue | ||
| 7 | --> | ||
| 8 | <template> | ||
| 9 | <div > | ||
| 10 | <div id="map"></div> | ||
| 11 | </div> | ||
| 12 | </template> | ||
| 13 | |||
| 14 | <script> | ||
| 15 | import mapboxgl from 'mapbox-gl'; | ||
| 16 | import { Logo, FeatureService, QueryService } from '@supermap/iclient-mapboxgl'; | ||
| 17 | export default { | ||
| 18 | name: 'HelloWorld', | ||
| 19 | data () { | ||
| 20 | return { | ||
| 21 | |||
| 22 | } | ||
| 23 | }, | ||
| 24 | mounted(){ | ||
| 25 | var map, host = "http://support.supermap.com.cn:8090"; | ||
| 26 | var url = host + "/iserver/services/map-world/rest/maps/World"; | ||
| 27 | var dataUrl = host + "/iserver/services/data-world/rest/data"; | ||
| 28 | |||
| 29 | var map = new mapboxgl.Map({ | ||
| 30 | container: 'map', | ||
| 31 | style: { | ||
| 32 | "version": 8, | ||
| 33 | "sources": { | ||
| 34 | "raster-tiles": { | ||
| 35 | "attribution": 'attribution', | ||
| 36 | "type": "raster", | ||
| 37 | "tiles": [host + '/iserver/services/maps/rest/maps/World/zxyTileImage.png?prjCoordSys={"epsgCode":3857}&z={z}&x={x}&y={y}'], | ||
| 38 | "tileSize": 256, | ||
| 39 | }, | ||
| 40 | }, | ||
| 41 | "layers": [{ | ||
| 42 | "id": "simple-tiles", | ||
| 43 | "type": "raster", | ||
| 44 | "source": "raster-tiles", | ||
| 45 | "minzoom": 0, | ||
| 46 | "maxzoom": 22 | ||
| 47 | }], | ||
| 48 | }, | ||
| 49 | center: [0, 0], | ||
| 50 | maxZoom: 18, | ||
| 51 | zoom: 2 | ||
| 52 | }); | ||
| 53 | map.addControl(new Logo(), 'bottom-right'); | ||
| 54 | map.addControl(new mapboxgl.NavigationControl(), 'top-left'); | ||
| 55 | |||
| 56 | map.on('load', function () { | ||
| 57 | var queryPolygonGeometry = { | ||
| 58 | "type": "Polygon", | ||
| 59 | "coordinates": [[[0, 0], [-10, 30], [-30, 0], [0, 0]]] | ||
| 60 | }; | ||
| 61 | map.addLayer({ | ||
| 62 | "id": "queryPolygon", | ||
| 63 | "type": "fill", | ||
| 64 | "source": { | ||
| 65 | "type": "geojson", | ||
| 66 | "data": { | ||
| 67 | "type": "Feature", | ||
| 68 | "geometry": queryPolygonGeometry | ||
| 69 | } | ||
| 70 | }, | ||
| 71 | "paint": { | ||
| 72 | "fill-color": "rgba(0, 0, 255, 0.1)", | ||
| 73 | "fill-outline-color": "red", | ||
| 74 | }, | ||
| 75 | }); | ||
| 76 | query(queryPolygonGeometry); | ||
| 77 | }); | ||
| 78 | |||
| 79 | function query(queryPolygonGeometry) { | ||
| 80 | var geometryParam = new SuperMap.GetFeaturesByGeometryParameters({ | ||
| 81 | datasetNames: ["World:Countries"], | ||
| 82 | geometry: queryPolygonGeometry, | ||
| 83 | spatialQueryMode: "INTERSECT" | ||
| 84 | }); | ||
| 85 | new FeatureService(dataUrl).getFeaturesByGeometry(geometryParam, function (serviceResult) { | ||
| 86 | map.addSource("queryDatas", { | ||
| 87 | "type": "geojson", | ||
| 88 | "data": serviceResult.result.features | ||
| 89 | }); | ||
| 90 | map.addLayer({ | ||
| 91 | "id": "queryDatas", | ||
| 92 | "type": "fill", | ||
| 93 | "source": "queryDatas", | ||
| 94 | "paint": { | ||
| 95 | "fill-color": "#FF3300", /* 填充的颜色 */ | ||
| 96 | "fill-opacity": 0.6 /* 透明度 */ | ||
| 97 | }, | ||
| 98 | }); | ||
| 99 | }); | ||
| 100 | } | ||
| 101 | } | ||
| 102 | } | ||
| 103 | </script> | ||
| 104 | |||
| 105 | <style scoped> | ||
| 106 | #map { | ||
| 107 | position: absolute; | ||
| 108 | height: 100%; | ||
| 109 | width: 100%; | ||
| 110 | background-color: white | ||
| 111 | } | ||
| 112 | </style> |
src/components/features/Map_feature_id.vue
0 → 100644
| 1 | <!-- | ||
| 2 | * @Author: jiangbotao | ||
| 3 | * @Date: 2019-12-10 14:16:04 | ||
| 4 | * @LastEditors: jiangbotao | ||
| 5 | * @LastEditTime: 2019-12-10 16:59:00 | ||
| 6 | * @FilePath: \mymapbox\src\components\Map_filter_sql.vue | ||
| 7 | --> | ||
| 8 | <template> | ||
| 9 | <div > | ||
| 10 | <div id="map"></div> | ||
| 11 | </div> | ||
| 12 | </template> | ||
| 13 | |||
| 14 | <script> | ||
| 15 | import mapboxgl from 'mapbox-gl'; | ||
| 16 | import { Logo, FeatureService, QueryService } from '@supermap/iclient-mapboxgl'; | ||
| 17 | export default { | ||
| 18 | name: 'HelloWorld', | ||
| 19 | data () { | ||
| 20 | return { | ||
| 21 | |||
| 22 | } | ||
| 23 | }, | ||
| 24 | mounted(){ | ||
| 25 | var map, host = "http://support.supermap.com.cn:8090"; | ||
| 26 | var url = host + "/iserver/services/map-world/rest/maps/World"; | ||
| 27 | var dataUrl = host + "/iserver/services/data-world/rest/data"; | ||
| 28 | |||
| 29 | var map = new mapboxgl.Map({ | ||
| 30 | container: 'map', | ||
| 31 | style: { | ||
| 32 | "version": 8, | ||
| 33 | "sources": { | ||
| 34 | "raster-tiles": { | ||
| 35 | "attribution": 'attribution', | ||
| 36 | "type": "raster", | ||
| 37 | "tiles": [host + '/iserver/services/maps/rest/maps/World/zxyTileImage.png?prjCoordSys={"epsgCode":3857}&z={z}&x={x}&y={y}'], | ||
| 38 | "tileSize": 256, | ||
| 39 | }, | ||
| 40 | }, | ||
| 41 | "layers": [{ | ||
| 42 | "id": "simple-tiles", | ||
| 43 | "type": "raster", | ||
| 44 | "source": "raster-tiles", | ||
| 45 | "minzoom": 0, | ||
| 46 | "maxzoom": 22 | ||
| 47 | }], | ||
| 48 | }, | ||
| 49 | center: [110.143, 30.236], | ||
| 50 | maxZoom: 18, | ||
| 51 | zoom: 2 | ||
| 52 | }); | ||
| 53 | map.addControl(new Logo(), 'bottom-right'); | ||
| 54 | map.addControl(new mapboxgl.NavigationControl(), 'top-left'); | ||
| 55 | map.on('load', function () { | ||
| 56 | query(); | ||
| 57 | }); | ||
| 58 | |||
| 59 | function query() { | ||
| 60 | // 在数据集 “World:Countries” 中查询 ID 为 247 的地理空间要素 | ||
| 61 | var idsParam = new SuperMap.GetFeaturesByIDsParameters({ | ||
| 62 | IDs: [247], | ||
| 63 | datasetNames: ["World:Countries"] | ||
| 64 | }); | ||
| 65 | |||
| 66 | var service = new FeatureService(dataUrl); | ||
| 67 | service.getFeaturesByIDs(idsParam, function (serviceResult) { | ||
| 68 | map.addSource("queryDatas", { | ||
| 69 | "type": "geojson", | ||
| 70 | "data": serviceResult.result.features | ||
| 71 | }); | ||
| 72 | map.addLayer({ | ||
| 73 | "id": "queryDatas", | ||
| 74 | "type": "fill", | ||
| 75 | "source": "queryDatas", | ||
| 76 | "paint": { | ||
| 77 | "fill-color": "#FF3300", /* 填充的颜色 */ | ||
| 78 | "fill-opacity": 0.4 /* 透明度 */ | ||
| 79 | }, | ||
| 80 | "filter": ["==", "$type", "Polygon"] | ||
| 81 | }); | ||
| 82 | map.on('click', 'queryDatas', function (e) { | ||
| 83 | new mapboxgl.Popup() | ||
| 84 | .setLngLat(e.lngLat) | ||
| 85 | .setHTML(e.features[0].properties.SMID + ":" + e.features[0].properties.COUNTRY) | ||
| 86 | .addTo(map); | ||
| 87 | }); | ||
| 88 | }); | ||
| 89 | } | ||
| 90 | } | ||
| 91 | } | ||
| 92 | </script> | ||
| 93 | |||
| 94 | <style scoped> | ||
| 95 | #map { | ||
| 96 | position: absolute; | ||
| 97 | height: 100%; | ||
| 98 | width: 100%; | ||
| 99 | background-color: white | ||
| 100 | } | ||
| 101 | </style> |
src/components/features/Map_feature_sql.vue
0 → 100644
| 1 | <!-- | ||
| 2 | * @Author: jiangbotao | ||
| 3 | * @Date: 2019-12-10 14:16:04 | ||
| 4 | * @LastEditors: jiangbotao | ||
| 5 | * @LastEditTime: 2019-12-10 14:56:09 | ||
| 6 | * @FilePath: \mymapbox\src\components\Map_filter_sql.vue | ||
| 7 | --> | ||
| 8 | <template> | ||
| 9 | <div > | ||
| 10 | <div id="map"></div> | ||
| 11 | </div> | ||
| 12 | </template> | ||
| 13 | |||
| 14 | <script> | ||
| 15 | import mapboxgl from 'mapbox-gl'; | ||
| 16 | import { Logo, FeatureService, QueryService } from '@supermap/iclient-mapboxgl'; | ||
| 17 | export default { | ||
| 18 | name: 'HelloWorld', | ||
| 19 | data () { | ||
| 20 | return { | ||
| 21 | |||
| 22 | } | ||
| 23 | }, | ||
| 24 | mounted(){ | ||
| 25 | var map, host = "http://support.supermap.com.cn:8090"; | ||
| 26 | var url = host + "/iserver/services/map-world/rest/maps/World"; | ||
| 27 | var dataUrl = host + "/iserver/services/data-world/rest/data"; | ||
| 28 | |||
| 29 | var map = new mapboxgl.Map({ | ||
| 30 | container: 'map', | ||
| 31 | style: { | ||
| 32 | "version": 8, | ||
| 33 | "sources": { | ||
| 34 | "raster-tiles": { | ||
| 35 | "attribution": 'attribution', | ||
| 36 | "type": "raster", | ||
| 37 | "tiles": [host + '/iserver/services/maps/rest/maps/World/zxyTileImage.png?prjCoordSys={"epsgCode":3857}&z={z}&x={x}&y={y}'], | ||
| 38 | "tileSize": 256, | ||
| 39 | }, | ||
| 40 | }, | ||
| 41 | "layers": [{ | ||
| 42 | "id": "simple-tiles", | ||
| 43 | "type": "raster", | ||
| 44 | "source": "raster-tiles", | ||
| 45 | "minzoom": 0, | ||
| 46 | "maxzoom": 22 | ||
| 47 | }], | ||
| 48 | }, | ||
| 49 | center: [110.143, 30.236], | ||
| 50 | maxZoom: 18, | ||
| 51 | zoom: 2 | ||
| 52 | }); | ||
| 53 | map.addControl(new Logo(), 'bottom-right'); | ||
| 54 | map.addControl(new mapboxgl.NavigationControl(), 'top-left'); | ||
| 55 | |||
| 56 | map.on('load', function () { | ||
| 57 | query(); | ||
| 58 | }); | ||
| 59 | |||
| 60 | function query() { | ||
| 61 | // 指定 SQL 查询即在指定数据集集合中查找符合 SQL 条件的矢量要素 | ||
| 62 | // 并在客户端中展示出来 | ||
| 63 | var sqlParam = new SuperMap.GetFeaturesBySQLParameters({ | ||
| 64 | queryParameter: { | ||
| 65 | name: "Countries@World", | ||
| 66 | attributeFilter: "SMID = 247" | ||
| 67 | }, | ||
| 68 | datasetNames: ["World:Countries"] | ||
| 69 | }); | ||
| 70 | |||
| 71 | new FeatureService(dataUrl).getFeaturesBySQL(sqlParam, function (serviceResult) { | ||
| 72 | map.addSource("queryDatas", { | ||
| 73 | "type": "geojson", | ||
| 74 | "data": serviceResult.result.features | ||
| 75 | }); | ||
| 76 | map.addLayer({ | ||
| 77 | "id": "queryDatas", | ||
| 78 | "type": "fill", /* fill类型一般用来表示一个面,一般较大 */ | ||
| 79 | "source": "queryDatas", | ||
| 80 | "paint": { | ||
| 81 | "fill-color": "#FF3300", /* 填充的颜色 */ | ||
| 82 | "fill-opacity": 0.6 /* 透明度 */ | ||
| 83 | }, | ||
| 84 | }); | ||
| 85 | map.on('click', 'queryDatas', function (e) { | ||
| 86 | new mapboxgl.Popup() | ||
| 87 | .setLngLat(e.lngLat) | ||
| 88 | .setHTML(e.features[0].properties.SMID + ":" + e.features[0].properties.COUNTRY) | ||
| 89 | .addTo(map); | ||
| 90 | }); | ||
| 91 | }); | ||
| 92 | } | ||
| 93 | } | ||
| 94 | } | ||
| 95 | </script> | ||
| 96 | |||
| 97 | <style scoped> | ||
| 98 | #map { | ||
| 99 | position: absolute; | ||
| 100 | height: 100%; | ||
| 101 | width: 100%; | ||
| 102 | background-color: white | ||
| 103 | } | ||
| 104 | </style> |
src/components/query/Map_query_Bounds.vue
0 → 100644
| 1 | <template> | ||
| 2 | <div > | ||
| 3 | <div id="map"></div> | ||
| 4 | </div> | ||
| 5 | </template> | ||
| 6 | |||
| 7 | <script> | ||
| 8 | import mapboxgl from 'mapbox-gl'; | ||
| 9 | import { Logo, QueryByBoundsParameters, QueryService } from '@supermap/iclient-mapboxgl'; | ||
| 10 | export default { | ||
| 11 | name: 'HelloWorld', | ||
| 12 | |||
| 13 | data () { | ||
| 14 | return { | ||
| 15 | |||
| 16 | } | ||
| 17 | }, | ||
| 18 | mounted(){ | ||
| 19 | var map, host = "http://support.supermap.com.cn:8090"; | ||
| 20 | var url = host + "/iserver/services/map-world/rest/maps/World"; | ||
| 21 | |||
| 22 | var map = new mapboxgl.Map({ | ||
| 23 | container: 'map', | ||
| 24 | style: { | ||
| 25 | "version": 8, | ||
| 26 | "sources": { | ||
| 27 | "raster-tiles": { | ||
| 28 | "attribution": 'attribution', | ||
| 29 | "type": "raster", | ||
| 30 | "tiles": [host + '/iserver/services/maps/rest/maps/World/zxyTileImage.png?prjCoordSys={"epsgCode":3857}&z={z}&x={x}&y={y}'], | ||
| 31 | "tileSize": 256, | ||
| 32 | }, | ||
| 33 | }, | ||
| 34 | "layers": [{ | ||
| 35 | "id": "simple-tiles", | ||
| 36 | "type": "raster", | ||
| 37 | "source": "raster-tiles", | ||
| 38 | "minzoom": 0, | ||
| 39 | "maxzoom": 22 | ||
| 40 | }], | ||
| 41 | }, | ||
| 42 | center: [0, 0], | ||
| 43 | maxZoom: 18, | ||
| 44 | zoom: 2 | ||
| 45 | }); | ||
| 46 | map.addControl(new Logo(), 'bottom-right'); | ||
| 47 | map.addControl(new mapboxgl.NavigationControl(), 'top-left'); | ||
| 48 | |||
| 49 | map.on('load', function () { | ||
| 50 | query(); | ||
| 51 | }); | ||
| 52 | |||
| 53 | function query() { | ||
| 54 | map.addLayer({ | ||
| 55 | 'id': 'polygonLayer', | ||
| 56 | 'type': 'fill', | ||
| 57 | 'source': { | ||
| 58 | 'type': 'geojson', | ||
| 59 | 'data': { | ||
| 60 | 'type': 'Feature', | ||
| 61 | 'geometry': { | ||
| 62 | 'type': 'Polygon', | ||
| 63 | 'coordinates': [[[0, 0], [60, 0], [60, 39], [0, 39], [0, 0]]], | ||
| 64 | } | ||
| 65 | } | ||
| 66 | }, | ||
| 67 | 'paint': { | ||
| 68 | 'fill-outline-color': 'blue', | ||
| 69 | 'fill-color': 'rgba(0, 0, 255, 0.1)' | ||
| 70 | |||
| 71 | } | ||
| 72 | }); | ||
| 73 | |||
| 74 | var param = new QueryByBoundsParameters({ | ||
| 75 | queryParams: {name: "Capitals@World.1"}, | ||
| 76 | bounds: SuperMap.Bounds.fromArray([0, 0, 60, 39]) | ||
| 77 | }); | ||
| 78 | |||
| 79 | new mapboxgl.supermap.QueryService(url).queryByBounds(param, function (serviceResult) { | ||
| 80 | var recordsets = serviceResult && serviceResult.result && serviceResult.result.recordsets; | ||
| 81 | var features = recordsets && recordsets[0] && recordsets[0].features; | ||
| 82 | map.addLayer({ | ||
| 83 | "id": "points", | ||
| 84 | "type": "circle", | ||
| 85 | "paint": { | ||
| 86 | "circle-radius": 6, | ||
| 87 | "circle-color": "#ff0000", | ||
| 88 | "circle-opacity": 0.4, | ||
| 89 | "circle-stroke-width": 2, | ||
| 90 | "circle-stroke-color": "#007cbf", | ||
| 91 | "circle-stroke-opacity": 0.5 | ||
| 92 | }, | ||
| 93 | "source": { | ||
| 94 | "type": "geojson", | ||
| 95 | "data": features | ||
| 96 | } | ||
| 97 | }); | ||
| 98 | |||
| 99 | }); | ||
| 100 | } | ||
| 101 | } | ||
| 102 | } | ||
| 103 | </script> | ||
| 104 | |||
| 105 | <style scoped> | ||
| 106 | #map { | ||
| 107 | position: absolute; | ||
| 108 | height: 100%; | ||
| 109 | width: 100%; | ||
| 110 | background-color: white | ||
| 111 | } | ||
| 112 | </style> |
src/components/query/Map_query_distance.vue
0 → 100644
| 1 | <template> | ||
| 2 | <div > | ||
| 3 | <div id="map"></div> | ||
| 4 | </div> | ||
| 5 | </template> | ||
| 6 | |||
| 7 | <script> | ||
| 8 | import mapboxgl from 'mapbox-gl'; | ||
| 9 | import { Logo, QueryByBoundsParameters, QueryService } from '@supermap/iclient-mapboxgl'; | ||
| 10 | export default { | ||
| 11 | name: 'HelloWorld', | ||
| 12 | data () { | ||
| 13 | return { | ||
| 14 | |||
| 15 | } | ||
| 16 | }, | ||
| 17 | mounted(){ | ||
| 18 | var map, host = "http://support.supermap.com.cn:8090"; | ||
| 19 | var url = host + "/iserver/services/map-world/rest/maps/World"; | ||
| 20 | |||
| 21 | var map = new mapboxgl.Map({ | ||
| 22 | container: 'map', | ||
| 23 | style: { | ||
| 24 | "version": 8, | ||
| 25 | "sources": { | ||
| 26 | "raster-tiles": { | ||
| 27 | "attribution": 'attribution', | ||
| 28 | "type": "raster", | ||
| 29 | "tiles": [host + '/iserver/services/maps/rest/maps/World/zxyTileImage.png?prjCoordSys={"epsgCode":3857}&z={z}&x={x}&y={y}'], | ||
| 30 | "tileSize": 256, | ||
| 31 | }, | ||
| 32 | }, | ||
| 33 | "layers": [{ | ||
| 34 | "id": "simple-tiles", | ||
| 35 | "type": "raster", | ||
| 36 | "source": "raster-tiles", | ||
| 37 | "minzoom": 0, | ||
| 38 | "maxzoom": 22 | ||
| 39 | }], | ||
| 40 | }, | ||
| 41 | center: [121, 3], | ||
| 42 | maxZoom: 18, | ||
| 43 | zoom: 2 | ||
| 44 | }); | ||
| 45 | map.addControl(new Logo(), 'bottom-right'); | ||
| 46 | map.addControl(new mapboxgl.NavigationControl(), 'top-left'); | ||
| 47 | |||
| 48 | map.on('load', function () { | ||
| 49 | query(); | ||
| 50 | }); | ||
| 51 | |||
| 52 | var decodeMarkers = []; | ||
| 53 | function query() { | ||
| 54 | //添加查询中心点 | ||
| 55 | var img = new Image(); | ||
| 56 | img.src = './static/image/markerbig_select.png'; | ||
| 57 | var marker = new mapboxgl.Marker(img).setLngLat([121, 30]); | ||
| 58 | decodeMarkers.push(marker); | ||
| 59 | |||
| 60 | var point = new SuperMap.Geometry.Point(104, 30); | ||
| 61 | var param = new SuperMap.QueryByDistanceParameters({ | ||
| 62 | queryParams: {name: "Capitals@World.1"}, | ||
| 63 | distance: 10, // 100度的距离 | ||
| 64 | geometry: point | ||
| 65 | }); | ||
| 66 | |||
| 67 | var queryService = new QueryService(url); | ||
| 68 | queryService.queryByDistance(param, callback); | ||
| 69 | } | ||
| 70 | |||
| 71 | map.on('load', function () { | ||
| 72 | query(); | ||
| 73 | }); | ||
| 74 | |||
| 75 | function callback(serviceResult) { | ||
| 76 | var recordsets = serviceResult && serviceResult.result && serviceResult.result.recordsets; | ||
| 77 | var features = recordsets && recordsets[0] && recordsets[0].features; | ||
| 78 | console.log(features); | ||
| 79 | decodeMarkers[0].addTo(map); | ||
| 80 | map.addLayer({ | ||
| 81 | "id": "results", | ||
| 82 | "type": "circle", | ||
| 83 | "paint": { | ||
| 84 | "circle-radius": 6, | ||
| 85 | "circle-color": "#007cbf", | ||
| 86 | "circle-opacity": 0.1, | ||
| 87 | "circle-stroke-width": 2, | ||
| 88 | "circle-stroke-color": "#007cbf", | ||
| 89 | "circle-stroke-opacity": 0.5 | ||
| 90 | }, | ||
| 91 | "source": { | ||
| 92 | "type": "geojson", | ||
| 93 | "data": features | ||
| 94 | } | ||
| 95 | }); | ||
| 96 | } | ||
| 97 | } | ||
| 98 | } | ||
| 99 | </script> | ||
| 100 | |||
| 101 | <style scoped> | ||
| 102 | #map { | ||
| 103 | position: absolute; | ||
| 104 | height: 100%; | ||
| 105 | width: 100%; | ||
| 106 | background-color: white | ||
| 107 | } | ||
| 108 | </style> |
src/components/query/Map_query_geo.vue
0 → 100644
| 1 | <template> | ||
| 2 | <div > | ||
| 3 | <div id="map"></div> | ||
| 4 | </div> | ||
| 5 | </template> | ||
| 6 | |||
| 7 | <script> | ||
| 8 | import mapboxgl from 'mapbox-gl'; | ||
| 9 | import { Logo, QueryByBoundsParameters, QueryService } from '@supermap/iclient-mapboxgl'; | ||
| 10 | export default { | ||
| 11 | name: 'HelloWorld', | ||
| 12 | data () { | ||
| 13 | return { | ||
| 14 | |||
| 15 | } | ||
| 16 | }, | ||
| 17 | mounted(){ | ||
| 18 | var map, host = "http://support.supermap.com.cn:8090"; | ||
| 19 | var url = host + "/iserver/services/map-world/rest/maps/World"; | ||
| 20 | |||
| 21 | var map = new mapboxgl.Map({ | ||
| 22 | container: 'map', | ||
| 23 | style: { | ||
| 24 | "version": 8, | ||
| 25 | "sources": { | ||
| 26 | "raster-tiles": { | ||
| 27 | "attribution": 'attribution', | ||
| 28 | "type": "raster", | ||
| 29 | "tiles": [host + '/iserver/services/maps/rest/maps/World/zxyTileImage.png?prjCoordSys={"epsgCode":3857}&z={z}&x={x}&y={y}'], | ||
| 30 | "tileSize": 256, | ||
| 31 | }, | ||
| 32 | }, | ||
| 33 | "layers": [{ | ||
| 34 | "id": "simple-tiles", | ||
| 35 | "type": "raster", | ||
| 36 | "source": "raster-tiles", | ||
| 37 | "minzoom": 0, | ||
| 38 | "maxzoom": 22 | ||
| 39 | }], | ||
| 40 | }, | ||
| 41 | center: [0, 0], | ||
| 42 | maxZoom: 18, | ||
| 43 | zoom: 2 | ||
| 44 | }); | ||
| 45 | map.addControl(new Logo(), 'bottom-right'); | ||
| 46 | map.addControl(new mapboxgl.NavigationControl(), 'top-left'); | ||
| 47 | |||
| 48 | map.on('load', function () { | ||
| 49 | query(); | ||
| 50 | }); | ||
| 51 | |||
| 52 | function query() { | ||
| 53 | var geo = { | ||
| 54 | 'type': 'Feature', | ||
| 55 | 'geometry': { | ||
| 56 | 'type': 'Polygon', | ||
| 57 | 'coordinates': [[[0, 0], [-30, 0], [-10, 30], [0, 0]]], | ||
| 58 | } | ||
| 59 | }; | ||
| 60 | map.addLayer({ | ||
| 61 | 'id': 'polygonLayer', | ||
| 62 | 'type': 'fill', | ||
| 63 | 'source': { | ||
| 64 | 'type': 'geojson', | ||
| 65 | 'data': geo | ||
| 66 | }, | ||
| 67 | 'paint': { | ||
| 68 | 'fill-outline-color': 'red', | ||
| 69 | 'fill-color': 'rgba(0, 0, 255, 0.1)' | ||
| 70 | } | ||
| 71 | }); | ||
| 72 | |||
| 73 | var param = new SuperMap.QueryByGeometryParameters({ | ||
| 74 | queryParams: {name: "Capitals@World.1"}, | ||
| 75 | geometry: geo | ||
| 76 | }); | ||
| 77 | |||
| 78 | var queryService = new QueryService(url).queryByGeometry(param, function (serviceResult) { | ||
| 79 | var recordsets = serviceResult && serviceResult.result && serviceResult.result.recordsets; | ||
| 80 | var features = recordsets && recordsets[0] && recordsets[0].features; | ||
| 81 | map.addLayer({ | ||
| 82 | "id": "points", | ||
| 83 | "type": "circle", | ||
| 84 | "paint": { | ||
| 85 | "circle-radius": 6, | ||
| 86 | "circle-color": "#FF0000", | ||
| 87 | "circle-opacity": 0.5, | ||
| 88 | "circle-stroke-width": 2, | ||
| 89 | "circle-stroke-color": "#007cbf", | ||
| 90 | "circle-stroke-opacity": 0.5 | ||
| 91 | }, | ||
| 92 | "source": { | ||
| 93 | "type": "geojson", | ||
| 94 | "data": features | ||
| 95 | } | ||
| 96 | }); | ||
| 97 | }); | ||
| 98 | } | ||
| 99 | } | ||
| 100 | } | ||
| 101 | </script> | ||
| 102 | |||
| 103 | <style scoped> | ||
| 104 | #map { | ||
| 105 | position: absolute; | ||
| 106 | height: 100%; | ||
| 107 | width: 100%; | ||
| 108 | background-color: white | ||
| 109 | } | ||
| 110 | </style> |
src/components/query/Map_query_sql.vue
0 → 100644
| 1 | <!-- | ||
| 2 | * @Author: jiangbotao | ||
| 3 | * @Date: 2019-12-10 14:16:04 | ||
| 4 | * @LastEditors: jiangbotao | ||
| 5 | * @LastEditTime: 2019-12-10 14:29:45 | ||
| 6 | * @FilePath: \mymapbox\src\components\Map_filter_sql.vue | ||
| 7 | --> | ||
| 8 | <template> | ||
| 9 | <div > | ||
| 10 | <div id="map"></div> | ||
| 11 | </div> | ||
| 12 | </template> | ||
| 13 | |||
| 14 | <script> | ||
| 15 | import mapboxgl from 'mapbox-gl'; | ||
| 16 | import { Logo, QueryByBoundsParameters, QueryService } from '@supermap/iclient-mapboxgl'; | ||
| 17 | export default { | ||
| 18 | name: 'HelloWorld', | ||
| 19 | data () { | ||
| 20 | return { | ||
| 21 | |||
| 22 | } | ||
| 23 | }, | ||
| 24 | mounted(){ | ||
| 25 | var map, host = "http://support.supermap.com.cn:8090"; | ||
| 26 | var url = host + "/iserver/services/map-world/rest/maps/World"; | ||
| 27 | |||
| 28 | var map = new mapboxgl.Map({ | ||
| 29 | container: 'map', | ||
| 30 | style: { | ||
| 31 | "version": 8, | ||
| 32 | "sources": { | ||
| 33 | "raster-tiles": { | ||
| 34 | "attribution": 'attribution', | ||
| 35 | "type": "raster", | ||
| 36 | "tiles": [host + '/iserver/services/maps/rest/maps/World/zxyTileImage.png?prjCoordSys={"epsgCode":3857}&z={z}&x={x}&y={y}'], | ||
| 37 | "tileSize": 256, | ||
| 38 | }, | ||
| 39 | }, | ||
| 40 | "layers": [{ | ||
| 41 | "id": "simple-tiles", | ||
| 42 | "type": "raster", | ||
| 43 | "source": "raster-tiles", | ||
| 44 | "minzoom": 0, | ||
| 45 | "maxzoom": 22 | ||
| 46 | }], | ||
| 47 | }, | ||
| 48 | center: [0, 0], | ||
| 49 | maxZoom: 18, | ||
| 50 | zoom: 2 | ||
| 51 | }); | ||
| 52 | map.addControl(new Logo(), 'bottom-right'); | ||
| 53 | map.addControl(new mapboxgl.NavigationControl(), 'top-left'); | ||
| 54 | |||
| 55 | map.on('load', function () { | ||
| 56 | query(); | ||
| 57 | }); | ||
| 58 | |||
| 59 | function query() { | ||
| 60 | var param = new SuperMap.QueryBySQLParameters({ | ||
| 61 | queryParams: { | ||
| 62 | name: "Capitals@World.1", | ||
| 63 | attributeFilter: "SMID > 100" | ||
| 64 | } | ||
| 65 | }); | ||
| 66 | var queryService = new QueryService(url).queryBySQL(param, function (serviceResult) { | ||
| 67 | console.log(serviceResult); | ||
| 68 | var recordsets = serviceResult && serviceResult.result && serviceResult.result.recordsets; | ||
| 69 | var features = recordsets && recordsets[0] && recordsets[0].features; | ||
| 70 | map.addLayer({ | ||
| 71 | "id": "points", | ||
| 72 | "type": "circle", | ||
| 73 | "paint": { | ||
| 74 | "circle-radius": 6, | ||
| 75 | "circle-color": "#007cbf", | ||
| 76 | "circle-opacity":0.1, | ||
| 77 | "circle-stroke-width":2, | ||
| 78 | "circle-stroke-color":"#007cbf", | ||
| 79 | "circle-stroke-opacity":0.5 | ||
| 80 | }, | ||
| 81 | "source": { | ||
| 82 | "type": "geojson", | ||
| 83 | "data": features | ||
| 84 | } | ||
| 85 | }); | ||
| 86 | }); | ||
| 87 | } | ||
| 88 | } | ||
| 89 | } | ||
| 90 | </script> | ||
| 91 | |||
| 92 | <style scoped> | ||
| 93 | #map { | ||
| 94 | position: absolute; | ||
| 95 | height: 100%; | ||
| 96 | width: 100%; | ||
| 97 | background-color: white | ||
| 98 | } | ||
| 99 | </style> |
| 1 | <!-- | ||
| 2 | * 缓冲区分析 | ||
| 3 | * @Author: jiangbotao | ||
| 4 | * @Date: 2019-12-10 14:16:04 | ||
| 5 | * @LastEditors: jiangbotao | ||
| 6 | * @LastEditTime: 2019-12-10 19:58:51 | ||
| 7 | * @FilePath: \mymapbox\src\components\Map_filter_sql.vue | ||
| 8 | --> | ||
| 9 | <template> | ||
| 10 | <div > | ||
| 11 | <div id="map"></div> | ||
| 12 | </div> | ||
| 13 | </template> | ||
| 14 | |||
| 15 | <script> | ||
| 16 | import mapboxgl from 'mapbox-gl'; | ||
| 17 | import { Logo, FeatureService, QueryService, SpatialAnalystService } from '@supermap/iclient-mapboxgl'; | ||
| 18 | export default { | ||
| 19 | name: 'HelloWorld', | ||
| 20 | data () { | ||
| 21 | return { | ||
| 22 | |||
| 23 | } | ||
| 24 | }, | ||
| 25 | mounted(){ | ||
| 26 | var map, host = "http://support.supermap.com.cn:8090"; | ||
| 27 | var baseUrl = host + "/iserver/services/map-jingjin/rest/maps/京津地区地图/zxyTileImage.png?z={z}&x={x}&y={y}"; | ||
| 28 | var serviceUrl = host + "/iserver/services/spatialanalyst-sample/restjsr/spatialanalyst"; | ||
| 29 | var serviceUrl2 = 'http://support.supermap.com.cn:8090/iserver/services/spatialanalyst-sample/restjsr/spatialanalyst/datasets/Road_L@Jingjin/buffer.json?returnContent=true'; | ||
| 30 | |||
| 31 | var map = new mapboxgl.Map({ | ||
| 32 | container: 'map', | ||
| 33 | style: { | ||
| 34 | "version": 8, | ||
| 35 | "sources": { | ||
| 36 | "raster-tiles": { | ||
| 37 | "attribution": 'attribution', | ||
| 38 | "type": "raster", | ||
| 39 | "tiles": [baseUrl], | ||
| 40 | "tileSize": 256, | ||
| 41 | }, | ||
| 42 | }, | ||
| 43 | "layers": [{ | ||
| 44 | "id": "simple-tiles", | ||
| 45 | "type": "raster", | ||
| 46 | "source": "raster-tiles", | ||
| 47 | "minzoom": 0, | ||
| 48 | "maxzoom": 22 | ||
| 49 | }], | ||
| 50 | }, | ||
| 51 | center: [116.28094998209556, 39.897168019388474], | ||
| 52 | maxZoom: 18, | ||
| 53 | zoom: 12 | ||
| 54 | }); | ||
| 55 | map.addControl(new Logo(), 'bottom-right'); | ||
| 56 | map.addControl(new mapboxgl.NavigationControl(), 'top-left'); | ||
| 57 | |||
| 58 | map.on('load', function () { | ||
| 59 | bufferAnalystProcess(); | ||
| 60 | }); | ||
| 61 | |||
| 62 | function bufferAnalystProcess() { | ||
| 63 | map.addLayer({ | ||
| 64 | "id": "route", | ||
| 65 | "type": "line", | ||
| 66 | "source": { | ||
| 67 | "type": "geojson", | ||
| 68 | "data": { | ||
| 69 | "type": "Feature", | ||
| 70 | "geometry": { | ||
| 71 | "type": "LineString", | ||
| 72 | "coordinates": [ | ||
| 73 | [116.2143386597, 39.8959419733], | ||
| 74 | [116.2156351162, 39.8963250173], | ||
| 75 | [116.2182280292, 39.8968111885], | ||
| 76 | [116.2740019864, 39.8970124079], | ||
| 77 | [116.3103285499, 39.8970574832], | ||
| 78 | [116.3321510064, 39.8970392162], | ||
| 79 | [116.3377051439, 39.8973437531], | ||
| 80 | [116.3463089006, 39.8978391816], | ||
| 81 | ] | ||
| 82 | } | ||
| 83 | } | ||
| 84 | }, | ||
| 85 | "layout": { | ||
| 86 | "line-join": "round", | ||
| 87 | "line-cap": "round" | ||
| 88 | }, | ||
| 89 | "paint": { | ||
| 90 | "line-color": "#888", | ||
| 91 | "line-width": 8 | ||
| 92 | } | ||
| 93 | }); | ||
| 94 | //缓冲区分析参数 | ||
| 95 | var dsBufferAnalystParameters = new SuperMap.DatasetBufferAnalystParameters({ | ||
| 96 | dataset: "Road_L@Jingjin", | ||
| 97 | filterQueryParameter: new SuperMap.FilterParameter({ | ||
| 98 | attributeFilter: "NAME='莲花池东路'" | ||
| 99 | }), | ||
| 100 | bufferSetting: new SuperMap.BufferSetting({ | ||
| 101 | endType: SuperMap.BufferEndType.ROUND, | ||
| 102 | leftDistance: {value: 300}, | ||
| 103 | rightDistance: {value: 300}, | ||
| 104 | semicircleLineSegment: 10, | ||
| 105 | radiusUnit: 'METER' | ||
| 106 | }) | ||
| 107 | }); | ||
| 108 | //缓冲区分析服务 | ||
| 109 | new SpatialAnalystService(serviceUrl).bufferAnalysis(dsBufferAnalystParameters, function (serviceResult) { | ||
| 110 | console.log(serviceResult.result); | ||
| 111 | map.addLayer({ | ||
| 112 | "id": "queryDatas", | ||
| 113 | "type": "fill", /* fill类型一般用来表示一个面,一般较大 */ | ||
| 114 | "source": { | ||
| 115 | "type": "geojson", | ||
| 116 | "data": serviceResult.result.recordset.features | ||
| 117 | }, | ||
| 118 | "paint": { | ||
| 119 | "fill-color": "red", /* 填充的颜色 */ | ||
| 120 | "fill-opacity": 0.4 /* 透明度 */ | ||
| 121 | }, | ||
| 122 | }); | ||
| 123 | }) | ||
| 124 | } | ||
| 125 | } | ||
| 126 | } | ||
| 127 | </script> | ||
| 128 | |||
| 129 | <style scoped> | ||
| 130 | #map { | ||
| 131 | position: absolute; | ||
| 132 | height: 100%; | ||
| 133 | width: 100%; | ||
| 134 | background-color: white | ||
| 135 | } | ||
| 136 | </style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | <template> | ||
| 2 | <div > | ||
| 3 | <div id="map"></div> | ||
| 4 | </div> | ||
| 5 | </template> | ||
| 6 | |||
| 7 | <script> | ||
| 8 | import mapboxgl from 'mapbox-gl'; | ||
| 9 | import {Logo, QueryByBoundsParameters, QueryService, SuperMap} from '@supermap/iclient-mapboxgl'; | ||
| 10 | import $ from 'jquery' | ||
| 11 | |||
| 12 | export default { | ||
| 13 | name: 'HelloWorld', | ||
| 14 | data () { | ||
| 15 | return { | ||
| 16 | } | ||
| 17 | }, | ||
| 18 | mounted(){ | ||
| 19 | var host = "http://support.supermap.com.cn:8090"; | ||
| 20 | var map, heatMapLayer, | ||
| 21 | url = host + "/iserver/services/map-world/rest/maps/World"; | ||
| 22 | var map = new mapboxgl.Map({ | ||
| 23 | container: 'map', | ||
| 24 | renderWorldCopies:false, | ||
| 25 | style: { | ||
| 26 | "version": 8, | ||
| 27 | "sources": { | ||
| 28 | "raster-tiles": { | ||
| 29 | "attribution": 'attribution', | ||
| 30 | "type": "raster", | ||
| 31 | "tiles": [url + '/zxyTileImage.png?z={z}&x={x}&y={y}'], | ||
| 32 | "tileSize": 256, | ||
| 33 | }, | ||
| 34 | }, | ||
| 35 | "layers": [{ | ||
| 36 | "id": "simple-tiles", | ||
| 37 | "type": "raster", | ||
| 38 | "source": "raster-tiles", | ||
| 39 | "minzoom": 0, | ||
| 40 | "maxzoom": 9 | ||
| 41 | }] | ||
| 42 | }, | ||
| 43 | center: [0, 0], | ||
| 44 | zoom: 4 | ||
| 45 | }); | ||
| 46 | map.addControl(new mapboxgl.NavigationControl(), 'top-left'); | ||
| 47 | map.addControl(new mapboxgl.supermap.LogoControl(), 'bottom-right'); | ||
| 48 | |||
| 49 | heatMapLayer = new mapboxgl.supermap.HeatMapLayer( | ||
| 50 | "heatMap", | ||
| 51 | { | ||
| 52 | "map": map, | ||
| 53 | "id": "heatmap", | ||
| 54 | "radius": 45, | ||
| 55 | // 设置图层透明度:(参数方式) | ||
| 56 | // "opacity": 0.5, | ||
| 57 | //featureWeight指定以哪个属性值为热力权重值创建热力图: | ||
| 58 | "featureWeight": "value", | ||
| 59 | } | ||
| 60 | ); | ||
| 61 | |||
| 62 | map.on('load', ()=>{ | ||
| 63 | createHeatPoints(); | ||
| 64 | }); | ||
| 65 | |||
| 66 | function createHeatPoints() { | ||
| 67 | clearHeatPoints(); | ||
| 68 | var heatPoints = []; | ||
| 69 | var num = 200 | ||
| 70 | var radius = 50 | ||
| 71 | var unit = 'px' | ||
| 72 | heatMapLayer.radius = radius; | ||
| 73 | var features = []; | ||
| 74 | for (var i = 0; i < num; i++) { | ||
| 75 | features[i] = | ||
| 76 | { | ||
| 77 | "type": "feature", | ||
| 78 | "geometry": { | ||
| 79 | "type": "Point", | ||
| 80 | "coordinates": [ | ||
| 81 | Math.random() * 300 - 180, | ||
| 82 | Math.random() * 100 - 80] | ||
| 83 | }, | ||
| 84 | "properties": { | ||
| 85 | "value": Math.random() * 9, | ||
| 86 | } | ||
| 87 | }; | ||
| 88 | } | ||
| 89 | var heatPoints = { | ||
| 90 | "type": "FeatureCollection", | ||
| 91 | "features": features | ||
| 92 | }; | ||
| 93 | heatMapLayer.addFeatures(heatPoints); | ||
| 94 | // 设置图层透明度:(函数方式) | ||
| 95 | // heatMapLayer.setOpacity(0.5); | ||
| 96 | map.addLayer(heatMapLayer); | ||
| 97 | } | ||
| 98 | |||
| 99 | function clearHeatPoints() { | ||
| 100 | if (map.getLayer("heatmap")) { | ||
| 101 | map.removeLayer("heatmap"); | ||
| 102 | } | ||
| 103 | } | ||
| 104 | } | ||
| 105 | } | ||
| 106 | </script> | ||
| 107 | |||
| 108 | <style scoped> | ||
| 109 | #map { | ||
| 110 | height: 100%; | ||
| 111 | width: 100%; | ||
| 112 | position: absolute; | ||
| 113 | background-color: white | ||
| 114 | } | ||
| 115 | </style> |
src/components/theme/Map_theme_dot.vue
0 → 100644
| 1 | <!-- | ||
| 2 | * 点密度专题图用一定大小、形状相同的点表示现象分布范围、数量特征和分布密度。 | ||
| 3 | * 点的多少和所代表的意义由地图的内容决定。 | ||
| 4 | * 点密度专题图使用点的数目或者密集程度来反映一个区域或范围所对应的专题值。 | ||
| 5 | * @Author: jiangbotao | ||
| 6 | * @Date: 2019-12-10 14:16:04 | ||
| 7 | * @LastEditors: jiangbotao | ||
| 8 | * @LastEditTime: 2019-12-10 17:25:54 | ||
| 9 | * @FilePath: \mymapbox\src\components\Map_filter_sql.vue | ||
| 10 | --> | ||
| 11 | <template> | ||
| 12 | <div > | ||
| 13 | <div id="map"></div> | ||
| 14 | </div> | ||
| 15 | </template> | ||
| 16 | |||
| 17 | <script> | ||
| 18 | import mapboxgl from 'mapbox-gl'; | ||
| 19 | import { Logo, FeatureService, QueryService, ThemeService } from '@supermap/iclient-mapboxgl'; | ||
| 20 | export default { | ||
| 21 | name: 'HelloWorld', | ||
| 22 | data () { | ||
| 23 | return { | ||
| 24 | |||
| 25 | } | ||
| 26 | }, | ||
| 27 | mounted(){ | ||
| 28 | var map, host = "http://support.supermap.com.cn:8090"; | ||
| 29 | var url = host + "/iserver/services/map-world/rest/maps/World"; | ||
| 30 | var dataUrl = host + "/iserver/services/map-world/rest/maps/World"; | ||
| 31 | |||
| 32 | var map = new mapboxgl.Map({ | ||
| 33 | container: 'map', | ||
| 34 | style: { | ||
| 35 | "version": 8, | ||
| 36 | "sources": { | ||
| 37 | "raster-tiles": { | ||
| 38 | "attribution": 'attribution', | ||
| 39 | "type": "raster", | ||
| 40 | "tiles": [host + '/iserver/services/maps/rest/maps/World/zxyTileImage.png?prjCoordSys={"epsgCode":3857}&z={z}&x={x}&y={y}'], | ||
| 41 | "tileSize": 256, | ||
| 42 | }, | ||
| 43 | }, | ||
| 44 | "layers": [{ | ||
| 45 | "id": "simple-tiles", | ||
| 46 | "type": "raster", | ||
| 47 | "source": "raster-tiles", | ||
| 48 | "minzoom": 0, | ||
| 49 | "maxzoom": 22 | ||
| 50 | }], | ||
| 51 | }, | ||
| 52 | center: [108.94, 34.34], | ||
| 53 | maxZoom: 18, | ||
| 54 | zoom: 2 | ||
| 55 | }); | ||
| 56 | map.addControl(new Logo(), 'bottom-right'); | ||
| 57 | map.addControl(new mapboxgl.NavigationControl(), 'top-left'); | ||
| 58 | |||
| 59 | map.on('load', function () { | ||
| 60 | createTheme(); | ||
| 61 | }); | ||
| 62 | |||
| 63 | function createTheme() { | ||
| 64 | var themeDotDensity = new SuperMap.ThemeDotDensity({ | ||
| 65 | dotExpression: "Pop_1994", | ||
| 66 | value: 5000000, | ||
| 67 | style: new SuperMap.ServerStyle({ | ||
| 68 | markerSize: 3, | ||
| 69 | markerSymbolID: 12 | ||
| 70 | }) | ||
| 71 | }); | ||
| 72 | var themeParameters = new SuperMap.ThemeParameters({ | ||
| 73 | themes: [themeDotDensity], | ||
| 74 | datasetNames: ["Countries"], | ||
| 75 | dataSourceNames: ["World"] | ||
| 76 | }); | ||
| 77 | |||
| 78 | var themeService = new ThemeService(dataUrl); | ||
| 79 | themeService.getThemeInfo(themeParameters, function (serviceResult) { | ||
| 80 | var result = serviceResult.result; | ||
| 81 | console.log(result); | ||
| 82 | if (result && result.newResourceID) { | ||
| 83 | map.addSource("theme", { | ||
| 84 | "type": 'raster', | ||
| 85 | "tiles": ['http://support.supermap.com.cn:8090/iserver/services/maps/rest/maps/World/zxyTileImage.png?z={z}&x={x}&y={y}&transparent=true&cacheEnabled=false&noWrap=true&layersID=' + result.newResourceID], | ||
| 86 | "tileSize": 256, | ||
| 87 | }); | ||
| 88 | map.addLayer({ | ||
| 89 | "id": "themeLayer", | ||
| 90 | "type": "raster", | ||
| 91 | "source": "theme", | ||
| 92 | }); | ||
| 93 | } | ||
| 94 | }) | ||
| 95 | } | ||
| 96 | } | ||
| 97 | } | ||
| 98 | </script> | ||
| 99 | |||
| 100 | <style scoped> | ||
| 101 | #map { | ||
| 102 | position: absolute; | ||
| 103 | height: 100%; | ||
| 104 | width: 100%; | ||
| 105 | background-color: white | ||
| 106 | } | ||
| 107 | </style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
src/components/theme/Map_theme_graduated.vue
0 → 100644
| 1 | <!-- | ||
| 2 | * @Author: jiangbotao | ||
| 3 | * @Date: 2019-12-10 14:16:04 | ||
| 4 | * @LastEditors: jiangbotao | ||
| 5 | * @LastEditTime: 2019-12-10 15:35:38 | ||
| 6 | * @FilePath: \mymapbox\src\components\Map_filter_sql.vue | ||
| 7 | --> | ||
| 8 | <template> | ||
| 9 | <div > | ||
| 10 | <div id="map"></div> | ||
| 11 | </div> | ||
| 12 | </template> | ||
| 13 | |||
| 14 | <script> | ||
| 15 | import mapboxgl from 'mapbox-gl'; | ||
| 16 | import { Logo, FeatureService, QueryService, ThemeService } from '@supermap/iclient-mapboxgl'; | ||
| 17 | export default { | ||
| 18 | name: 'HelloWorld', | ||
| 19 | data () { | ||
| 20 | return { | ||
| 21 | |||
| 22 | } | ||
| 23 | }, | ||
| 24 | mounted(){ | ||
| 25 | var map, host = "http://support.supermap.com.cn:8090"; | ||
| 26 | var url = host + "/iserver/services/map-world/rest/maps/World"; | ||
| 27 | var dataUrl = host + "/iserver/services/map-china400/rest/maps/China"; | ||
| 28 | |||
| 29 | var map = new mapboxgl.Map({ | ||
| 30 | container: 'map', | ||
| 31 | style: { | ||
| 32 | "version": 8, | ||
| 33 | "sources": { | ||
| 34 | "raster-tiles": { | ||
| 35 | "attribution": 'attribution', | ||
| 36 | "type": "raster", | ||
| 37 | "tiles": [host + '/iserver/services/map-china400/rest/maps/China/zxyTileImage.png?prjCoordSys={"epsgCode":3857}&z={z}&x={x}&y={y}'], | ||
| 38 | "tileSize": 256, | ||
| 39 | }, | ||
| 40 | }, | ||
| 41 | "layers": [{ | ||
| 42 | "id": "simple-tiles", | ||
| 43 | "type": "raster", | ||
| 44 | "source": "raster-tiles", | ||
| 45 | "minzoom": 0, | ||
| 46 | "maxzoom": 22 | ||
| 47 | }], | ||
| 48 | }, | ||
| 49 | center: [108.94, 34.34], | ||
| 50 | maxZoom: 18, | ||
| 51 | zoom: 2 | ||
| 52 | }); | ||
| 53 | map.addControl(new Logo(), 'bottom-right'); | ||
| 54 | map.addControl(new mapboxgl.NavigationControl(), 'top-left'); | ||
| 55 | |||
| 56 | map.on('load', function () { | ||
| 57 | createTheme(); | ||
| 58 | }); | ||
| 59 | |||
| 60 | function createTheme() { | ||
| 61 | var themeGraduatedSymbol = new SuperMap.ThemeGraduatedSymbol({ | ||
| 62 | expression: "SMAREA", | ||
| 63 | baseValue: 3000000000000, | ||
| 64 | graduatedMode: SuperMap.GraduatedMode.CONSTANT, | ||
| 65 | flow: new SuperMap.ThemeFlow({ | ||
| 66 | flowEnabled: true | ||
| 67 | }), | ||
| 68 | style: new SuperMap.ThemeGraduatedSymbolStyle({ | ||
| 69 | positiveStyle: new SuperMap.ServerStyle({ | ||
| 70 | markerSize: 50, | ||
| 71 | markerSymbolID: 0, | ||
| 72 | lineColor: new SuperMap.ServerColor(255, 165, 0), | ||
| 73 | fillBackColor: new SuperMap.ServerColor(255, 0, 0) | ||
| 74 | }) | ||
| 75 | }) | ||
| 76 | }); | ||
| 77 | |||
| 78 | var themeParameters = new SuperMap.ThemeParameters({ | ||
| 79 | themes: [themeGraduatedSymbol], | ||
| 80 | datasetNames: ["China_Province_pg"], | ||
| 81 | dataSourceNames: ["China"] | ||
| 82 | }); | ||
| 83 | |||
| 84 | new ThemeService(dataUrl).getThemeInfo(themeParameters, function (serviceResult) { | ||
| 85 | var result = serviceResult.result; | ||
| 86 | if (result && result.newResourceID) { | ||
| 87 | map.addSource("theme", { | ||
| 88 | "type": 'raster', | ||
| 89 | "tiles": [host + '/iserver/services/map-china400/rest/maps/China/zxyTileImage.png?z={z}&x={x}&y={y}&transparent=true&cacheEnabled=false&layersID=' + result.newResourceID], | ||
| 90 | "tileSize": 256, | ||
| 91 | }); | ||
| 92 | map.addLayer({ | ||
| 93 | "id": "themeLayer", | ||
| 94 | "type": "raster", | ||
| 95 | "source": "theme", | ||
| 96 | }); | ||
| 97 | } | ||
| 98 | }) | ||
| 99 | } | ||
| 100 | } | ||
| 101 | } | ||
| 102 | </script> | ||
| 103 | |||
| 104 | <style scoped> | ||
| 105 | #map { | ||
| 106 | position: absolute; | ||
| 107 | height: 100%; | ||
| 108 | width: 100%; | ||
| 109 | background-color: white | ||
| 110 | } | ||
| 111 | </style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
src/components/theme/Map_theme_label.vue
0 → 100644
| 1 | <!-- | ||
| 2 | * @Author: jiangbotao | ||
| 3 | * @Date: 2019-12-10 14:16:04 | ||
| 4 | * @LastEditors: jiangbotao | ||
| 5 | * @LastEditTime: 2019-12-10 15:43:09 | ||
| 6 | * @FilePath: \mymapbox\src\components\Map_filter_sql.vue | ||
| 7 | --> | ||
| 8 | <template> | ||
| 9 | <div > | ||
| 10 | <div id="map"></div> | ||
| 11 | </div> | ||
| 12 | </template> | ||
| 13 | |||
| 14 | <script> | ||
| 15 | import mapboxgl from 'mapbox-gl'; | ||
| 16 | import { Logo, FeatureService, QueryService, ThemeService } from '@supermap/iclient-mapboxgl'; | ||
| 17 | export default { | ||
| 18 | name: 'HelloWorld', | ||
| 19 | data () { | ||
| 20 | return { | ||
| 21 | |||
| 22 | } | ||
| 23 | }, | ||
| 24 | mounted(){ | ||
| 25 | var map, host = "http://support.supermap.com.cn:8090"; | ||
| 26 | var url = host + "/iserver/services/map-world/rest/maps/World"; | ||
| 27 | var dataUrl = host + "/iserver/services/map-china400/rest/maps/China"; | ||
| 28 | |||
| 29 | var map = new mapboxgl.Map({ | ||
| 30 | container: 'map', | ||
| 31 | style: { | ||
| 32 | "version": 8, | ||
| 33 | "sources": { | ||
| 34 | "raster-tiles": { | ||
| 35 | "attribution": 'attribution', | ||
| 36 | "type": "raster", | ||
| 37 | "tiles": [host + '/iserver/services/map-china400/rest/maps/China/zxyTileImage.png?prjCoordSys={"epsgCode":3857}&z={z}&x={x}&y={y}'], | ||
| 38 | "tileSize": 256, | ||
| 39 | }, | ||
| 40 | }, | ||
| 41 | "layers": [{ | ||
| 42 | "id": "simple-tiles", | ||
| 43 | "type": "raster", | ||
| 44 | "source": "raster-tiles", | ||
| 45 | "minzoom": 0, | ||
| 46 | "maxzoom": 22 | ||
| 47 | }], | ||
| 48 | }, | ||
| 49 | center: [108.94, 34.34], | ||
| 50 | maxZoom: 18, | ||
| 51 | zoom: 2 | ||
| 52 | }); | ||
| 53 | map.addControl(new Logo(), 'bottom-right'); | ||
| 54 | map.addControl(new mapboxgl.NavigationControl(), 'top-left'); | ||
| 55 | |||
| 56 | map.on('load', function () { | ||
| 57 | createTheme(); | ||
| 58 | }); | ||
| 59 | |||
| 60 | function createTheme() { | ||
| 61 | var style1, style2, style3; | ||
| 62 | style1 = new SuperMap.ServerTextStyle({ | ||
| 63 | fontHeight: 4, | ||
| 64 | foreColor: new SuperMap.ServerColor(0, 0, 0), | ||
| 65 | |||
| 66 | }); | ||
| 67 | style2 = new SuperMap.ServerTextStyle({ | ||
| 68 | fontHeight: 4, | ||
| 69 | foreColor: new SuperMap.ServerColor(155, 30, 45), | ||
| 70 | }); | ||
| 71 | style3 = new SuperMap.ServerTextStyle({ | ||
| 72 | fontHeight: 4, | ||
| 73 | foreColor: new SuperMap.ServerColor(30, 45, 155), | ||
| 74 | }); | ||
| 75 | var themeLabelItem1, themeLabelItem2, themeLabelItem3; | ||
| 76 | themeLabelItem1 = new SuperMap.ThemeLabelItem({ | ||
| 77 | start: 300,//110000, | ||
| 78 | end: 3508,//350000, | ||
| 79 | style: style1 | ||
| 80 | }); | ||
| 81 | themeLabelItem2 = new SuperMap.ThemeLabelItem({ | ||
| 82 | start: 3508,//350000, | ||
| 83 | end: 5508,//550000, | ||
| 84 | style: style2 | ||
| 85 | }); | ||
| 86 | themeLabelItem3 = new SuperMap.ThemeLabelItem({ | ||
| 87 | start: 5508,//550000, | ||
| 88 | end: 10724,//820000, | ||
| 89 | style: style3 | ||
| 90 | }); | ||
| 91 | |||
| 92 | var themeLabel = new SuperMap.ThemeLabel({ | ||
| 93 | labelExpression: "NAME", | ||
| 94 | rangeExpression: "pop_2014", | ||
| 95 | numericPrecision: 0, | ||
| 96 | items: [themeLabelItem1, themeLabelItem2, themeLabelItem3], | ||
| 97 | background: new SuperMap.ThemeLabelBackground({ | ||
| 98 | backStyle: new SuperMap.ServerStyle({ | ||
| 99 | fillForeColor: new SuperMap.ServerColor(179, 209, 193), | ||
| 100 | fillOpaqueRate: 60, | ||
| 101 | lineWidth: 0.1 | ||
| 102 | }), | ||
| 103 | labelBackShape: "RECT" | ||
| 104 | }) | ||
| 105 | }); | ||
| 106 | var themeParameters = new SuperMap.ThemeParameters({ | ||
| 107 | themes: [themeLabel], | ||
| 108 | datasetNames: ["China_Province_pg"], | ||
| 109 | dataSourceNames: ["China"] | ||
| 110 | }); | ||
| 111 | |||
| 112 | new ThemeService(dataUrl).getThemeInfo(themeParameters, function (serviceResult) { | ||
| 113 | var result = serviceResult.result; | ||
| 114 | if (result && result.newResourceID) { | ||
| 115 | map.addSource("theme", { | ||
| 116 | "type": 'raster', | ||
| 117 | "tiles": [host + '/iserver/services/map-china400/rest/maps/China/zxyTileImage.png?z={z}&x={x}&y={y}&transparent=true&cacheEnabled=false&layersID=' + result.newResourceID], | ||
| 118 | "tileSize": 256, | ||
| 119 | }); | ||
| 120 | |||
| 121 | map.addLayer({ | ||
| 122 | "id": "themeLayer", | ||
| 123 | "type": "raster", | ||
| 124 | "source": "theme", | ||
| 125 | }); | ||
| 126 | } | ||
| 127 | }) | ||
| 128 | } | ||
| 129 | } | ||
| 130 | } | ||
| 131 | </script> | ||
| 132 | |||
| 133 | <style scoped> | ||
| 134 | #map { | ||
| 135 | position: absolute; | ||
| 136 | height: 100%; | ||
| 137 | width: 100%; | ||
| 138 | background-color: white | ||
| 139 | } | ||
| 140 | </style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
src/components/theme/Map_theme_range.vue
0 → 100644
| 1 | <!-- | ||
| 2 | * @Author: jiangbotao | ||
| 3 | * @Date: 2019-12-10 14:16:04 | ||
| 4 | * @LastEditors: jiangbotao | ||
| 5 | * @LastEditTime: 2019-12-10 15:53:23 | ||
| 6 | * @FilePath: \mymapbox\src\components\Map_filter_sql.vue | ||
| 7 | --> | ||
| 8 | <template> | ||
| 9 | <div > | ||
| 10 | <div id="map"></div> | ||
| 11 | </div> | ||
| 12 | </template> | ||
| 13 | |||
| 14 | <script> | ||
| 15 | import mapboxgl from 'mapbox-gl'; | ||
| 16 | import { Logo, FeatureService, QueryService, ThemeService } from '@supermap/iclient-mapboxgl'; | ||
| 17 | export default { | ||
| 18 | name: 'HelloWorld', | ||
| 19 | data () { | ||
| 20 | return { | ||
| 21 | |||
| 22 | } | ||
| 23 | }, | ||
| 24 | mounted(){ | ||
| 25 | var map, host = "http://support.supermap.com.cn:8090"; | ||
| 26 | var url = host + "/iserver/services/map-world/rest/maps/World"; | ||
| 27 | var dataUrl = host + "/iserver/services/map-china400/rest/maps/China"; | ||
| 28 | |||
| 29 | var map = new mapboxgl.Map({ | ||
| 30 | container: 'map', | ||
| 31 | style: { | ||
| 32 | "version": 8, | ||
| 33 | "sources": { | ||
| 34 | "raster-tiles": { | ||
| 35 | "attribution": 'attribution', | ||
| 36 | "type": "raster", | ||
| 37 | "tiles": [host + '/iserver/services/map-china400/rest/maps/China/zxyTileImage.png?prjCoordSys={"epsgCode":3857}&z={z}&x={x}&y={y}'], | ||
| 38 | "tileSize": 256, | ||
| 39 | }, | ||
| 40 | }, | ||
| 41 | "layers": [{ | ||
| 42 | "id": "simple-tiles", | ||
| 43 | "type": "raster", | ||
| 44 | "source": "raster-tiles", | ||
| 45 | "minzoom": 0, | ||
| 46 | "maxzoom": 22 | ||
| 47 | }], | ||
| 48 | }, | ||
| 49 | center: [108.94, 34.34], | ||
| 50 | maxZoom: 18, | ||
| 51 | zoom: 2 | ||
| 52 | }); | ||
| 53 | map.addControl(new Logo(), 'bottom-right'); | ||
| 54 | map.addControl(new mapboxgl.NavigationControl(), 'top-left'); | ||
| 55 | |||
| 56 | map.on('load', function () { | ||
| 57 | createTheme(); | ||
| 58 | }); | ||
| 59 | |||
| 60 | function createTheme() { | ||
| 61 | var themeRangeItem1, themeRangeItem2, themeRangeItem3, themeRange; | ||
| 62 | themeRangeItem1 = new SuperMap.ThemeRangeItem({ | ||
| 63 | start: 0, | ||
| 64 | end: 500000000000, | ||
| 65 | style: new SuperMap.ServerStyle({ | ||
| 66 | fillForeColor: new SuperMap.ServerColor(211, 255, 250), | ||
| 67 | lineColor: new SuperMap.ServerColor(179, 209, 193), | ||
| 68 | lineWidth: 0.1 | ||
| 69 | }) | ||
| 70 | }); | ||
| 71 | themeRangeItem2 = new SuperMap.ThemeRangeItem({ | ||
| 72 | start: 500000000000, | ||
| 73 | end: 1000000000000, | ||
| 74 | style: new SuperMap.ServerStyle({ | ||
| 75 | fillForeColor: new SuperMap.ServerColor(178, 218, 199), | ||
| 76 | lineColor: new SuperMap.ServerColor(179, 209, 193), | ||
| 77 | lineWidth: 0.1 | ||
| 78 | }) | ||
| 79 | }); | ||
| 80 | themeRangeItem3 = new SuperMap.ThemeRangeItem({ | ||
| 81 | start: 1000000000000, | ||
| 82 | end: 3000000000000, | ||
| 83 | style: new SuperMap.ServerStyle({ | ||
| 84 | fillForeColor: new SuperMap.ServerColor(58, 178, 166), | ||
| 85 | lineColor: new SuperMap.ServerColor(179, 209, 193), | ||
| 86 | lineWidth: 0.1 | ||
| 87 | }) | ||
| 88 | }); | ||
| 89 | themeRange = new SuperMap.ThemeRange({ | ||
| 90 | rangeExpression: "SMAREA", | ||
| 91 | rangeMode: SuperMap.RangeMode.EQUALINTERVAL, | ||
| 92 | items: [themeRangeItem1, themeRangeItem2, themeRangeItem3] | ||
| 93 | }); | ||
| 94 | var themeParameters = new SuperMap.ThemeParameters({ | ||
| 95 | datasetNames: ["China_Province_pg"], | ||
| 96 | dataSourceNames: ["China"], | ||
| 97 | joinItems: null, | ||
| 98 | themes: [themeRange] | ||
| 99 | }); | ||
| 100 | |||
| 101 | new ThemeService(dataUrl).getThemeInfo(themeParameters, function (serviceResult) { | ||
| 102 | var result = serviceResult.result; | ||
| 103 | if (result && result.newResourceID) { | ||
| 104 | map.addSource("theme", { | ||
| 105 | "type": 'raster', | ||
| 106 | "tiles": [host + '/iserver/services/map-china400/rest/maps/China/zxyTileImage.png?z={z}&x={x}&y={y}&noWrap=true&transparent=true&cacheEnabled=false&layersID=' + result.newResourceID], | ||
| 107 | "tileSize": 256, | ||
| 108 | }); | ||
| 109 | |||
| 110 | map.addLayer({ | ||
| 111 | "id": "themeLayer", | ||
| 112 | "type": "raster", | ||
| 113 | "source": "theme", | ||
| 114 | }); | ||
| 115 | } | ||
| 116 | }) | ||
| 117 | } | ||
| 118 | } | ||
| 119 | } | ||
| 120 | </script> | ||
| 121 | |||
| 122 | <style scoped> | ||
| 123 | #map { | ||
| 124 | position: absolute; | ||
| 125 | height: 100%; | ||
| 126 | width: 100%; | ||
| 127 | background-color: white | ||
| 128 | } | ||
| 129 | </style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
src/components/theme/Map_theme_statics.vue
0 → 100644
| 1 | <!-- | ||
| 2 | * @Author: jiangbotao | ||
| 3 | * @Date: 2019-12-10 14:16:04 | ||
| 4 | * @LastEditors: jiangbotao | ||
| 5 | * @LastEditTime: 2019-12-10 15:40:38 | ||
| 6 | * @FilePath: \mymapbox\src\components\Map_filter_sql.vue | ||
| 7 | --> | ||
| 8 | <template> | ||
| 9 | <div > | ||
| 10 | <div id="map"></div> | ||
| 11 | </div> | ||
| 12 | </template> | ||
| 13 | |||
| 14 | <script> | ||
| 15 | import mapboxgl from 'mapbox-gl'; | ||
| 16 | import { Logo, FeatureService, QueryService, ThemeService } from '@supermap/iclient-mapboxgl'; | ||
| 17 | export default { | ||
| 18 | name: 'HelloWorld', | ||
| 19 | data () { | ||
| 20 | return { | ||
| 21 | |||
| 22 | } | ||
| 23 | }, | ||
| 24 | mounted(){ | ||
| 25 | var map, host = "http://support.supermap.com.cn:8090"; | ||
| 26 | var url = host + "/iserver/services/map-world/rest/maps/World"; | ||
| 27 | var dataUrl = host + "/iserver/services/map-china400/rest/maps/China"; | ||
| 28 | |||
| 29 | var map = new mapboxgl.Map({ | ||
| 30 | container: 'map', | ||
| 31 | style: { | ||
| 32 | "version": 8, | ||
| 33 | "sources": { | ||
| 34 | "raster-tiles": { | ||
| 35 | "attribution": 'attribution', | ||
| 36 | "type": "raster", | ||
| 37 | "tiles": [host + '/iserver/services/map-china400/rest/maps/China/zxyTileImage.png?prjCoordSys={"epsgCode":3857}&z={z}&x={x}&y={y}'], | ||
| 38 | "tileSize": 256, | ||
| 39 | }, | ||
| 40 | }, | ||
| 41 | "layers": [{ | ||
| 42 | "id": "simple-tiles", | ||
| 43 | "type": "raster", | ||
| 44 | "source": "raster-tiles", | ||
| 45 | "minzoom": 0, | ||
| 46 | "maxzoom": 22 | ||
| 47 | }], | ||
| 48 | }, | ||
| 49 | center: [108.94, 34.34], | ||
| 50 | maxZoom: 18, | ||
| 51 | zoom: 2 | ||
| 52 | }); | ||
| 53 | map.addControl(new Logo(), 'bottom-right'); | ||
| 54 | map.addControl(new mapboxgl.NavigationControl(), 'top-left'); | ||
| 55 | |||
| 56 | map.on('load', function () { | ||
| 57 | createTheme(); | ||
| 58 | }); | ||
| 59 | |||
| 60 | function createTheme() { | ||
| 61 | var themeGraph = new SuperMap.ThemeGraph({ | ||
| 62 | items: [ | ||
| 63 | new SuperMap.ThemeGraphItem({ | ||
| 64 | caption: "全国省份2013_GDP", | ||
| 65 | graphExpression: "GDP_2013", | ||
| 66 | uniformStyle: new SuperMap.ServerStyle({ | ||
| 67 | fillForeColor: new SuperMap.ServerColor(255, 215, 0), | ||
| 68 | lineWidth: 0 | ||
| 69 | }) | ||
| 70 | }), | ||
| 71 | new SuperMap.ThemeGraphItem({ | ||
| 72 | caption: "全国省份2014_GDP", | ||
| 73 | graphExpression: "GDP_2014", | ||
| 74 | uniformStyle: new SuperMap.ServerStyle({ | ||
| 75 | fillForeColor: new SuperMap.ServerColor(0, 191, 255), | ||
| 76 | lineWidth: 0 | ||
| 77 | }) | ||
| 78 | }), | ||
| 79 | ], | ||
| 80 | barWidth: 0.001, | ||
| 81 | graduatedMode: SuperMap.GraduatedMode.CONSTANT, | ||
| 82 | graphAxes: new SuperMap.ThemeGraphAxes({ | ||
| 83 | axesDisplayed: true | ||
| 84 | }), | ||
| 85 | graphSize: new SuperMap.ThemeGraphSize({ | ||
| 86 | maxGraphSize: 500000, | ||
| 87 | minGraphSize: 200000 | ||
| 88 | }), | ||
| 89 | graphText: new SuperMap.ThemeGraphText({ | ||
| 90 | graphTextDisplayed: true, | ||
| 91 | graphTextFormat: SuperMap.ThemeGraphTextFormat.VALUE, | ||
| 92 | graphTextStyle: new SuperMap.ServerTextStyle({ | ||
| 93 | fontHeight: 10, | ||
| 94 | fontWidth: 10 | ||
| 95 | }) | ||
| 96 | }), | ||
| 97 | overlapAvoided: false, | ||
| 98 | graphSizeFixed: false, | ||
| 99 | graphType: SuperMap.ThemeGraphType.BAR | ||
| 100 | }); | ||
| 101 | var themeParameters = new SuperMap.ThemeParameters({ | ||
| 102 | themes: [themeGraph], | ||
| 103 | datasetNames: ["China_Province_pg"], | ||
| 104 | dataSourceNames: ["China"] | ||
| 105 | }); | ||
| 106 | |||
| 107 | new ThemeService(dataUrl).getThemeInfo(themeParameters, function (serviceResult) { | ||
| 108 | var result = serviceResult.result; | ||
| 109 | if (result && result.newResourceID) { | ||
| 110 | map.addSource("theme", { | ||
| 111 | "type": 'raster', | ||
| 112 | "tiles": [host + '/iserver/services/map-china400/rest/maps/China/zxyTileImage.png?z={z}&x={x}&y={y}&transparent=true&cacheEnabled=false&layersID=' + result.newResourceID], | ||
| 113 | "tileSize": 256, | ||
| 114 | }); | ||
| 115 | map.addLayer({ | ||
| 116 | "id": "themeLayer", | ||
| 117 | "type": "raster", | ||
| 118 | "source": "theme", | ||
| 119 | }); | ||
| 120 | } | ||
| 121 | }) | ||
| 122 | } | ||
| 123 | } | ||
| 124 | } | ||
| 125 | </script> | ||
| 126 | |||
| 127 | <style scoped> | ||
| 128 | #map { | ||
| 129 | position: absolute; | ||
| 130 | height: 100%; | ||
| 131 | width: 100%; | ||
| 132 | background-color: white | ||
| 133 | } | ||
| 134 | </style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
src/components/vt/Map_bj_2.vue
0 → 100644
| 1 | <!-- | ||
| 2 | * - basic | ||
| 3 | * - dark | ||
| 4 | * - fiordcolor | ||
| 5 | * - klokantech | ||
| 6 | * - osm | ||
| 7 | * - positron | ||
| 8 | * @Author: jiangbotao | ||
| 9 | * @Date: 2019-12-09 23:17:48 | ||
| 10 | * @LastEditors: jiangbotao | ||
| 11 | * @LastEditTime: 2019-12-12 18:34:35 | ||
| 12 | * @FilePath: \mymapbox\src\components\Map3857.vue | ||
| 13 | --> | ||
| 14 | <template> | ||
| 15 | <div > | ||
| 16 | <div id="map"></div> | ||
| 17 | </div> | ||
| 18 | </template> | ||
| 19 | |||
| 20 | <script> | ||
| 21 | import mapboxgl from 'mapbox-gl'; | ||
| 22 | import { Logo } from '@supermap/iclient-mapboxgl'; | ||
| 23 | |||
| 24 | export default { | ||
| 25 | name: 'MVT', | ||
| 26 | data () { | ||
| 27 | return { | ||
| 28 | |||
| 29 | } | ||
| 30 | }, | ||
| 31 | mounted(){ | ||
| 32 | var map, host = "http://support.supermap.com.cn:8090"; | ||
| 33 | var url = host + "/iserver/services/map-world/rest/maps/World"; | ||
| 34 | |||
| 35 | var map = new mapboxgl.Map({ | ||
| 36 | container: 'map', // container id | ||
| 37 | style: { | ||
| 38 | "version": 8, | ||
| 39 | "sources": { | ||
| 40 | "vector-tiles": { | ||
| 41 | "attribution": 'attribution', | ||
| 42 | "type": "vector", | ||
| 43 | "tiles": [host + "/iserver/services/map-beijing/rest/maps/beijingMap/tileFeature.mvt?returnAttributes=true&compressTolerance=-1&width=512&height=512&viewBounds={bbox-epsg-3857}&expands=0:0_2,132_128,138_64,141_32,143_16,145_8,147_4"] | ||
| 44 | }, | ||
| 45 | }, | ||
| 46 | "glyphs": host + "/iserver/services/map-beijing/rest/maps/beijingMap/tileFeature/sdffonts/{fontstack}/{range}.pbf", | ||
| 47 | "layers": [] | ||
| 48 | }, | ||
| 49 | center: [116.4, 39.9], | ||
| 50 | minZoom: 10, | ||
| 51 | zoom: 11 | ||
| 52 | }); | ||
| 53 | map.addControl(new mapboxgl.NavigationControl(), 'top-left'); | ||
| 54 | |||
| 55 | map.on('load', function () { | ||
| 56 | console.log(mapStyles["basic"].style); | ||
| 57 | map.setStyle(mapStyles["fiordcolor"].style, {diff: false}); | ||
| 58 | }); | ||
| 59 | } | ||
| 60 | } | ||
| 61 | </script> | ||
| 62 | |||
| 63 | <style scoped> | ||
| 64 | #map { | ||
| 65 | position: absolute; | ||
| 66 | height: 100%; | ||
| 67 | width: 100%; | ||
| 68 | background-color: white | ||
| 69 | } | ||
| 70 | </style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
src/components/vt/Map_wz.vue
0 → 100644
| 1 | <!-- | ||
| 2 | * @Author: jiangbotao | ||
| 3 | * @Date: 2019-12-10 22:15:53 | ||
| 4 | * @LastEditors: jiangbotao | ||
| 5 | * @LastEditTime: 2019-12-12 17:31:11 | ||
| 6 | * @FilePath: \supermapvue\src\components\vt\Map_wz.vue | ||
| 7 | --> | ||
| 8 | <template> | ||
| 9 | <div > | ||
| 10 | <div id="map"></div> | ||
| 11 | </div> | ||
| 12 | </template> | ||
| 13 | |||
| 14 | <script> | ||
| 15 | import mapboxgl from 'mapbox-gl'; | ||
| 16 | import { Logo } from '@supermap/iclient-mapboxgl'; | ||
| 17 | |||
| 18 | export default { | ||
| 19 | name: 'MVT', | ||
| 20 | data () { | ||
| 21 | return { | ||
| 22 | |||
| 23 | } | ||
| 24 | }, | ||
| 25 | mounted(){ | ||
| 26 | // var url = "http://127.0.0.1:8090/iserver/services/map-mvt-China_Dark/rest/maps/China_Dark/tileFeature/vectorstyles.json?type=MapBox_GL&styleonly=true"; | ||
| 27 | // $.ajax({ | ||
| 28 | // url:url, | ||
| 29 | // success:function(mvtStyle){ | ||
| 30 | // var zoom = mvtStyle.zoom == null ? minZoomLevel : mvtStyle.zoom; | ||
| 31 | // var map = new mapboxgl.Map({ | ||
| 32 | // container: 'map', // container id | ||
| 33 | // style: mvtStyle, | ||
| 34 | // center: [-1, -2],// starting position | ||
| 35 | // zoom: 4, // starting zoom | ||
| 36 | // minZoom: 0, | ||
| 37 | // maxZoom: 5, | ||
| 38 | // crs: "EPSG:4490" | ||
| 39 | // }); | ||
| 40 | // map.addControl(new mapboxgl.NavigationControl(), 'top-left'); | ||
| 41 | // // map.setStyle({ | ||
| 42 | // // style: { | ||
| 43 | // // layers: [ | ||
| 44 | // // { | ||
| 45 | // // "id": "background", | ||
| 46 | // // "type": "background", | ||
| 47 | // // "layout": {}, | ||
| 48 | // // "paint": { | ||
| 49 | // // "background-color": "#fcfcfc" | ||
| 50 | // // } | ||
| 51 | // // } | ||
| 52 | // // ] | ||
| 53 | // // } | ||
| 54 | // // }, {diff: false}); | ||
| 55 | // } | ||
| 56 | // }); | ||
| 57 | var map = new mapboxgl.Map({ | ||
| 58 | container: 'map', // container id | ||
| 59 | style: | ||
| 60 | 'http://127.0.0.1:8090/iserver/services/map-mvt-China_Dark/rest/maps/China_Dark/tileFeature/vectorstyles.json?type=MapBox_GL&styleonly=true', | ||
| 61 | center: [116.4, 39.9], | ||
| 62 | minZoom: 0, | ||
| 63 | zoom: 5 | ||
| 64 | }); | ||
| 65 | map.addControl(new mapboxgl.NavigationControl(), 'top-left'); | ||
| 66 | map.on('load', function () { | ||
| 67 | console.log(map.getStyle().layers); | ||
| 68 | map.setPaintProperty('WorldElements_R@China', 'fill-color', '#a1dab4'); | ||
| 69 | map.setPaintProperty('Country_R@China', 'fill-color', '#f03b20'); | ||
| 70 | map.setPaintProperty('Province_R@China', 'fill-color', '#fd8d3c'); | ||
| 71 | }); | ||
| 72 | } | ||
| 73 | } | ||
| 74 | </script> | ||
| 75 | |||
| 76 | <style scoped> | ||
| 77 | #map { | ||
| 78 | position: absolute; | ||
| 79 | height: 100%; | ||
| 80 | width: 100%; | ||
| 81 | background-color: white | ||
| 82 | } | ||
| 83 | </style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
src/main.js
0 → 100644
| 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 'ant-design-vue/dist/antd.css' | ||
| 7 | |||
| 8 | Vue.config.productionTip = false | ||
| 9 | |||
| 10 | /* eslint-disable no-new */ | ||
| 11 | new Vue({ | ||
| 12 | el: '#app', | ||
| 13 | router, | ||
| 14 | components: { App }, | ||
| 15 | template: '<App/>' | ||
| 16 | }) |
src/router/index.js
0 → 100644
static/.gitkeep
0 → 100644
File mode changed
static/css/mapbox-gl.css
0 → 100644
| 1 | .mapboxgl-map { | ||
| 2 | font: 12px/20px 'Helvetica Neue', Arial, Helvetica, sans-serif; | ||
| 3 | overflow: hidden; | ||
| 4 | position: relative; | ||
| 5 | -webkit-tap-highlight-color: rgba(0, 0, 0, 0); | ||
| 6 | text-align: left; | ||
| 7 | } | ||
| 8 | |||
| 9 | .mapboxgl-map:-webkit-full-screen { | ||
| 10 | width: 100%; | ||
| 11 | height: 100%; | ||
| 12 | } | ||
| 13 | |||
| 14 | .mapboxgl-canary { | ||
| 15 | background-color: salmon; | ||
| 16 | } | ||
| 17 | |||
| 18 | .mapboxgl-canvas-container.mapboxgl-interactive, | ||
| 19 | .mapboxgl-ctrl-group > button.mapboxgl-ctrl-compass { | ||
| 20 | cursor: -webkit-grab; | ||
| 21 | cursor: -moz-grab; | ||
| 22 | cursor: grab; | ||
| 23 | -moz-user-select: none; | ||
| 24 | -webkit-user-select: none; | ||
| 25 | -ms-user-select: none; | ||
| 26 | user-select: none; | ||
| 27 | } | ||
| 28 | |||
| 29 | .mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer { | ||
| 30 | cursor: pointer; | ||
| 31 | } | ||
| 32 | |||
| 33 | .mapboxgl-canvas-container.mapboxgl-interactive:active, | ||
| 34 | .mapboxgl-ctrl-group > button.mapboxgl-ctrl-compass:active { | ||
| 35 | cursor: -webkit-grabbing; | ||
| 36 | cursor: -moz-grabbing; | ||
| 37 | cursor: grabbing; | ||
| 38 | } | ||
| 39 | |||
| 40 | .mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate, | ||
| 41 | .mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas { | ||
| 42 | touch-action: pan-x pan-y; | ||
| 43 | } | ||
| 44 | |||
| 45 | .mapboxgl-canvas-container.mapboxgl-touch-drag-pan, | ||
| 46 | .mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas { | ||
| 47 | touch-action: pinch-zoom; | ||
| 48 | } | ||
| 49 | |||
| 50 | .mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan, | ||
| 51 | .mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas { | ||
| 52 | touch-action: none; | ||
| 53 | } | ||
| 54 | |||
| 55 | .mapboxgl-ctrl-top-left, | ||
| 56 | .mapboxgl-ctrl-top-right, | ||
| 57 | .mapboxgl-ctrl-bottom-left, | ||
| 58 | .mapboxgl-ctrl-bottom-right { position: absolute; pointer-events: none; z-index: 2; } | ||
| 59 | .mapboxgl-ctrl-top-left { top: 0; left: 0; } | ||
| 60 | .mapboxgl-ctrl-top-right { top: 0; right: 0; } | ||
| 61 | .mapboxgl-ctrl-bottom-left { bottom: 0; left: 0; } | ||
| 62 | .mapboxgl-ctrl-bottom-right { right: 0; bottom: 0; } | ||
| 63 | |||
| 64 | .mapboxgl-ctrl { | ||
| 65 | clear: both; | ||
| 66 | pointer-events: auto; | ||
| 67 | |||
| 68 | /* workaround for a Safari bug https://github.com/mapbox/mapbox-gl-js/issues/8185 */ | ||
| 69 | transform: translate(0, 0); | ||
| 70 | } | ||
| 71 | .mapboxgl-ctrl-top-left .mapboxgl-ctrl { margin: 10px 0 0 10px; float: left; } | ||
| 72 | .mapboxgl-ctrl-top-right .mapboxgl-ctrl { margin: 10px 10px 0 0; float: right; } | ||
| 73 | .mapboxgl-ctrl-bottom-left .mapboxgl-ctrl { margin: 0 0 10px 10px; float: left; } | ||
| 74 | .mapboxgl-ctrl-bottom-right .mapboxgl-ctrl { margin: 0 10px 10px 0; float: right; } | ||
| 75 | |||
| 76 | .mapboxgl-ctrl-group { | ||
| 77 | border-radius: 4px; | ||
| 78 | background: #fff; | ||
| 79 | } | ||
| 80 | |||
| 81 | .mapboxgl-ctrl-group:not(:empty) { | ||
| 82 | -moz-box-shadow: 0 0 2px rgba(0, 0, 0, 0.1); | ||
| 83 | -webkit-box-shadow: 0 0 2px rgba(0, 0, 0, 0.1); | ||
| 84 | box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1); | ||
| 85 | } | ||
| 86 | |||
| 87 | .mapboxgl-ctrl-group > button { | ||
| 88 | width: 30px; | ||
| 89 | height: 30px; | ||
| 90 | display: block; | ||
| 91 | padding: 0; | ||
| 92 | outline: none; | ||
| 93 | border: 0; | ||
| 94 | box-sizing: border-box; | ||
| 95 | background-color: transparent; | ||
| 96 | cursor: pointer; | ||
| 97 | } | ||
| 98 | |||
| 99 | .mapboxgl-ctrl-group > button + button { | ||
| 100 | border-top: 1px solid #ddd; | ||
| 101 | } | ||
| 102 | |||
| 103 | /* https://bugzilla.mozilla.org/show_bug.cgi?id=140562 */ | ||
| 104 | .mapboxgl-ctrl > button::-moz-focus-inner { | ||
| 105 | border: 0; | ||
| 106 | padding: 0; | ||
| 107 | } | ||
| 108 | |||
| 109 | .mapboxgl-ctrl > button:hover { | ||
| 110 | background-color: rgba(0, 0, 0, 0.05); | ||
| 111 | } | ||
| 112 | |||
| 113 | .mapboxgl-ctrl-group > button:focus { | ||
| 114 | box-shadow: 0 0 2px 2px rgba(0, 150, 255, 1); | ||
| 115 | } | ||
| 116 | |||
| 117 | .mapboxgl-ctrl-group > button:focus:focus-visible { | ||
| 118 | box-shadow: 0 0 2px 2px rgba(0, 150, 255, 1); | ||
| 119 | } | ||
| 120 | |||
| 121 | .mapboxgl-ctrl-group > button:focus:not(:focus-visible) { | ||
| 122 | box-shadow: none; | ||
| 123 | } | ||
| 124 | |||
| 125 | .mapboxgl-ctrl-group > button:focus:first-child { | ||
| 126 | border-radius: 4px 4px 0 0; | ||
| 127 | } | ||
| 128 | |||
| 129 | .mapboxgl-ctrl-group > button:focus:last-child { | ||
| 130 | border-radius: 0 0 4px 4px; | ||
| 131 | } | ||
| 132 | |||
| 133 | .mapboxgl-ctrl-group > button:focus:only-child { | ||
| 134 | border-radius: inherit; | ||
| 135 | } | ||
| 136 | |||
| 137 | .mapboxgl-ctrl-icon, | ||
| 138 | .mapboxgl-ctrl-icon > .mapboxgl-ctrl-compass-arrow { | ||
| 139 | speak: none; | ||
| 140 | -webkit-font-smoothing: antialiased; | ||
| 141 | -moz-osx-font-smoothing: grayscale; | ||
| 142 | } | ||
| 143 | |||
| 144 | .mapboxgl-ctrl-icon { | ||
| 145 | padding: 5px; | ||
| 146 | } | ||
| 147 | |||
| 148 | .mapboxgl-ctrl-icon.mapboxgl-ctrl-icon-disabled { | ||
| 149 | opacity: 0.25; | ||
| 150 | border-color: #373737; | ||
| 151 | } | ||
| 152 | |||
| 153 | .mapboxgl-ctrl-icon.mapboxgl-ctrl-zoom-out { | ||
| 154 | background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E %3Cpath style='fill:%23333333;' d='m 7,9 c -0.554,0 -1,0.446 -1,1 0,0.554 0.446,1 1,1 l 6,0 c 0.554,0 1,-0.446 1,-1 0,-0.554 -0.446,-1 -1,-1 z'/%3E %3C/svg%3E"); | ||
| 155 | } | ||
| 156 | |||
| 157 | .mapboxgl-ctrl-icon.mapboxgl-ctrl-zoom-in { | ||
| 158 | background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E %3Cpath style='fill:%23333333;' d='M 10 6 C 9.446 6 9 6.4459904 9 7 L 9 9 L 7 9 C 6.446 9 6 9.446 6 10 C 6 10.554 6.446 11 7 11 L 9 11 L 9 13 C 9 13.55401 9.446 14 10 14 C 10.554 14 11 13.55401 11 13 L 11 11 L 13 11 C 13.554 11 14 10.554 14 10 C 14 9.446 13.554 9 13 9 L 11 9 L 11 7 C 11 6.4459904 10.554 6 10 6 z'/%3E %3C/svg%3E"); | ||
| 159 | } | ||
| 160 | |||
| 161 | .mapboxgl-ctrl-icon.mapboxgl-ctrl-geolocate::before { | ||
| 162 | background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E %3Cpath d='M10 4C9 4 9 5 9 5L9 5.1A5 5 0 0 0 5.1 9L5 9C5 9 4 9 4 10 4 11 5 11 5 11L5.1 11A5 5 0 0 0 9 14.9L9 15C9 15 9 16 10 16 11 16 11 15 11 15L11 14.9A5 5 0 0 0 14.9 11L15 11C15 11 16 11 16 10 16 9 15 9 15 9L14.9 9A5 5 0 0 0 11 5.1L11 5C11 5 11 4 10 4zM10 6.5A3.5 3.5 0 0 1 13.5 10 3.5 3.5 0 0 1 10 13.5 3.5 3.5 0 0 1 6.5 10 3.5 3.5 0 0 1 10 6.5zM10 8.3A1.8 1.8 0 0 0 8.3 10 1.8 1.8 0 0 0 10 11.8 1.8 1.8 0 0 0 11.8 10 1.8 1.8 0 0 0 10 8.3z'/%3E %3C/svg%3E"); | ||
| 163 | content: ""; | ||
| 164 | display: block; | ||
| 165 | width: 100%; | ||
| 166 | height: 100%; | ||
| 167 | } | ||
| 168 | |||
| 169 | .mapboxgl-ctrl-icon.mapboxgl-ctrl-geolocate::before:disabled { | ||
| 170 | background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23aaa'%3E %3Cpath d='M10 4C9 4 9 5 9 5L9 5.1A5 5 0 0 0 5.1 9L5 9C5 9 4 9 4 10 4 11 5 11 5 11L5.1 11A5 5 0 0 0 9 14.9L9 15C9 15 9 16 10 16 11 16 11 15 11 15L11 14.9A5 5 0 0 0 14.9 11L15 11C15 11 16 11 16 10 16 9 15 9 15 9L14.9 9A5 5 0 0 0 11 5.1L11 5C11 5 11 4 10 4zM10 6.5A3.5 3.5 0 0 1 13.5 10 3.5 3.5 0 0 1 10 13.5 3.5 3.5 0 0 1 6.5 10 3.5 3.5 0 0 1 10 6.5zM10 8.3A1.8 1.8 0 0 0 8.3 10 1.8 1.8 0 0 0 10 11.8 1.8 1.8 0 0 0 11.8 10 1.8 1.8 0 0 0 10 8.3z'/%3E %3C/svg%3E"); | ||
| 171 | } | ||
| 172 | |||
| 173 | .mapboxgl-ctrl-icon.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active::before { | ||
| 174 | background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E %3Cpath d='M10 4C9 4 9 5 9 5L9 5.1A5 5 0 0 0 5.1 9L5 9C5 9 4 9 4 10 4 11 5 11 5 11L5.1 11A5 5 0 0 0 9 14.9L9 15C9 15 9 16 10 16 11 16 11 15 11 15L11 14.9A5 5 0 0 0 14.9 11L15 11C15 11 16 11 16 10 16 9 15 9 15 9L14.9 9A5 5 0 0 0 11 5.1L11 5C11 5 11 4 10 4zM10 6.5A3.5 3.5 0 0 1 13.5 10 3.5 3.5 0 0 1 10 13.5 3.5 3.5 0 0 1 6.5 10 3.5 3.5 0 0 1 10 6.5zM10 8.3A1.8 1.8 0 0 0 8.3 10 1.8 1.8 0 0 0 10 11.8 1.8 1.8 0 0 0 11.8 10 1.8 1.8 0 0 0 10 8.3z'/%3E %3C/svg%3E"); | ||
| 175 | } | ||
| 176 | |||
| 177 | .mapboxgl-ctrl-icon.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error::before { | ||
| 178 | background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E %3Cpath d='M10 4C9 4 9 5 9 5L9 5.1A5 5 0 0 0 5.1 9L5 9C5 9 4 9 4 10 4 11 5 11 5 11L5.1 11A5 5 0 0 0 9 14.9L9 15C9 15 9 16 10 16 11 16 11 15 11 15L11 14.9A5 5 0 0 0 14.9 11L15 11C15 11 16 11 16 10 16 9 15 9 15 9L14.9 9A5 5 0 0 0 11 5.1L11 5C11 5 11 4 10 4zM10 6.5A3.5 3.5 0 0 1 13.5 10 3.5 3.5 0 0 1 10 13.5 3.5 3.5 0 0 1 6.5 10 3.5 3.5 0 0 1 10 6.5zM10 8.3A1.8 1.8 0 0 0 8.3 10 1.8 1.8 0 0 0 10 11.8 1.8 1.8 0 0 0 11.8 10 1.8 1.8 0 0 0 10 8.3z'/%3E %3C/svg%3E"); | ||
| 179 | } | ||
| 180 | |||
| 181 | .mapboxgl-ctrl-icon.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background::before { | ||
| 182 | background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E %3Cpath d='M 10,4 C 9,4 9,5 9,5 L 9,5.1 C 7.0357113,5.5006048 5.5006048,7.0357113 5.1,9 L 5,9 c 0,0 -1,0 -1,1 0,1 1,1 1,1 l 0.1,0 c 0.4006048,1.964289 1.9357113,3.499395 3.9,3.9 L 9,15 c 0,0 0,1 1,1 1,0 1,-1 1,-1 l 0,-0.1 c 1.964289,-0.400605 3.499395,-1.935711 3.9,-3.9 l 0.1,0 c 0,0 1,0 1,-1 C 16,9 15,9 15,9 L 14.9,9 C 14.499395,7.0357113 12.964289,5.5006048 11,5.1 L 11,5 c 0,0 0,-1 -1,-1 z m 0,2.5 c 1.932997,0 3.5,1.5670034 3.5,3.5 0,1.932997 -1.567003,3.5 -3.5,3.5 C 8.0670034,13.5 6.5,11.932997 6.5,10 6.5,8.0670034 8.0670034,6.5 10,6.5 Z'/%3E %3C/svg%3E"); | ||
| 183 | } | ||
| 184 | |||
| 185 | .mapboxgl-ctrl-icon.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error::before { | ||
| 186 | background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E %3Cpath d='M 10,4 C 9,4 9,5 9,5 L 9,5.1 C 7.0357113,5.5006048 5.5006048,7.0357113 5.1,9 L 5,9 c 0,0 -1,0 -1,1 0,1 1,1 1,1 l 0.1,0 c 0.4006048,1.964289 1.9357113,3.499395 3.9,3.9 L 9,15 c 0,0 0,1 1,1 1,0 1,-1 1,-1 l 0,-0.1 c 1.964289,-0.400605 3.499395,-1.935711 3.9,-3.9 l 0.1,0 c 0,0 1,0 1,-1 C 16,9 15,9 15,9 L 14.9,9 C 14.499395,7.0357113 12.964289,5.5006048 11,5.1 L 11,5 c 0,0 0,-1 -1,-1 z m 0,2.5 c 1.932997,0 3.5,1.5670034 3.5,3.5 0,1.932997 -1.567003,3.5 -3.5,3.5 C 8.0670034,13.5 6.5,11.932997 6.5,10 6.5,8.0670034 8.0670034,6.5 10,6.5 Z'/%3E %3C/svg%3E"); | ||
| 187 | } | ||
| 188 | |||
| 189 | .mapboxgl-ctrl-icon.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting::before { | ||
| 190 | -webkit-animation: mapboxgl-spin 2s infinite linear; | ||
| 191 | -moz-animation: mapboxgl-spin 2s infinite linear; | ||
| 192 | -o-animation: mapboxgl-spin 2s infinite linear; | ||
| 193 | -ms-animation: mapboxgl-spin 2s infinite linear; | ||
| 194 | animation: mapboxgl-spin 2s infinite linear; | ||
| 195 | } | ||
| 196 | |||
| 197 | @-webkit-keyframes mapboxgl-spin { | ||
| 198 | 0% { -webkit-transform: rotate(0deg); } | ||
| 199 | 100% { -webkit-transform: rotate(360deg); } | ||
| 200 | } | ||
| 201 | |||
| 202 | @-moz-keyframes mapboxgl-spin { | ||
| 203 | 0% { -moz-transform: rotate(0deg); } | ||
| 204 | 100% { -moz-transform: rotate(360deg); } | ||
| 205 | } | ||
| 206 | |||
| 207 | @-o-keyframes mapboxgl-spin { | ||
| 208 | 0% { -o-transform: rotate(0deg); } | ||
| 209 | 100% { -o-transform: rotate(360deg); } | ||
| 210 | } | ||
| 211 | |||
| 212 | @-ms-keyframes mapboxgl-spin { | ||
| 213 | 0% { -ms-transform: rotate(0deg); } | ||
| 214 | 100% { -ms-transform: rotate(360deg); } | ||
| 215 | } | ||
| 216 | |||
| 217 | @keyframes mapboxgl-spin { | ||
| 218 | 0% { transform: rotate(0deg); } | ||
| 219 | 100% { transform: rotate(360deg); } | ||
| 220 | } | ||
| 221 | |||
| 222 | .mapboxgl-ctrl-icon.mapboxgl-ctrl-fullscreen { | ||
| 223 | background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E %3Cpath d='M 5 4 C 4.5 4 4 4.5 4 5 L 4 6 L 4 9 L 4.5 9 L 5.7773438 7.296875 C 6.7771319 8.0602131 7.835765 8.9565728 8.890625 10 C 7.8257121 11.0633 6.7761791 11.951675 5.78125 12.707031 L 4.5 11 L 4 11 L 4 15 C 4 15.5 4.5 16 5 16 L 9 16 L 9 15.5 L 7.2734375 14.205078 C 8.0428931 13.187886 8.9395441 12.133481 9.9609375 11.068359 C 11.042371 12.14699 11.942093 13.2112 12.707031 14.21875 L 11 15.5 L 11 16 L 14 16 L 15 16 C 15.5 16 16 15.5 16 15 L 16 14 L 16 11 L 15.5 11 L 14.205078 12.726562 C 13.177985 11.949617 12.112718 11.043577 11.037109 10.009766 C 12.151856 8.981061 13.224345 8.0798624 14.228516 7.3046875 L 15.5 9 L 16 9 L 16 5 C 16 4.5 15.5 4 15 4 L 11 4 L 11 4.5 L 12.703125 5.7773438 C 11.932647 6.7864834 11.026693 7.8554712 9.9707031 8.9199219 C 8.9584739 7.8204943 8.0698767 6.7627188 7.3046875 5.7714844 L 9 4.5 L 9 4 L 6 4 L 5 4 z '/%3E %3C/svg%3E"); | ||
| 224 | } | ||
| 225 | |||
| 226 | .mapboxgl-ctrl-icon.mapboxgl-ctrl-shrink { | ||
| 227 | background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E %3Cpath style='fill:%23000000;' d='M 4.2421875 3.4921875 A 0.750075 0.750075 0 0 0 3.71875 4.78125 L 5.9648438 7.0273438 L 4 8.5 L 4 9 L 8 9 C 8.500001 8.9999988 9 8.4999992 9 8 L 9 4 L 8.5 4 L 7.0175781 5.9550781 L 4.78125 3.71875 A 0.750075 0.750075 0 0 0 4.2421875 3.4921875 z M 15.734375 3.4921875 A 0.750075 0.750075 0 0 0 15.21875 3.71875 L 12.984375 5.953125 L 11.5 4 L 11 4 L 11 8 C 11 8.4999992 11.499999 8.9999988 12 9 L 16 9 L 16 8.5 L 14.035156 7.0273438 L 16.28125 4.78125 A 0.750075 0.750075 0 0 0 15.734375 3.4921875 z M 4 11 L 4 11.5 L 5.9648438 12.972656 L 3.71875 15.21875 A 0.75130096 0.75130096 0 1 0 4.78125 16.28125 L 7.0273438 14.035156 L 8.5 16 L 9 16 L 9 12 C 9 11.500001 8.500001 11.000001 8 11 L 4 11 z M 12 11 C 11.499999 11.000001 11 11.500001 11 12 L 11 16 L 11.5 16 L 12.972656 14.035156 L 15.21875 16.28125 A 0.75130096 0.75130096 0 1 0 16.28125 15.21875 L 14.035156 12.972656 L 16 11.5 L 16 11 L 12 11 z '/%3E %3C/svg%3E"); | ||
| 228 | } | ||
| 229 | |||
| 230 | .mapboxgl-ctrl-icon.mapboxgl-ctrl-compass > .mapboxgl-ctrl-compass-arrow { | ||
| 231 | width: 20px; | ||
| 232 | height: 20px; | ||
| 233 | margin: 5px; | ||
| 234 | background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E %3Cpolygon fill='%23333333' points='6,9 10,1 14,9'/%3E %3Cpolygon fill='%23CCCCCC' points='6,11 10,19 14,11 '/%3E %3C/svg%3E"); | ||
| 235 | background-repeat: no-repeat; | ||
| 236 | display: inline-block; | ||
| 237 | } | ||
| 238 | |||
| 239 | a.mapboxgl-ctrl-logo { | ||
| 240 | width: 85px; | ||
| 241 | height: 21px; | ||
| 242 | margin: 0 0 -3px -3px; | ||
| 243 | display: block; | ||
| 244 | background-repeat: no-repeat; | ||
| 245 | cursor: pointer; | ||
| 246 | background-image: url("data:image/svg+xml;charset=utf-8,%3C?xml version='1.0' encoding='utf-8'?%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 84.49 21' style='enable-background:new 0 0 84.49 21;' xml:space='preserve'%3E%3Cg%3E %3Cpath class='st0' style='opacity:0.9; fill: %23FFFFFF; enable-background: new;' d='M83.25,14.26c0,0.12-0.09,0.21-0.21,0.21h-1.61c-0.13,0-0.24-0.06-0.3-0.17l-1.44-2.39l-1.44,2.39 c-0.06,0.11-0.18,0.17-0.3,0.17h-1.61c-0.04,0-0.08-0.01-0.12-0.03c-0.09-0.06-0.13-0.19-0.06-0.28l0,0l2.43-3.68L76.2,6.84 c-0.02-0.03-0.03-0.07-0.03-0.12c0-0.12,0.09-0.21,0.21-0.21h1.61c0.13,0,0.24,0.06,0.3,0.17l1.41,2.36l1.4-2.35 c0.06-0.11,0.18-0.17,0.3-0.17H83c0.04,0,0.08,0.01,0.12,0.03c0.09,0.06,0.13,0.19,0.06,0.28l0,0l-2.37,3.63l2.43,3.67 C83.24,14.18,83.25,14.22,83.25,14.26z'/%3E %3Cpath class='st0' style='opacity:0.9; fill: %23FFFFFF; enable-background: new;' d='M66.24,9.59c-0.39-1.88-1.96-3.28-3.84-3.28c-1.03,0-2.03,0.42-2.73,1.18V3.51c0-0.13-0.1-0.23-0.23-0.23h-1.4 c-0.13,0-0.23,0.11-0.23,0.23v10.72c0,0.13,0.1,0.23,0.23,0.23h1.4c0.13,0,0.23-0.11,0.23-0.23V13.5c0.71,0.75,1.7,1.18,2.73,1.18 c1.88,0,3.45-1.41,3.84-3.29C66.37,10.79,66.37,10.18,66.24,9.59L66.24,9.59z M62.08,13c-1.32,0-2.39-1.11-2.41-2.48v-0.06 c0.02-1.38,1.09-2.48,2.41-2.48s2.42,1.12,2.42,2.51S63.41,13,62.08,13z'/%3E %3Cpath class='st0' style='opacity:0.9; fill: %23FFFFFF; enable-background: new;' d='M71.67,6.32c-1.98-0.01-3.72,1.35-4.16,3.29c-0.13,0.59-0.13,1.19,0,1.77c0.44,1.94,2.17,3.32,4.17,3.3 c2.35,0,4.26-1.87,4.26-4.19S74.04,6.32,71.67,6.32z M71.65,13.01c-1.33,0-2.42-1.12-2.42-2.51s1.08-2.52,2.42-2.52 c1.33,0,2.42,1.12,2.42,2.51S72.99,13,71.65,13.01L71.65,13.01z'/%3E %3Cpath class='st1' style='opacity:0.35; enable-background:new;' d='M62.08,7.98c-1.32,0-2.39,1.11-2.41,2.48v0.06C59.68,11.9,60.75,13,62.08,13s2.42-1.12,2.42-2.51 S63.41,7.98,62.08,7.98z M62.08,11.76c-0.63,0-1.14-0.56-1.17-1.25v-0.04c0.01-0.69,0.54-1.25,1.17-1.25 c0.63,0,1.17,0.57,1.17,1.27C63.24,11.2,62.73,11.76,62.08,11.76z'/%3E %3Cpath class='st1' style='opacity:0.35; enable-background:new;' d='M71.65,7.98c-1.33,0-2.42,1.12-2.42,2.51S70.32,13,71.65,13s2.42-1.12,2.42-2.51S72.99,7.98,71.65,7.98z M71.65,11.76c-0.64,0-1.17-0.57-1.17-1.27c0-0.7,0.53-1.26,1.17-1.26s1.17,0.57,1.17,1.27C72.82,11.21,72.29,11.76,71.65,11.76z'/%3E %3Cpath class='st0' style='opacity:0.9; fill: %23FFFFFF; enable-background: new;' d='M45.74,6.53h-1.4c-0.13,0-0.23,0.11-0.23,0.23v0.73c-0.71-0.75-1.7-1.18-2.73-1.18 c-2.17,0-3.94,1.87-3.94,4.19s1.77,4.19,3.94,4.19c1.04,0,2.03-0.43,2.73-1.19v0.73c0,0.13,0.1,0.23,0.23,0.23h1.4 c0.13,0,0.23-0.11,0.23-0.23V6.74c0-0.12-0.09-0.22-0.22-0.22C45.75,6.53,45.75,6.53,45.74,6.53z M44.12,10.53 C44.11,11.9,43.03,13,41.71,13s-2.42-1.12-2.42-2.51s1.08-2.52,2.4-2.52c1.33,0,2.39,1.11,2.41,2.48L44.12,10.53z'/%3E %3Cpath class='st1' style='opacity:0.35; enable-background:new;' d='M41.71,7.98c-1.33,0-2.42,1.12-2.42,2.51S40.37,13,41.71,13s2.39-1.11,2.41-2.48v-0.06 C44.1,9.09,43.03,7.98,41.71,7.98z M40.55,10.49c0-0.7,0.52-1.27,1.17-1.27c0.64,0,1.14,0.56,1.17,1.25v0.04 c-0.01,0.68-0.53,1.24-1.17,1.24C41.08,11.75,40.55,11.19,40.55,10.49z'/%3E %3Cpath class='st0' style='opacity:0.9; fill: %23FFFFFF; enable-background: new;' d='M52.41,6.32c-1.03,0-2.03,0.42-2.73,1.18V6.75c0-0.13-0.1-0.23-0.23-0.23h-1.4c-0.13,0-0.23,0.11-0.23,0.23 v10.72c0,0.13,0.1,0.23,0.23,0.23h1.4c0.13,0,0.23-0.1,0.23-0.23V13.5c0.71,0.75,1.7,1.18,2.74,1.18c2.17,0,3.94-1.87,3.94-4.19 S54.58,6.32,52.41,6.32z M52.08,13.01c-1.32,0-2.39-1.11-2.42-2.48v-0.07c0.02-1.38,1.09-2.49,2.4-2.49c1.32,0,2.41,1.12,2.41,2.51 S53.4,13,52.08,13.01L52.08,13.01z'/%3E %3Cpath class='st1' style='opacity:0.35; enable-background:new;' d='M52.08,7.98c-1.32,0-2.39,1.11-2.42,2.48v0.06c0.03,1.38,1.1,2.48,2.42,2.48s2.41-1.12,2.41-2.51 S53.4,7.98,52.08,7.98z M52.08,11.76c-0.63,0-1.14-0.56-1.17-1.25v-0.04c0.01-0.69,0.54-1.25,1.17-1.25c0.63,0,1.17,0.58,1.17,1.27 S52.72,11.76,52.08,11.76z'/%3E %3Cpath class='st0' style='opacity:0.9; fill: %23FFFFFF; enable-background: new;' d='M36.08,14.24c0,0.13-0.1,0.23-0.23,0.23h-1.41c-0.13,0-0.23-0.11-0.23-0.23V9.68c0-0.98-0.74-1.71-1.62-1.71 c-0.8,0-1.46,0.7-1.59,1.62l0.01,4.66c0,0.13-0.11,0.23-0.23,0.23h-1.41c-0.13,0-0.23-0.11-0.23-0.23V9.68 c0-0.98-0.74-1.71-1.62-1.71c-0.85,0-1.54,0.79-1.6,1.8v4.48c0,0.13-0.1,0.23-0.23,0.23h-1.4c-0.13,0-0.23-0.11-0.23-0.23V6.74 c0.01-0.13,0.1-0.22,0.23-0.22h1.4c0.13,0,0.22,0.11,0.23,0.22V7.4c0.5-0.68,1.3-1.09,2.16-1.1h0.03c1.09,0,2.09,0.6,2.6,1.55 c0.45-0.95,1.4-1.55,2.44-1.56c1.62,0,2.93,1.25,2.9,2.78L36.08,14.24z'/%3E %3Cpath class='st1' style='opacity:0.35; enable-background:new;' d='M84.34,13.59l-0.07-0.13l-1.96-2.99l1.94-2.95c0.44-0.67,0.26-1.56-0.41-2.02c-0.02,0-0.03,0-0.04-0.01 c-0.23-0.15-0.5-0.22-0.78-0.22h-1.61c-0.56,0-1.08,0.29-1.37,0.78L79.72,6.6l-0.34-0.56C79.09,5.56,78.57,5.27,78,5.27h-1.6 c-0.6,0-1.13,0.37-1.35,0.92c-2.19-1.66-5.28-1.47-7.26,0.45c-0.35,0.34-0.65,0.72-0.89,1.14c-0.9-1.62-2.58-2.72-4.5-2.72 c-0.5,0-1.01,0.07-1.48,0.23V3.51c0-0.82-0.66-1.48-1.47-1.48h-1.4c-0.81,0-1.47,0.66-1.47,1.47v3.75 c-0.95-1.36-2.5-2.18-4.17-2.19c-0.74,0-1.46,0.16-2.12,0.47c-0.24-0.17-0.54-0.26-0.84-0.26h-1.4c-0.45,0-0.87,0.21-1.15,0.56 c-0.02-0.03-0.04-0.05-0.07-0.08c-0.28-0.3-0.68-0.47-1.09-0.47h-1.39c-0.3,0-0.6,0.09-0.84,0.26c-0.67-0.3-1.39-0.46-2.12-0.46 c-1.83,0-3.43,1-4.37,2.5c-0.2-0.46-0.48-0.89-0.83-1.25c-0.8-0.81-1.89-1.25-3.02-1.25h-0.01c-0.89,0.01-1.75,0.33-2.46,0.88 c-0.74-0.57-1.64-0.88-2.57-0.88H28.1c-0.29,0-0.58,0.03-0.86,0.11c-0.28,0.06-0.56,0.16-0.82,0.28c-0.21-0.12-0.45-0.18-0.7-0.18 h-1.4c-0.82,0-1.47,0.66-1.47,1.47v7.5c0,0.82,0.66,1.47,1.47,1.47h1.4c0.82,0,1.48-0.66,1.48-1.48l0,0V9.79 c0.03-0.36,0.23-0.59,0.36-0.59c0.18,0,0.38,0.18,0.38,0.47v4.57c0,0.82,0.66,1.47,1.47,1.47h1.41c0.82,0,1.47-0.66,1.47-1.47 l-0.01-4.57c0.06-0.32,0.25-0.47,0.35-0.47c0.18,0,0.38,0.18,0.38,0.47v4.57c0,0.82,0.66,1.47,1.47,1.47h1.41 c0.82,0,1.47-0.66,1.47-1.47v-0.38c0.96,1.29,2.46,2.06,4.06,2.06c0.74,0,1.46-0.16,2.12-0.47c0.24,0.17,0.54,0.26,0.84,0.26h1.39 c0.3,0,0.6-0.09,0.84-0.26v2.01c0,0.82,0.66,1.47,1.47,1.47h1.4c0.82,0,1.47-0.66,1.47-1.47v-1.77c0.48,0.15,0.99,0.23,1.49,0.22 c1.7,0,3.22-0.87,4.17-2.2v0.52c0,0.82,0.66,1.47,1.47,1.47h1.4c0.3,0,0.6-0.09,0.84-0.26c0.66,0.31,1.39,0.47,2.12,0.47 c1.92,0,3.6-1.1,4.49-2.73c1.54,2.65,4.95,3.53,7.58,1.98c0.18-0.11,0.36-0.22,0.53-0.36c0.22,0.55,0.76,0.91,1.35,0.9H78 c0.56,0,1.08-0.29,1.37-0.78l0.37-0.61l0.37,0.61c0.29,0.48,0.81,0.78,1.38,0.78h1.6c0.81,0,1.46-0.66,1.45-1.46 C84.49,14.02,84.44,13.8,84.34,13.59L84.34,13.59z M35.86,14.47h-1.41c-0.13,0-0.23-0.11-0.23-0.23V9.68 c0-0.98-0.74-1.71-1.62-1.71c-0.8,0-1.46,0.7-1.59,1.62l0.01,4.66c0,0.13-0.1,0.23-0.23,0.23h-1.41c-0.13,0-0.23-0.11-0.23-0.23 V9.68c0-0.98-0.74-1.71-1.62-1.71c-0.85,0-1.54,0.79-1.6,1.8v4.48c0,0.13-0.1,0.23-0.23,0.23h-1.4c-0.13,0-0.23-0.11-0.23-0.23 V6.74c0.01-0.13,0.11-0.22,0.23-0.22h1.4c0.13,0,0.22,0.11,0.23,0.22V7.4c0.5-0.68,1.3-1.09,2.16-1.1h0.03 c1.09,0,2.09,0.6,2.6,1.55c0.45-0.95,1.4-1.55,2.44-1.56c1.62,0,2.93,1.25,2.9,2.78l0.01,5.16C36.09,14.36,35.98,14.46,35.86,14.47 L35.86,14.47z M45.97,14.24c0,0.13-0.1,0.23-0.23,0.23h-1.4c-0.13,0-0.23-0.11-0.23-0.23V13.5c-0.7,0.76-1.69,1.18-2.72,1.18 c-2.17,0-3.94-1.87-3.94-4.19s1.77-4.19,3.94-4.19c1.03,0,2.02,0.43,2.73,1.18V6.74c0-0.13,0.1-0.23,0.23-0.23h1.4 c0.12-0.01,0.22,0.08,0.23,0.21c0,0.01,0,0.01,0,0.02v7.51h-0.01V14.24z M52.41,14.67c-1.03,0-2.02-0.43-2.73-1.18v3.97 c0,0.13-0.1,0.23-0.23,0.23h-1.4c-0.13,0-0.23-0.1-0.23-0.23V6.75c0-0.13,0.1-0.22,0.23-0.22h1.4c0.13,0,0.23,0.11,0.23,0.23v0.73 c0.71-0.76,1.7-1.18,2.73-1.18c2.17,0,3.94,1.86,3.94,4.18S54.58,14.67,52.41,14.67z M66.24,11.39c-0.39,1.87-1.96,3.29-3.84,3.29 c-1.03,0-2.02-0.43-2.73-1.18v0.73c0,0.13-0.1,0.23-0.23,0.23h-1.4c-0.13,0-0.23-0.11-0.23-0.23V3.51c0-0.13,0.1-0.23,0.23-0.23 h1.4c0.13,0,0.23,0.11,0.23,0.23v3.97c0.71-0.75,1.7-1.18,2.73-1.17c1.88,0,3.45,1.4,3.84,3.28C66.37,10.19,66.37,10.8,66.24,11.39 L66.24,11.39L66.24,11.39z M71.67,14.68c-2,0.01-3.73-1.35-4.17-3.3c-0.13-0.59-0.13-1.19,0-1.77c0.44-1.94,2.17-3.31,4.17-3.3 c2.36,0,4.26,1.87,4.26,4.19S74.03,14.68,71.67,14.68L71.67,14.68z M83.04,14.47h-1.61c-0.13,0-0.24-0.06-0.3-0.17l-1.44-2.39 l-1.44,2.39c-0.06,0.11-0.18,0.17-0.3,0.17h-1.61c-0.04,0-0.08-0.01-0.12-0.03c-0.09-0.06-0.13-0.19-0.06-0.28l0,0l2.43-3.68 L76.2,6.84c-0.02-0.03-0.03-0.07-0.03-0.12c0-0.12,0.09-0.21,0.21-0.21h1.61c0.13,0,0.24,0.06,0.3,0.17l1.41,2.36l1.41-2.36 c0.06-0.11,0.18-0.17,0.3-0.17h1.61c0.04,0,0.08,0.01,0.12,0.03c0.09,0.06,0.13,0.19,0.06,0.28l0,0l-2.38,3.64l2.43,3.67 c0.02,0.03,0.03,0.07,0.03,0.12C83.25,14.38,83.16,14.47,83.04,14.47L83.04,14.47L83.04,14.47z'/%3E %3Cpath class='st0' style='opacity:0.9; fill: %23FFFFFF; enable-background: new;' d='M10.5,1.24c-5.11,0-9.25,4.15-9.25,9.25s4.15,9.25,9.25,9.25s9.25-4.15,9.25-9.25 C19.75,5.38,15.61,1.24,10.5,1.24z M14.89,12.77c-1.93,1.93-4.78,2.31-6.7,2.31c-0.7,0-1.41-0.05-2.1-0.16c0,0-1.02-5.64,2.14-8.81 c0.83-0.83,1.95-1.28,3.13-1.28c1.27,0,2.49,0.51,3.39,1.42C16.59,8.09,16.64,11,14.89,12.77z'/%3E %3Cpath class='st1' style='opacity:0.35; enable-background:new;' d='M10.5-0.01C4.7-0.01,0,4.7,0,10.49s4.7,10.5,10.5,10.5S21,16.29,21,10.49C20.99,4.7,16.3-0.01,10.5-0.01z M10.5,19.74c-5.11,0-9.25-4.15-9.25-9.25s4.14-9.26,9.25-9.26s9.25,4.15,9.25,9.25C19.75,15.61,15.61,19.74,10.5,19.74z'/%3E %3Cpath class='st1' style='opacity:0.35; enable-background:new;' d='M14.74,6.25C12.9,4.41,9.98,4.35,8.23,6.1c-3.16,3.17-2.14,8.81-2.14,8.81s5.64,1.02,8.81-2.14 C16.64,11,16.59,8.09,14.74,6.25z M12.47,10.34l-0.91,1.87l-0.9-1.87L8.8,9.43l1.86-0.9l0.9-1.87l0.91,1.87l1.86,0.9L12.47,10.34z'/%3E %3Cpolygon class='st0' style='opacity:0.9; fill: %23FFFFFF; enable-background: new;' points='14.33,9.43 12.47,10.34 11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 '/%3E%3C/g%3E%3C/svg%3E"); | ||
| 247 | } | ||
| 248 | |||
| 249 | a.mapboxgl-ctrl-logo.mapboxgl-compact { | ||
| 250 | width: 21px; | ||
| 251 | height: 21px; | ||
| 252 | background-image: url("data:image/svg+xml;charset=utf-8,%3C?xml version='1.0' encoding='utf-8'?%3E %3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 21 21' style='enable-background:new 0 0 21 21;' xml:space='preserve'%3E%3Cg transform='translate(0,0.01)'%3E%3Cpath d='m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z' style='opacity:0.9;fill:%23ffffff;enable-background:new' class='st0'/%3E%3Cpath d='M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z' style='opacity:0.35;enable-background:new' class='st1'/%3E%3Cpath d='M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z' style='opacity:0.35;enable-background:new' class='st1'/%3E%3Cpolygon points='11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 ' style='opacity:0.9;fill:%23ffffff;enable-background:new' class='st0'/%3E%3C/g%3E%3C/svg%3E"); | ||
| 253 | } | ||
| 254 | |||
| 255 | .mapboxgl-ctrl.mapboxgl-ctrl-attrib { | ||
| 256 | padding: 0 5px; | ||
| 257 | background-color: rgba(255, 255, 255, 0.5); | ||
| 258 | margin: 0; | ||
| 259 | } | ||
| 260 | |||
| 261 | @media screen { | ||
| 262 | .mapboxgl-ctrl-attrib.mapboxgl-compact { | ||
| 263 | min-height: 20px; | ||
| 264 | padding: 0; | ||
| 265 | margin: 10px; | ||
| 266 | position: relative; | ||
| 267 | background-color: #fff; | ||
| 268 | border-radius: 3px 12px 12px 3px; | ||
| 269 | } | ||
| 270 | |||
| 271 | .mapboxgl-ctrl-attrib.mapboxgl-compact:hover { | ||
| 272 | padding: 2px 24px 2px 4px; | ||
| 273 | visibility: visible; | ||
| 274 | margin-top: 6px; | ||
| 275 | } | ||
| 276 | |||
| 277 | .mapboxgl-ctrl-top-left > .mapboxgl-ctrl-attrib.mapboxgl-compact:hover, | ||
| 278 | .mapboxgl-ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact:hover { | ||
| 279 | padding: 2px 4px 2px 24px; | ||
| 280 | border-radius: 12px 3px 3px 12px; | ||
| 281 | } | ||
| 282 | |||
| 283 | .mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner { | ||
| 284 | display: none; | ||
| 285 | } | ||
| 286 | |||
| 287 | .mapboxgl-ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner { | ||
| 288 | display: block; | ||
| 289 | } | ||
| 290 | |||
| 291 | .mapboxgl-ctrl-attrib.mapboxgl-compact::after { | ||
| 292 | content: ''; | ||
| 293 | cursor: pointer; | ||
| 294 | position: absolute; | ||
| 295 | background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E %3Cpath fill='%23333333' fill-rule='evenodd' d='M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0'/%3E %3C/svg%3E"); | ||
| 296 | background-color: rgba(255, 255, 255, 0.5); | ||
| 297 | width: 24px; | ||
| 298 | height: 24px; | ||
| 299 | box-sizing: border-box; | ||
| 300 | border-radius: 12px; | ||
| 301 | } | ||
| 302 | |||
| 303 | .mapboxgl-ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after { | ||
| 304 | bottom: 0; | ||
| 305 | right: 0; | ||
| 306 | } | ||
| 307 | |||
| 308 | .mapboxgl-ctrl-top-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after { | ||
| 309 | top: 0; | ||
| 310 | right: 0; | ||
| 311 | } | ||
| 312 | |||
| 313 | .mapboxgl-ctrl-top-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after { | ||
| 314 | top: 0; | ||
| 315 | left: 0; | ||
| 316 | } | ||
| 317 | |||
| 318 | .mapboxgl-ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after { | ||
| 319 | bottom: 0; | ||
| 320 | left: 0; | ||
| 321 | } | ||
| 322 | } | ||
| 323 | |||
| 324 | .mapboxgl-ctrl-attrib a { | ||
| 325 | color: rgba(0, 0, 0, 0.75); | ||
| 326 | text-decoration: none; | ||
| 327 | } | ||
| 328 | |||
| 329 | .mapboxgl-ctrl-attrib a:hover { | ||
| 330 | color: inherit; | ||
| 331 | text-decoration: underline; | ||
| 332 | } | ||
| 333 | |||
| 334 | /* stylelint-disable-next-line selector-class-pattern */ | ||
| 335 | .mapboxgl-ctrl-attrib .mapbox-improve-map { | ||
| 336 | font-weight: bold; | ||
| 337 | margin-left: 2px; | ||
| 338 | } | ||
| 339 | |||
| 340 | .mapboxgl-attrib-empty { | ||
| 341 | display: none; | ||
| 342 | } | ||
| 343 | |||
| 344 | .mapboxgl-ctrl-scale { | ||
| 345 | background-color: rgba(255, 255, 255, 0.75); | ||
| 346 | font-size: 10px; | ||
| 347 | border-width: medium 2px 2px; | ||
| 348 | border-style: none solid solid; | ||
| 349 | border-color: #333; | ||
| 350 | padding: 0 5px; | ||
| 351 | color: #333; | ||
| 352 | box-sizing: border-box; | ||
| 353 | } | ||
| 354 | |||
| 355 | .mapboxgl-popup { | ||
| 356 | position: absolute; | ||
| 357 | top: 0; | ||
| 358 | left: 0; | ||
| 359 | display: -webkit-flex; | ||
| 360 | display: flex; | ||
| 361 | will-change: transform; | ||
| 362 | pointer-events: none; | ||
| 363 | } | ||
| 364 | |||
| 365 | .mapboxgl-popup-anchor-top, | ||
| 366 | .mapboxgl-popup-anchor-top-left, | ||
| 367 | .mapboxgl-popup-anchor-top-right { | ||
| 368 | -webkit-flex-direction: column; | ||
| 369 | flex-direction: column; | ||
| 370 | } | ||
| 371 | |||
| 372 | .mapboxgl-popup-anchor-bottom, | ||
| 373 | .mapboxgl-popup-anchor-bottom-left, | ||
| 374 | .mapboxgl-popup-anchor-bottom-right { | ||
| 375 | -webkit-flex-direction: column-reverse; | ||
| 376 | flex-direction: column-reverse; | ||
| 377 | } | ||
| 378 | |||
| 379 | .mapboxgl-popup-anchor-left { | ||
| 380 | -webkit-flex-direction: row; | ||
| 381 | flex-direction: row; | ||
| 382 | } | ||
| 383 | |||
| 384 | .mapboxgl-popup-anchor-right { | ||
| 385 | -webkit-flex-direction: row-reverse; | ||
| 386 | flex-direction: row-reverse; | ||
| 387 | } | ||
| 388 | |||
| 389 | .mapboxgl-popup-tip { | ||
| 390 | width: 0; | ||
| 391 | height: 0; | ||
| 392 | border: 10px solid transparent; | ||
| 393 | z-index: 1; | ||
| 394 | } | ||
| 395 | |||
| 396 | .mapboxgl-popup-anchor-top .mapboxgl-popup-tip { | ||
| 397 | -webkit-align-self: center; | ||
| 398 | align-self: center; | ||
| 399 | border-top: none; | ||
| 400 | border-bottom-color: #fff; | ||
| 401 | } | ||
| 402 | |||
| 403 | .mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip { | ||
| 404 | -webkit-align-self: flex-start; | ||
| 405 | align-self: flex-start; | ||
| 406 | border-top: none; | ||
| 407 | border-left: none; | ||
| 408 | border-bottom-color: #fff; | ||
| 409 | } | ||
| 410 | |||
| 411 | .mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip { | ||
| 412 | -webkit-align-self: flex-end; | ||
| 413 | align-self: flex-end; | ||
| 414 | border-top: none; | ||
| 415 | border-right: none; | ||
| 416 | border-bottom-color: #fff; | ||
| 417 | } | ||
| 418 | |||
| 419 | .mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip { | ||
| 420 | -webkit-align-self: center; | ||
| 421 | align-self: center; | ||
| 422 | border-bottom: none; | ||
| 423 | border-top-color: #fff; | ||
| 424 | } | ||
| 425 | |||
| 426 | .mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip { | ||
| 427 | -webkit-align-self: flex-start; | ||
| 428 | align-self: flex-start; | ||
| 429 | border-bottom: none; | ||
| 430 | border-left: none; | ||
| 431 | border-top-color: #fff; | ||
| 432 | } | ||
| 433 | |||
| 434 | .mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip { | ||
| 435 | -webkit-align-self: flex-end; | ||
| 436 | align-self: flex-end; | ||
| 437 | border-bottom: none; | ||
| 438 | border-right: none; | ||
| 439 | border-top-color: #fff; | ||
| 440 | } | ||
| 441 | |||
| 442 | .mapboxgl-popup-anchor-left .mapboxgl-popup-tip { | ||
| 443 | -webkit-align-self: center; | ||
| 444 | align-self: center; | ||
| 445 | border-left: none; | ||
| 446 | border-right-color: #fff; | ||
| 447 | } | ||
| 448 | |||
| 449 | .mapboxgl-popup-anchor-right .mapboxgl-popup-tip { | ||
| 450 | -webkit-align-self: center; | ||
| 451 | align-self: center; | ||
| 452 | border-right: none; | ||
| 453 | border-left-color: #fff; | ||
| 454 | } | ||
| 455 | |||
| 456 | .mapboxgl-popup-close-button { | ||
| 457 | position: absolute; | ||
| 458 | right: 0; | ||
| 459 | top: 0; | ||
| 460 | border: 0; | ||
| 461 | border-radius: 0 3px 0 0; | ||
| 462 | cursor: pointer; | ||
| 463 | background-color: transparent; | ||
| 464 | } | ||
| 465 | |||
| 466 | .mapboxgl-popup-close-button:hover { | ||
| 467 | background-color: rgba(0, 0, 0, 0.05); | ||
| 468 | } | ||
| 469 | |||
| 470 | .mapboxgl-popup-content { | ||
| 471 | position: relative; | ||
| 472 | background: #fff; | ||
| 473 | border-radius: 3px; | ||
| 474 | box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); | ||
| 475 | padding: 10px 10px 15px; | ||
| 476 | pointer-events: auto; | ||
| 477 | } | ||
| 478 | |||
| 479 | .mapboxgl-popup-anchor-top-left .mapboxgl-popup-content { | ||
| 480 | border-top-left-radius: 0; | ||
| 481 | } | ||
| 482 | |||
| 483 | .mapboxgl-popup-anchor-top-right .mapboxgl-popup-content { | ||
| 484 | border-top-right-radius: 0; | ||
| 485 | } | ||
| 486 | |||
| 487 | .mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content { | ||
| 488 | border-bottom-left-radius: 0; | ||
| 489 | } | ||
| 490 | |||
| 491 | .mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content { | ||
| 492 | border-bottom-right-radius: 0; | ||
| 493 | } | ||
| 494 | |||
| 495 | .mapboxgl-popup-track-pointer { | ||
| 496 | display: none; | ||
| 497 | } | ||
| 498 | |||
| 499 | .mapboxgl-popup-track-pointer * { | ||
| 500 | pointer-events: none; | ||
| 501 | user-select: none; | ||
| 502 | } | ||
| 503 | |||
| 504 | .mapboxgl-map:hover .mapboxgl-popup-track-pointer { | ||
| 505 | display: flex; | ||
| 506 | } | ||
| 507 | |||
| 508 | .mapboxgl-map:active .mapboxgl-popup-track-pointer { | ||
| 509 | display: none; | ||
| 510 | } | ||
| 511 | |||
| 512 | .mapboxgl-marker { | ||
| 513 | position: absolute; | ||
| 514 | top: 0; | ||
| 515 | left: 0; | ||
| 516 | will-change: transform; | ||
| 517 | } | ||
| 518 | |||
| 519 | .mapboxgl-user-location-dot { | ||
| 520 | background-color: #1da1f2; | ||
| 521 | width: 15px; | ||
| 522 | height: 15px; | ||
| 523 | border-radius: 50%; | ||
| 524 | } | ||
| 525 | |||
| 526 | .mapboxgl-user-location-dot::before { | ||
| 527 | background-color: #1da1f2; | ||
| 528 | content: ''; | ||
| 529 | width: 15px; | ||
| 530 | height: 15px; | ||
| 531 | border-radius: 50%; | ||
| 532 | position: absolute; | ||
| 533 | -webkit-animation: mapboxgl-user-location-dot-pulse 2s infinite; | ||
| 534 | -moz-animation: mapboxgl-user-location-dot-pulse 2s infinite; | ||
| 535 | -ms-animation: mapboxgl-user-location-dot-pulse 2s infinite; | ||
| 536 | animation: mapboxgl-user-location-dot-pulse 2s infinite; | ||
| 537 | } | ||
| 538 | |||
| 539 | .mapboxgl-user-location-dot::after { | ||
| 540 | border-radius: 50%; | ||
| 541 | border: 2px solid #fff; | ||
| 542 | content: ''; | ||
| 543 | height: 19px; | ||
| 544 | left: -2px; | ||
| 545 | position: absolute; | ||
| 546 | top: -2px; | ||
| 547 | width: 19px; | ||
| 548 | box-sizing: border-box; | ||
| 549 | box-shadow: 0 0 3px rgba(0, 0, 0, 0.35); | ||
| 550 | } | ||
| 551 | |||
| 552 | @-webkit-keyframes mapboxgl-user-location-dot-pulse { | ||
| 553 | 0% { -webkit-transform: scale(1); opacity: 1; } | ||
| 554 | 70% { -webkit-transform: scale(3); opacity: 0; } | ||
| 555 | 100% { -webkit-transform: scale(1); opacity: 0; } | ||
| 556 | } | ||
| 557 | |||
| 558 | @-ms-keyframes mapboxgl-user-location-dot-pulse { | ||
| 559 | 0% { -ms-transform: scale(1); opacity: 1; } | ||
| 560 | 70% { -ms-transform: scale(3); opacity: 0; } | ||
| 561 | 100% { -ms-transform: scale(1); opacity: 0; } | ||
| 562 | } | ||
| 563 | |||
| 564 | @keyframes mapboxgl-user-location-dot-pulse { | ||
| 565 | 0% { transform: scale(1); opacity: 1; } | ||
| 566 | 70% { transform: scale(3); opacity: 0; } | ||
| 567 | 100% { transform: scale(1); opacity: 0; } | ||
| 568 | } | ||
| 569 | |||
| 570 | .mapboxgl-user-location-dot-stale { | ||
| 571 | background-color: #aaa; | ||
| 572 | } | ||
| 573 | |||
| 574 | .mapboxgl-user-location-dot-stale::after { | ||
| 575 | display: none; | ||
| 576 | } | ||
| 577 | |||
| 578 | .mapboxgl-crosshair, | ||
| 579 | .mapboxgl-crosshair .mapboxgl-interactive, | ||
| 580 | .mapboxgl-crosshair .mapboxgl-interactive:active { | ||
| 581 | cursor: crosshair; | ||
| 582 | } | ||
| 583 | |||
| 584 | .mapboxgl-boxzoom { | ||
| 585 | position: absolute; | ||
| 586 | top: 0; | ||
| 587 | left: 0; | ||
| 588 | width: 0; | ||
| 589 | height: 0; | ||
| 590 | background: #fff; | ||
| 591 | border: 2px dotted #202020; | ||
| 592 | opacity: 0.5; | ||
| 593 | } | ||
| 594 | |||
| 595 | @media print { | ||
| 596 | /* stylelint-disable-next-line selector-class-pattern */ | ||
| 597 | .mapbox-improve-map { | ||
| 598 | display: none; | ||
| 599 | } | ||
| 600 | } | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
static/image/markerbig_select.png
0 → 100644
1.39 KB
static/js/mapbox-gl-enhance.js
0 → 100644
This diff could not be displayed because it is too large.
static/js/styles.js
0 → 100644
This diff could not be displayed because it is too large.
-
Please register or sign in to post a comment