Commit 4da366ad authored by zhangzhaohui's avatar zhangzhaohui

删除多余的文件

parent 46080ab4
Pipeline #334 failed with stages
<template>
<view class="header-bar" :style="{ 'padding-top': statusBarHeight + 'px' , 'height' : navHeight + 'px'}">
<view class="content">
<view class="icon-box" @click="back()">
<image class="icon" src="../static/img/back.png"></image>
<text class="back-text">返回</text>
</view>
<text>{{title}}</text>
</view>
</view>
</template>
<script>
export default {
name:"HeaderBar",
data() {
return {
};
},
props: ['title'],
computed: {
statusBarHeight(){
return this.$store.state.statusBarHeight
},
navHeight(){
return this.$store.state.navHeight
},
},
methods: {
back(){
uni.navigateBack()
},
}
}
</script>
<style lang="scss" scoped>
.header-bar{
width: 100%;
justify-content: center;
align-items: center;
display: flex;
font-size: 36rpx;
box-sizing: border-box;
position: fixed;
top: 0;
z-index: 99;
.content{
flex: 1;
display: flex;
justify-content: center;
position: relative;
align-items: center;
.icon-box{
display: flex;
align-items: center;
position: absolute;
left: 48rpx;
.icon {
height: 40rpx;
width: 40rpx;
margin-right: 15rpx;
}
.back-text{
font-size: 32rpx;
}
}
}
}
</style>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
var L = window.L
L.TileLayer.ChinaProvider = L.TileLayer.extend({
initialize: function(type, options) { // (type, Object)
if (!options) {
options = {}
}
var providers = L.TileLayer.ChinaProvider.providers
var parts = type.split('.')
var providerName = parts[0]
var mapName = parts[1]
var mapType = parts[2]
var url = providers[providerName][mapName][mapType]
options.subdomains = providers[providerName].Subdomains
L.TileLayer.prototype.initialize.call(this, url, options)
}
})
L.TileLayer.ChinaProvider.providers = {
TianDiTu: {
Normal: {
Map: '//t{s}.tianditu.com/DataServer?T=vec_w&X={x}&Y={y}&L={z}&tk={key}',
Annotion: '//t{s}.tianditu.com/DataServer?T=cva_w&X={x}&Y={y}&L={z}&tk={key}'
},
Satellite: {
Map: 'http://t{s}.tianditu.gov.cn/img_w/wmts?tk={key}&SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TileMatrix={z}&TileCol={x}&TileRow={y}',
Annotion: 'http://t{s}.tianditu.gov.cn/img_w/wmts?tk={key}&SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TileMatrix={z}&TileCol={x}&TileRow={y}'
},
Terrain: {
Map: '//t{s}.tianditu.com/DataServer?T=ter_w&X={x}&Y={y}&L={z}&tk={key}',
Annotion: '//t{s}.tianditu.com/DataServer?T=cta_w&X={x}&Y={y}&L={z}&tk={key}'
},
YunNan: {
/* https://maps.ynmap.cn/services/img/map/3857/WMTS?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=tdtYnImg100cm84&STYLE=default&TILEMATRIXSET=default028mm&FORMAT=tiles&TILEMATRIX=18&TILEROW=111233&TILECOL=204031&key= */
Map: 'https://maps.ynmap.cn/services/img/map/3857/WMTS?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=tdtYnImg100cm84&STYLE=default&TILEMATRIXSET=default028mm&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&key={key}',
Annotion: 'http://t{s}.tianditu.com/DataServer?T=cta_w&X={x}&Y={y}&L={z}&tk={key}'
},
Subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'],
key: '174705aebfe31b79b3587279e211cb9a'
},
MapBox: {
Normal: {
Map: 'https://api.mapbox.com/styles/v1/{user}/{style}/Draft/tiles/256/{z}/{x}/{y}?access_token={token}'
},
Subdomains: []
},
MapABC: {
Normal: {
Map: 'http://emap{s}.mapabc.com/mapabc/maptile?&x={x}&y={y}&z={z}'
},
Subdomains: ['0', '1', '2', '3']
},
GaoDe: {
Normal: {
Map: 'http://webrd0{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}'
},
Satellite: {
Map: 'http://webst0{s}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}',
Annotion: 'http://webst0{s}.is.autonavi.com/appmaptile?style=8&x={x}&y={y}&z={z}'
},
Subdomains: ['1', '2', '3', '4']
},
GoogleCN: {
Normal: {
Map: 'http://mt{s}.google.cn/vt/lyrs=m&hl=zh-CN&gl=cn&x={x}&y={y}&z={z}'
},
Subdomains: ['1', '2', '3']
},
Geoq: {
Normal: {
Map: 'http://map.geoq.cn/ArcGIS/rest/services/ChinaOnlineCommunity/MapServer/tile/{z}/{y}/{x}',
PurplishBlue: 'http://map.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetPurplishBlue/MapServer/tile/{z}/{y}/{x}',
Gray: 'http://map.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetGray/MapServer/tile/{z}/{y}/{x}',
Warm: 'http://map.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetWarm/MapServer/tile/{z}/{y}/{x}'
},
Theme: {
Hydro: 'http://thematic.geoq.cn/arcgis/rest/services/ThematicMaps/WorldHydroMap/MapServer/tile/{z}/{y}/{x}'
},
Subdomains: []
}
}
L.tileLayer.chinaProvider = function(type, options) {
return new L.TileLayer.ChinaProvider(type, options)
}
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.
var L = window.L
// 坐标转换
L.CoordConver = function() {
/** 百度转84*/
this.bd09_To_gps84 = function(lng, lat) {
var gcj02 = this.bd09_To_gcj02(lng, lat)
var map84 = this.gcj02_To_gps84(gcj02.lng, gcj02.lat)
return map84
}
/** 84转百度*/
this.gps84_To_bd09 = function(lng, lat) {
var gcj02 = this.gps84_To_gcj02(lng, lat)
var bd09 = this.gcj02_To_bd09(gcj02.lng, gcj02.lat)
return bd09
}
/** 84转火星*/
this.gps84_To_gcj02 = function(lng, lat) {
var dLat = transformLat(lng - 105.0, lat - 35.0)
var dLng = transformLng(lng - 105.0, lat - 35.0)
var radLat = lat / 180.0 * pi
var magic = Math.sin(radLat)
magic = 1 - ee * magic * magic
var sqrtMagic = Math.sqrt(magic)
dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * pi)
dLng = (dLng * 180.0) / (a / sqrtMagic * Math.cos(radLat) * pi)
var mgLat = lat + dLat
var mgLng = lng + dLng
var newCoord = {
lng: mgLng,
lat: mgLat
}
return newCoord
}
/** 火星转84*/
this.gcj02_To_gps84 = function(lng, lat) {
var coord = transform(lng, lat)
var lontitude = lng * 2 - coord.lng
var latitude = lat * 2 - coord.lat
var newCoord = {
lng: lontitude,
lat: latitude
}
return newCoord
}
/** 火星转百度*/
this.gcj02_To_bd09 = function(x, y) {
var z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * x_pi)
var theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * x_pi)
var bd_lng = z * Math.cos(theta) + 0.0065
var bd_lat = z * Math.sin(theta) + 0.006
var newCoord = {
lng: bd_lng,
lat: bd_lat
}
return newCoord
}
/** 百度转火星*/
this.bd09_To_gcj02 = function(bd_lng, bd_lat) {
var x = bd_lng - 0.0065
var y = bd_lat - 0.006
var z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * x_pi)
var theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * x_pi)
var gg_lng = z * Math.cos(theta)
var gg_lat = z * Math.sin(theta)
var newCoord = {
lng: gg_lng,
lat: gg_lat
}
return newCoord
}
var pi = 3.1415926535897932384626
var a = 6378245.0
var ee = 0.00669342162296594323
var x_pi = pi * 3000.0 / 180.0
// var R = 6378137
function transform(lng, lat) {
var dLat = transformLat(lng - 105.0, lat - 35.0)
var dLng = transformLng(lng - 105.0, lat - 35.0)
var radLat = lat / 180.0 * pi
var magic = Math.sin(radLat)
magic = 1 - ee * magic * magic
var sqrtMagic = Math.sqrt(magic)
dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * pi)
dLng = (dLng * 180.0) / (a / sqrtMagic * Math.cos(radLat) * pi)
var mgLat = lat + dLat
var mgLng = lng + dLng
var newCoord = {
lng: mgLng,
lat: mgLat
}
return newCoord
}
function transformLat(x, y) {
var ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y + 0.2 * Math.sqrt(Math.abs(x))
ret += (20.0 * Math.sin(6.0 * x * pi) + 20.0 * Math.sin(2.0 * x * pi)) * 2.0 / 3.0
ret += (20.0 * Math.sin(y * pi) + 40.0 * Math.sin(y / 3.0 * pi)) * 2.0 / 3.0
ret += (160.0 * Math.sin(y / 12.0 * pi) + 320 * Math.sin(y * pi / 30.0)) * 2.0 / 3.0
return ret
}
function transformLng(x, y) {
var ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 * Math.sqrt(Math.abs(x))
ret += (20.0 * Math.sin(6.0 * x * pi) + 20.0 * Math.sin(2.0 * x * pi)) * 2.0 / 3.0
ret += (20.0 * Math.sin(x * pi) + 40.0 * Math.sin(x / 3.0 * pi)) * 2.0 / 3.0
ret += (150.0 * Math.sin(x / 12.0 * pi) + 300.0 * Math.sin(x / 30.0 * pi)) * 2.0 / 3.0
return ret
}
}
L.coordConver = function() {
return new L.CoordConver()
}
L.tileLayer.chinaProvider = function(type, options) {
options = options || {}
options.corrdType = getCorrdType(type)
return new L.TileLayer.ChinaProvider(type, options)
// 获取坐标类型
function getCorrdType(type) {
var parts = type.split('.')
var providerName = parts[0]
var zbName = 'wgs84'
switch (providerName) {
case 'Geoq':
case 'GaoDe':
case 'Google':
zbName = 'gcj02'
break
case 'Baidu':
zbName = 'bd09'
break
case 'OSM':
case 'TianDiTu':
case 'MapBox':
zbName = 'wgs84'
break
}
return zbName
}
}
L.GridLayer.include({
_setZoomTransform: function(level, _center, zoom) {
var center = _center
if (center !== undefined && this.options) {
if (this.options.corrdType === 'wgs84') {
center = L.coordConver().gcj02_To_gps84(_center.lng, _center.lat)
} else if (this.options.corrdType === 'bd09') {
center = L.coordConver().gcj02_To_bd09(_center.lng, _center.lat)
}
}
var scale = this._map.getZoomScale(zoom, level.zoom)
var translate = level.origin.multiplyBy(scale)
.subtract(this._map._getNewPixelOrigin(center, zoom)).round()
if (L.Browser.any3d) {
L.DomUtil.setTransform(level.el, translate, scale)
} else {
L.DomUtil.setPosition(level.el, translate)
}
},
_getTiledPixelBounds: function(_center) {
var center = _center
if (center !== undefined && this.options) {
if (this.options.corrdType === 'wgs84') {
center = L.coordConver().gcj02_To_gps84(_center.lng, _center.lat)
} else if (this.options.corrdType === 'bd09') {
center = L.coordConver().gcj02_To_bd09(_center.lng, _center.lat)
}
}
var map = this._map
var mapZoom = map._animatingZoom ? Math.max(map._animateToZoom, map.getZoom()) : map.getZoom()
var scale = map.getZoomScale(mapZoom, this._tileZoom)
var pixelCenter = map.project(center, this._tileZoom).floor()
var halfSize = map.getSize().divideBy(scale * 2)
return new L.Bounds(pixelCenter.subtract(halfSize), pixelCenter.add(halfSize))
}
})
This diff is collapsed.
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