51913992 by unknown

20191227

1 parent 1486afb6
......@@ -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>
......
......@@ -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);
......
......@@ -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>
......
<!--
* @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
......@@ -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',
......
This diff could not be displayed because it is too large.