Tag: 半径

mongodb和谷歌地图 – 获取半径没有不准确的地点

我在mongodb模式下存储了如下所示的位置: location: { type: [Number], index: '2d' } 而在networking客户端,我使用谷歌地图API与自定义半径resize: 在每次拖动我正在请求与客户端上计算的半径值。 半径是粉红色箭头标记和中心坐标之间的距离: function metersToMiles (meters) { return meters * 0.000621371192; } google.maps.event.addListener(this.sizer, 'dragend', () => { const radius = this.circle.getRadius(); const radiusValue = Math.round(metersToMiles(radius) * 10) / 10; // convert to tenths (this is shown on UI as well) this.props.onRadiusChange(radiusValue); // it's a react component }); […]