Commit 92a3cc8b authored by 郭铭瑶's avatar 郭铭瑶 🤘

加入地图公网链接

parent 8783bc78
<!DOCTYPE html><html id=html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><meta http-equiv=X-UA-Compatible content="IE=edge, chrome=1"><title>物业督查实时专题图</title><style>html {
font-size: 1.6vh;
}</style><script src=./static/jquery.min.js></script><script type=text/javascript src=http://168.168.112.76:8181/smimap/mapdebug/ShsmiGis.Bridge.js></script><link href=./static/css/app.235122f476b513aa299659263a45ef91.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.c187a514582ce85fe889.js></script><script type=text/javascript src=./static/js/vendor.dc1ed2d0549b6d6f959d.js></script><script type=text/javascript src=./static/js/app.3e332909910096f2923e.js></script></body></html>
\ No newline at end of file
}</style><script src=./static/jquery.min.js></script><script type=text/javascript src=http://www.962121.net/gis_system/smimap/mapdebug/ShsmiGis.Bridge.js></script><link href=./static/css/app.ffaa60fe22a213d21966ae9ae32ee73c.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.2cd1d611570130f2598e.js></script><script type=text/javascript src=./static/js/vendor.dc1ed2d0549b6d6f959d.js></script><script type=text/javascript src=./static/js/app.431a9829792233fde715.js></script></body></html>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
!function(e){var n=window.webpackJsonp;window.webpackJsonp=function(r,a,c){for(var i,u,f,s=0,l=[];s<r.length;s++)u=r[s],t[u]&&l.push(t[u][0]),t[u]=0;for(i in a)Object.prototype.hasOwnProperty.call(a,i)&&(e[i]=a[i]);for(n&&n(r,a,c);l.length;)l.shift()();if(c)for(s=0;s<c.length;s++)f=o(o.s=c[s]);return f};var r={},t={3:0};function o(n){if(r[n])return r[n].exports;var t=r[n]={i:n,l:!1,exports:{}};return e[n].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.e=function(e){var n=t[e];if(0===n)return new Promise(function(e){e()});if(n)return n[2];var r=new Promise(function(r,o){n=t[e]=[r,o]});n[2]=r;var a=document.getElementsByTagName("head")[0],c=document.createElement("script");c.type="text/javascript",c.charset="utf-8",c.async=!0,c.timeout=12e4,o.nc&&c.setAttribute("nonce",o.nc),c.src=o.p+"static/js/"+e+"."+{0:"90ef68a7264ea4ef7205"}[e]+".js";var i=setTimeout(u,12e4);function u(){c.onerror=c.onload=null,clearTimeout(i);var n=t[e];0!==n&&(n&&n[1](new Error("Loading chunk "+e+" failed.")),t[e]=void 0)}return c.onerror=c.onload=u,a.appendChild(c),r},o.m=e,o.c=r,o.d=function(e,n,r){o.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},o.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(n,"a",n),n},o.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},o.p="./",o.oe=function(e){throw console.error(e),e}}([]);
//# sourceMappingURL=manifest.c187a514582ce85fe889.js.map
\ No newline at end of file
!function(e){var n=window.webpackJsonp;window.webpackJsonp=function(r,c,i){for(var u,a,f,s=0,l=[];s<r.length;s++)a=r[s],t[a]&&l.push(t[a][0]),t[a]=0;for(u in c)Object.prototype.hasOwnProperty.call(c,u)&&(e[u]=c[u]);for(n&&n(r,c,i);l.length;)l.shift()();if(i)for(s=0;s<i.length;s++)f=o(o.s=i[s]);return f};var r={},t={3:0};function o(n){if(r[n])return r[n].exports;var t=r[n]={i:n,l:!1,exports:{}};return e[n].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.e=function(e){var n=t[e];if(0===n)return new Promise(function(e){e()});if(n)return n[2];var r=new Promise(function(r,o){n=t[e]=[r,o]});n[2]=r;var c=document.getElementsByTagName("head")[0],i=document.createElement("script");i.type="text/javascript",i.charset="utf-8",i.async=!0,i.timeout=12e4,o.nc&&i.setAttribute("nonce",o.nc),i.src=o.p+"static/js/"+e+"."+{0:"3fd93edb28ee49963464"}[e]+".js";var u=setTimeout(a,12e4);function a(){i.onerror=i.onload=null,clearTimeout(u);var n=t[e];0!==n&&(n&&n[1](new Error("Loading chunk "+e+" failed.")),t[e]=void 0)}return i.onerror=i.onload=a,c.appendChild(i),r},o.m=e,o.c=r,o.d=function(e,n,r){o.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},o.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(n,"a",n),n},o.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},o.p="./",o.oe=function(e){throw console.error(e),e}}([]);
//# sourceMappingURL=manifest.2cd1d611570130f2598e.js.map
\ No newline at end of file
......@@ -11,10 +11,9 @@
}
</style>
<script src="./static/jquery.min.js"></script>
<script type='text/javascript' src='http://168.168.112.76:8181/smimap/mapdebug/ShsmiGis.Bridge.js'></script>
<!-- <script type='text/javascript' src='http://168.168.112.76:8181/smimap/mapdebug/ShsmiGis.Bridge.js'></script> -->
<!-- <script type='text/javascript' src='http://192.168.104.33:8181/smimap192/mapdebug/ShsmiGis.Bridge.js'></script> -->
<!-- <script type='text/javascript' src='http://www.962121.net/gis_system/smimap/mapdebug/ShsmiGis.Bridge.js'></script> -->
<!-- <script type='text/javascript' src='https://api.map.baidu.com/api?v=2.0&ak=MvCb6BWu4jHR9TD0svHfO4bWlx9pA9HG'></script> -->
<script type='text/javascript' src='http://www.962121.net/gis_system/smimap/mapdebug/ShsmiGis.Bridge.js'></script>
</head>
<body>
<div id="app"></div>
......
......@@ -12,14 +12,14 @@ default:
export default {
BASE_URL,
IMG_URL,
MAP_URL: 'http://168.168.112.76:8181/smimap/index.html', // 7楼
MAP_ICON_BASE: 'http://168.168.112.76:8181/smimap/images/', // 7楼
// MAP_URL: 'http://168.168.112.76:8181/smimap/index.html', // 7楼
// MAP_ICON_BASE: 'http://168.168.112.76:8181/smimap/images/', // 7楼
// MAP_URL: 'http://192.168.104.33:8181/smimap192/index.html', // 2楼
// MAP_ICON_BASE: 'http://192.168.104.33:8181/smimap192/images/', // 2楼
// MAP_URL: 'http://www.962121.net/gis_system/smimap/index.html#/', // 公网
// MAP_ICON_BASE: 'http://www.962121.net/hmfmstest/shanghaiwuye/web/dataV/static/', // 公网
MAP_URL: 'http://www.962121.net/gis_system/smimap/index.html#/', // 公网
MAP_ICON_BASE: 'http://www.962121.net/gis_system/smimap/mapdebug/images/', // 公网
POST_THEME_LIST: '/sharingplatform/themeListForOneDay',
POST_COMMUNITY_LIST: '/sharingplatform/sectListForOneDay',
......
<template>
<div class="dataview-map-container">
<div id="allmap" ref="allmap" :style="mapStyle" />
</div>
</template>
<script>
const { BMap, BMAP_STATUS_SUCCESS } = window
export default {
name: 'BaiduMap',
data() {
return {
map: '',
address: '',
}
},
props: {
height: {
type: String,
// default: '36rem',
default: '100vh',
},
// width: {
// type: Number,
// default: 800
// },
isInModal: {
type: Boolean,
default: false,
},
keyWords: {// 搜索地址的关键字
type: [String]
},
setPosition: {
type: [String]
},
position: {// 地图对应的经纬度(坐标)
type: Object
},
},
methods: {
// init
showMap() {
const map = new BMap.Map(this.$refs.allmap)
map.setMapStyle({style: 'midnight'})
this.map = map// 创建Map实例
var point = new BMap.Point(121.53, 31.22)
this.map.centerAndZoom('上海', 12)
var marker = new BMap.Marker(point) // 创建标注
this.map.addOverlay(marker) // 将标注添加到地图中
var point2 = new BMap.Point(121.48, 31.23)
var marker2 = new BMap.Marker(point2) // 创建标注
this.map.addOverlay(marker2) // 将标注添加到地图中
this.map.enableScrollWheelZoom(true) // 开启鼠标滚轮缩放
this.map.disableDragging() // 禁止拖拽
let vm = this
setTimeout(function() {
vm.map.enableDragging() // 两秒后开启拖拽
}, 2000)
this.map.addEventListener('click', this.add_overlay)
},
// 添加覆盖物
// add_overlay(e) {
// this.remove_overlay()
// var point = new BMap.Point(e.point.lng, e.point.lat)
// var marker = new BMap.Marker(point) // 创建标注
// this.map.addOverlay(marker) // 将标注添加到地图中
// marker.enableDragging()
// this.addressByPoint(e.point)
// },
// 清除覆盖物
remove_overlay() {
this.map.clearOverlays()
},
// 获取第一个智能搜索的结果添加标注
setPlace(point) {
this.map.clearOverlays() // 清除地图上所有覆盖物
var pp = point // 获取第一个智能搜索的结果
this.setZoom([pp])
// this.map.centerAndZoom(pp, this.setZoom(pp))
let marker = new BMap.Marker(pp)
this.map.addOverlay(marker) // 添加标注
marker.enableDragging()
this.addressByPoint(point)
// 拖拽结束事件
let vm = this
marker.addEventListener('dragend', function(e) {
vm.addressByPoint(e.point)
})
},
// 搜索
searchKeyWords(word) {
let vm = this
var options = {
onSearchComplete: function(results) {
// 判断状态是否正确
if (local.getStatus() === BMAP_STATUS_SUCCESS) {
// 返回搜索结果
vm.$emit('on-result', results)
}
}
}
var local = new BMap.LocalSearch(this.map, options)
local.search(word)
},
// 根据点坐标获取地址信息
addressByPoint(e) {
let vm = this
var geocoder = new BMap.Geocoder()
geocoder.getLocation(e, function(rs) {
let obj = rs.addressComponents
obj.address = rs.address
let data = obj
let address
if (vm.address === '') {
address = rs.address
} else {
address = vm.address
}
// 地图坐标发生变化,返回地址数据
vm.$emit('on-change', data, address)
vm.address = ''
})
},
// 根据点的数组自动调整缩放级别
setZoom(bPoints) {
var view = this.map.getViewport(bPoints)
var mapZoom = view.zoom
var centerPoint = view.center
this.map.centerAndZoom(centerPoint, mapZoom)
}
},
mounted() {
this.showMap()
},
computed: {
mapStyle() {
let render = {}
if (this.height) {
render.height = this.height
}
render.width = '100%'
render.margin = '0 auto'
return render
}
},
watch: {
keyWords() {
this.searchKeyWords(this.keyWords)
},
position() {
this.address = ''
this.address = this.position.address
let point = this.position.point
if (JSON.stringify(point) !== '{}') {
this.setPlace(point)
}
}
}
}
</script>
<style scoped>
.dataview-map-container {
position: relative;
}
.dataview-map-container .expand-btn {
position: absolute;
top: 0.2rem;
right: 0.2rem;
font-size: 2rem;
font-weight: bold;
cursor: pointer;
color: rgba(255, 255, 255, 0.5);
}
.dataview-map-container .expand-btn:hover {
color: rgba(255, 255, 255, 1);
}
</style>
<style>
/* 去掉百度地图相关logo */
.anchorBL{
display: none;
}
.anchorTR {
display: none;
}
</style>
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment