3 Star 0 Fork 1

鞪林 / go-map

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
index.go 2.69 KB
一键复制 编辑 原始数据 按行查看 历史
richard 提交于 2021-06-29 11:09 . add adcode field in LBS location
package ls
type Locator interface {
//地理编码
Geocoder(address string, city string) (*Location, error)
//逆地理编码
ReverseGeocoding(lat, lng float64) (*Address, error)
//普通IP定位
IPLocation(ip string) (*IPPosition, error)
//通过WI-FI、基站智能硬件定位
LBSLocation(params *LBSInfo) (*LBSPosition, error)
//获取实况天气
GetWeatherNow(adcode int64) (*WeatherInfo, error)
}
type Location struct {
Lng float64 // 经度
Lat float64 // 纬度
}
type Address struct {
FormattedAddress string // 结构化地址信息
Province string // 省名
City string // 城市名
District string // 区县名
Town string // 乡镇名
TownCode string // 乡镇id
Street string // 街道名
StreetNumber string // 街道门牌号
AdCode int64 // 行政区划代码
Pois []*PoiInfo
}
// poi信息
type PoiInfo struct {
UID string // poi唯一标识
Addr string // 地址信息
Direction string // 和当前坐标点的方向
Distance int64 // 离坐标点距离
Name string // poi名称
Tag string // poi类型,如’美食;中餐厅’
Location Location // poi坐标{x,y}
Tel string // 电话
}
type IPPosition struct {
Province string // 省名
City string // 城市名
}
type LBSInfo struct {
AccessType int //接入网络方式 移动接入网络:0 ;wifi接入网络:1 必选
IMEI string //手机 imei 号 必选
CDMA int //非cdma:0; cdma:1 默认值为:0
Network string //无线网络类型 GSM/GPRS/EDGE/HSUPA/HSDPA/WCDMA (注意大写)
BTS string //基站信息
IMSI string //移动用户识别码 非必选,但建议填写
SMAC string //手机 mac 码 非必选,但建议填写
ClientIP string //移动网关IP 非必选,但建议填写
TEL string //手机号码 非必选
MMAC string //已连热点 mac 信息
}
type LBSPosition struct {
Location Location // poi坐标{x,y}
Radius int // 定位精度半径,单位:米
FormattedAddress string // 结构化地址信息
Province string // 省名
City string // 城市名
District string // 区县名
AdCode int64 // 行政区划代码
}
// 实况天气
type WeatherInfo struct {
Province string // 省
City string // 市
Adcode string // 行政区域代码
Weather string // 天气现象(汉字描述)
Temperature string // 实时气温,单位:摄氏度
WindDirection string // 风向描述
WindPower string // 风力级别,单位:级
Humidity string // 空气湿度
ReportTime string
}
Go
1
https://gitee.com/xslasd/go-map.git
git@gitee.com:xslasd/go-map.git
xslasd
go-map
go-map
74f83c4691ac

搜索帮助