Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
蒋波涛
/
super_mapboxgl_vue
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
33692f80
authored
2019-12-18 23:51:36 +0800
by
unknown
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
20191218
1 parent
1c20dea7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
25 deletions
config/index.js
src/components/layers/Map_zj_basic.vue
src/menu/MyMenu.vue
config/index.js
View file @
33692f8
/*
* @Author: jiangbotao
* @Date: 2019-12-12 17:39:25
* @LastEditors: jiangbotao
* @LastEditTime
: 2019-12-13 01:27:49
* @LastEditors
: jiangbotao
* @LastEditTime
: 2019-12-18 22:30:01
* @FilePath: \supermapvue\config\index.js
*/
'use strict'
...
...
@@ -18,11 +18,11 @@ module.exports = {
assetsSubDirectory
:
'static'
,
assetsPublicPath
:
'/'
,
proxyTable
:
{
// '/
api
':{
// target: 'http://
support.supermap.com.cn:8090
', //源地址
// '/
zj
':{
// target: 'http://
www.zjditu.cn
', //源地址
// changeOrigin: true, //改变源
// pathRewrite: {
// '^/
api': 'http://support.supermap.com.cn:809
0' //路径重写
// '^/
zj': 'http://127.0.0.1:700
0' //路径重写
// }
// }
},
...
...
src/components/layers/Map_zj_basic.vue
View file @
33692f8
...
...
@@ -24,15 +24,15 @@ export default {
}
},
mounted
(){
$
.
ajax
({
type
:
"GET"
,
url
:
"http://www.zjditu.cn
/vtiles/styles/tdt/streets.json"
,
type
:
'get'
,
dataType
:
'json'
,
// 请求方式为jsonp
crossDomain
:
true
,
success
:
function
(
data
){
console
.
log
(
data
);
// var mapboxgl_style = 'http://www.zjditu.cn
/vtiles/styles/tdt/dark.json';
//
$.ajax({
//
type: "GET",
// url: "/api
/vtiles/styles/tdt/streets.json",
//
type: 'get',
//
dataType: 'json', // 请求方式为jsonp
//
crossDomain: true,
//
success: function(data){
//
console.log(data);
var
mapboxgl_style
=
'zj
/vtiles/styles/tdt/dark.json'
;
var
map
=
new
mapboxgl
.
Map
({
container
:
'map'
,
zoom
:
12
,
...
...
@@ -41,13 +41,7 @@ export default {
localIdeographFontFamily
:
"'黑体','san-serif'"
,
pitch
:
50
,
bearing
:
-
10
,
style
:
{
"version"
:
data
.
version
,
"sources"
:
data
.
sources
,
"sprite"
:
data
.
sprite
,
"glyphs"
:
data
.
glyphs
,
"layers"
:
data
.
layers
},
style
:
mapboxgl_style
,
shading
:
'realistic'
,
light
:
{
main
:
{
...
...
@@ -66,8 +60,8 @@ export default {
zlevel
:
1
});
map
.
addControl
(
new
mapboxgl
.
NavigationControl
(),
'top-left'
);
}
});
//
}
//
});
}
}
</
script
>
...
...
src/menu/MyMenu.vue
View file @
33692f8
<!--
* @Author: jiangbotao
* @Date: 2019-12-13 23:53:57
* @LastEditors: jiangbotao
* @LastEditTime
: 2019-12-18 01:35
:19
* @LastEditors
: jiangbotao
* @LastEditTime
: 2019-12-18 22:32
:19
* @FilePath: \supermapvue\src\components\menu\MyMenu.vue
-->
<
template
>
...
...
Please
register
or
sign in
to post a comment