Example #1
0
// 是否可以配送
// 返回是否可以配送,以及距离(米)
func (this *CoverageArea) CanDeliver(lng, lat float64) (bool, int) {
	distance := lbs.GetLocDistance(
		this.value.Lng, this.value.Lat, lng, lat)
	i := int(distance)
	return i <= this.value.Radius*1000, i
}
Example #2
0
// 是否可以配送
// 返回是否可以配送,以及距离(米)
func (this *offlineShopImpl) CanDeliver(lng, lat float64) (bool, int) {
	shopLng, shopLat := this.GetLngLat()
	distance := lbs.GetLocDistance(shopLng, shopLat, lng, lat)
	i := int(distance)
	return i <= this._shopVal.DeliverRadius*1000, i
}