zoukankan
html css js c++ java
C# 处理 google map 经纬度偏移量
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Configuration; namespace WSGPSGateway.BLL { public class LocationLogic { public LocationLogic() { } private static volatile LocationLogic _LocationLogic = new LocationLogic(); /// <summary> /// 得到实例 /// </summary> /// <returns></returns> public static LocationLogic GetInstance() { if (_LocationLogic == null) { lock (typeof(LocationLogic)) { if (_LocationLogic == null) { _LocationLogic = new LocationLogic(); } } } return _LocationLogic; } /// <summary> /// 得到经度和纬度 /// </summary> /// <param name="lat"></param> /// <param name="lng"></param> /// <returns></returns> public decimal[] GetLatLng(decimal lat, decimal lng) { int PX, PY; decimal? PX1, PY1; decimal? OX; decimal? OY; decimal[] LatLng = new decimal[] { lat, lng }; //传入两个参数 ,经度和纬度 ,然后返回经过解析的经度和纬度 try { DAL.DeviceinfoDataSetTableAdapters.deviceinfoAdapter da = new DAL.DeviceinfoDataSetTableAdapters.deviceinfoAdapter(); da.P_GETLATLNG(lat, lng, out OX, out OY); OX = Convert.ToDecimal(OX); OY = Convert.ToDecimal(OY); if (OX != 0 && OY != 0) { Map.LatLongToPixelXY(Convert.ToDouble(lat), Convert.ToDouble(lng), 18, out PX, out PY); PX1 = PX + OX; PY1 = PY + OY; LatLng[0] = Convert.ToDecimal(Map.PixelYToLat(Convert.ToDouble(PY1), 18)); LatLng[1] = Convert.ToDecimal(Map.PixelXToLng(Convert.ToDouble(PX1), 18)); } } catch (Exception ex) { DAL.Log.Write("纠偏处理发生异常! \0 错误记录:" + ex + "\r\n"); DAL.Log.Write("-----------------------------------------------------------\r\n"); } return LatLng; } } }
查看全文
相关阅读:
leetcode 686. Repeated String Match
leetcode 507. Perfect Number
leetcode 681. Next Closest Time
leetcode 682. Baseball Game
leetcode 684. Redundant Connection
leetcode 677. Map Sum Pairs
leetcode 402. Remove K Digits
python numpy
leetcode 409. Longest Palindrome
python垃圾回收机制
原文地址:https://www.cnblogs.com/javawebsoa/p/2458199.html
最新文章
Google I/O完整盘点,这才是地球上最「性感」的发布会
肯尼亚蒙内铁路--聘用岗位500
记录——时间轮定时器(lua 实现)
SSH 远程执行任务
libssh2
/usr/bin/expect介绍
一月至十二月的英文简写
《linux下进程的创建,执行,监控和终止》
malloc和new的区别 end
malloc和new的区别 begin
热门文章
SuSE Linux10.1 网络设置以及和主机通信end
SuSE Linux10.1 网络设置以及和主机通信
SuSE Linux修改网卡配置
虚拟机vmware10.0.0里设置Suse Linux Enterprise 11系统静态IP上网
suse更改root密码
链接选项
嵌入式C语言编译器
开发中的辅助工具
揭开连接器的面纱(下)
leetcode 687. Longest Univalue Path
Copyright © 2011-2022 走看看