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
51913992
authored
2019-12-27 17:50:26 +0800
by
unknown
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
20191227
1 parent
1486afb6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
95 additions
and
6 deletions
src/components/basic/Map_info.vue
src/components/basic/Map_measure.vue
src/components/basic/Map_mvt.vue
src/components/basic/Map_rastertiles_iserver.vue
src/router/index.js
static/js/v1.0.9/mapbox-gl-draw.js
src/components/basic/Map_info.vue
View file @
5191399
...
...
@@ -2,8 +2,8 @@
* MapboxGL基本地图设置并从服务器上获取相关信息
* @Author: jiangbotao
* @Date: 2019-12-09 23:17:48
* @LastEditors: jiangbotao
* @LastEditTime
: 2019-12-15 12:28:03
* @LastEditors
: jiangbotao
* @LastEditTime
: 2019-12-27 17:45:58
* @FilePath: \mymapbox\src\components\Map3857.vue
-->
<
template
>
...
...
src/components/basic/Map_measure.vue
View file @
5191399
...
...
@@ -2,7 +2,7 @@
* @Author: jiangbotao
* @Date: 2019-12-09 23:17:48
* @LastEditors : jiangbotao
* @LastEditTime : 2019-12-
18 19:27:37
* @LastEditTime : 2019-12-
27 15:00:11
* @FilePath: \mymapbox\src\components\Map3857.vue
-->
<
template
>
...
...
@@ -87,6 +87,8 @@ export default {
}
function
removeMsg
()
{
console
.
log
(
'deleted'
);
// draw.deleteAll();
}
map
.
on
(
'draw.create'
,
measure
);
...
...
src/components/basic/Map_mvt.vue
View file @
5191399
...
...
@@ -2,7 +2,7 @@
* @Author: jiangbotao
* @Date: 2019-12-09 23:17:48
* @LastEditors : jiangbotao
* @LastEditTime : 2019-12-
18 19:29:18
* @LastEditTime : 2019-12-
27 11:35:00
* @FilePath: \mymapbox\src\components\Map3857.vue
-->
<
template
>
...
...
src/components/basic/Map_rastertiles_iserver.vue
0 → 100644
View file @
5191399
<!--
* @Author: jiangbotao
* @Date: 2019-12-09 23:17:48
* @LastEditors : jiangbotao
* @LastEditTime : 2019-12-27 17:49:16
* @FilePath: \mymapbox\src\components\Map3857.vue
-->
<
template
>
<div
>
<div
id=
"map"
></div>
</div>
</
template
>
<
script
>
import
mapboxgl
from
'mapbox-gl'
;
import
{
Logo
}
from
'@supermap/iclient-mapboxgl'
;
export
default
{
name
:
'RasterTiles'
,
data
()
{
return
{
}
},
mounted
(){
var
map
,
host
=
"http://192.168.1.100:8090"
;
var
url
=
host
+
"/iserver/services/map-world/rest/maps/World"
;
var
map
=
new
mapboxgl
.
Map
({
container
:
'map'
,
attributionControl
:
false
,
background
:
{
color
:
'#FFFFFF'
},
style
:
{
"version"
:
8
,
"sources"
:
{
"raster-tiles"
:
{
"attribution"
:
'展示栅格瓦片和各种Mapbox控件'
,
"type"
:
"raster"
,
"tiles"
:
[
host
+
'/iserver/services/map-ugcv5-Blurmap/rest/maps/Blurmap'
],
"tileSize"
:
256
,
"transparent"
:
true
,
"format"
:
"png"
,
"rasterSource"
:
'iserver'
}
},
"layers"
:
[{
id
:
'background'
,
type
:
'background'
,
paint
:
{
'background-color'
:
"#000000"
}
},{
"id"
:
"simple-tiles"
,
"type"
:
"raster"
,
"source"
:
"raster-tiles"
,
"minzoom"
:
0
,
"maxzoom"
:
22
}]
},
center
:
[
120.47
,
27.78169
],
// starting position
crs
:
'EPSG:4490'
,
pitch
:
50
,
// pitch in degrees
bearing
:
-
10
,
//
maxZoom
:
13
,
minZoom
:
8
,
zoom
:
9
// starting zoom
});
map
.
addControl
(
new
Logo
(),
'bottom-right'
);
map
.
addControl
(
new
mapboxgl
.
NavigationControl
(),
'top-left'
);
map
.
addControl
(
new
mapboxgl
.
ScaleControl
({}));
map
.
addControl
(
new
mapboxgl
.
FullscreenControl
(),
'top-right'
);
// var popup = new mapboxgl.Popup({ closeOnClick: false })
// .setLngLat([120.47, 27.78169])
// .setHTML('<h1>Hello World!</h1>')
// .addTo(map);
}
}
</
script
>
<
style
scoped
>
#map
{
position
:
absolute
;
height
:
100%
;
width
:
100%
;
background-color
:
white
}
</
style
>
\ No newline at end of file
src/router/index.js
View file @
5191399
...
...
@@ -2,7 +2,7 @@
* @Author: jiangbotao
* @Date: 2019-12-12 17:40:15
* @LastEditors : jiangbotao
* @LastEditTime : 2019-12-
18 20:05:46
* @LastEditTime : 2019-12-
27 15:10:45
* @FilePath: \supermapvue\src\router\index.js
*/
/*
...
...
@@ -62,7 +62,7 @@ export default new Router({
{
path
:
'/rastertile'
,
name
:
'MapRasterTile'
,
component
:
()
=>
import
(
'@/components/basic/Map_rastertiles'
)
component
:
()
=>
import
(
'@/components/basic/Map_rastertiles
_iserver
'
)
},
{
path
:
'/mvt'
,
...
...
static/js/v1.0.9/mapbox-gl-draw.js
View file @
5191399
This diff could not be displayed because it is too large.
Please
register
or
sign in
to post a comment