Fly преди 1 месец
родител
ревизия
5803330cac
променени са 6 файла, в които са добавени 8 реда и са изтрити 68 реда
  1. 4 3
      config/index.js
  2. 1 1
      pages/map/model/hint.vue
  3. 1 1
      pages/map/model/siteServeH6.vue
  4. 0 57
      utils/LonLatConvert - 副本.js
  5. 1 5
      utils/LonLatConvert.js
  6. 1 1
      utils/openApp.js

+ 4 - 3
config/index.js

@@ -7,10 +7,11 @@ export default {
 	
 	
 	// 高德
-	key:'f4226f3eb5a974d153652665b64b497c',
-	secretKey:'a9557f94a84a95b515bec96c3bed93f1',
+	// key:'f4226f3eb5a974d153652665b64b497c',
+ 
 	// 天地图
-	tianKey:'1edd9c001a8425cb93631398109d5ab2',
+	// tianKey:'1edd9c001a8425cb93631398109d5ab2',
+	tianKey:'d131bbacd0a5428f6781fa4e11871196',
 	
 	type:'H6' , // H5 / H6,  web端打包需要修改 manifest.json web配置的基础运行路径
 }

+ 1 - 1
pages/map/model/hint.vue

@@ -4,7 +4,7 @@
 		<view class="hint-box">
 			<view class="hint-title">服务声明</view>
 			<view class="hint-val">
-				尊敬的市民朋友,您好!【武汉公安政务服务地图】正在试运行中,如有任何疑问和建议,欢迎致电武汉公安政务服务专线85395115
+				尊敬的市民朋友,您好!【武汉公安政务服务地图】正在试运行中,如有任何疑问和建议,欢迎致电武汉公安政务服务专线85395115
 
 			</view>
 			<view class="hint-btns" @click.stop="onClose()">

+ 1 - 1
pages/map/model/siteServeH6.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="serve-content" :style="{'height':height  +'px' }">
-		<view class="serve-title">可办事项</view>
+		<view class="serve-title">可办事项</view>
 		<view class="serve-search">
 			<view class="search-input" >
 				<svg t="1733904658291" class="search-icon" viewBox="0 0 1024 1024" version="1.1"

+ 0 - 57
utils/LonLatConvert - 副本.js

@@ -1,57 +0,0 @@
-import AMapLoader from '@amap/amap-jsapi-loader';
-import $config from "@/config/index.js"
-
-export const getCoord = (parmas) => {
-	return new Promise((reslove, reject) => {
-		const { name, code, type } = parmas;
-		window._AMapSecurityConfig = {
-			securityJsCode: $config.secretKey,
-		};
-		// 配置高德API的key
-		AMapLoader.load({
-				"key":  $config.key,
-				"version": "2.0",
-				"plugins": []
-			})
-			.then((AMap) => { 
-				AMap.plugin('AMap.Geocoder', function() {
-					var geocoder = new AMap.Geocoder({
-						city: code // city 指定进行编码查询的城市,支持传入城市名、adcode 和 citycode
-					});
-
-					var addresses = [name];
-					// 使用高德逆编码,将天地图转换成高德地图
-					geocoder.getLocation(addresses, function(status, result) { 
-						if (status === 'complete' && result.info === 'OK') {
-							const val = result.geocodes[0];
-							reslove(val.location) 
-						}else{
-							reject()
-						}
-					});
-				});
-
-				// var gps = [longitude, latitude]; //需要转换的gps类型的坐标
-				// // var gps = [116.3, 39.9]; //需要转换的gps类型的坐标
-				// // 初始化地图实例
-				// console.log('AMap =', AMap, gps)
-				// // window.map = new AMap.Map('container', {
-				// //   zoom: 10, // 设置地图显示的缩放级别
-				// //   center: [116.397428, 39.90923] // 设置地图中心点坐标
-				// // });
-				// //参数说明:需要转换的坐标或者坐标组,需要转换的坐标类型,转换成功后的回调函数
-				// AMap.convertFrom(gps, "gps", function(status, result) {
-				// 	console.log('status, result =', status, result)
-				// 	//status:complete 表示查询成功,no_data 为查询无结果,error 代表查询错误
-				// 	//查询成功时,result.locations 即为转换后的高德坐标系
-				// 	if (status === "complete" && result.info === "ok") {
-				// 		var lnglats = result.locations; //转换后的高德坐标 Array.<LngLat>
-				// 		console.log(lnglats);
-				// 	}
-				// });
-			})
-			.catch(e => {
-				reject()
-			});
-	})
-}

+ 1 - 5
utils/LonLatConvert.js

@@ -1,16 +1,12 @@
-import AMapLoader from '@amap/amap-jsapi-loader';
+// import AMapLoader from '@amap/amap-jsapi-loader';
 import $config from "@/config/index.js"
 import gcoord from 'gcoord';
 
 export const getCoord = (parmas) => {
 	return new Promise((reslove, reject) => {
 		const { name, code, type, longitude, latitude } = parmas;
-		console.log("name, code, type = ", longitude, latitude)
 		switch (type) {
 			case 'gaode':
-				// const [gcjLat, gcjLon] = wgs84ToGcj02(latitude, longitude);
-				// console.log("[gcjLat, gcjLon] = ", gcjLat, gcjLon)
-
 				const convertedCoords = gcoord.transform(
 					[longitude, latitude],
 					gcoord.WGS84, // 输入坐标系

+ 1 - 1
utils/openApp.js

@@ -4,7 +4,7 @@ import { getCoord } from "@/utils/LonLatConvert.js"
 // ‌天地图使用的坐标系是CGCS2000(中国大地坐标系统2000)
 export const openMap = (parmas = {}) => {
 	const { name, code, type, info: { longitude, latitude } } = parmas;
-	console.log("name, code, type = ", name, code, type, longitude, latitude)
+	// console.log("name, code, type = ", name, code, type, longitude, latitude)
 	uni.showLoading()
 	getCoord({ name, code, type, longitude, latitude }).then(res => {
 		const { lng, lat } = res;