0
我正在研究nodejs后端的地理位置搜索。而mongodb是数据库。为了做到这一点,我从前端获得价值。我正在使用地图getbound来获取视口数据。以下是一些包含经度和纬度的变量。如何创建坐标数组?
var topLeftLong = parseFloat(req.body.topLeftLong);
var topLeftLat = parseFloat(req.body.topLeftLat);
var topRightLong = parseFloat(req.body.topRightLong);
var topRightLat = parseFloat(req.body.topRightLat);
var bottomRightLong = parseFloat(req.body.bottomRightLong);
var bottomRightLat = parseFloat(req.body.bottomRightLat);
var bottomLeftLong = parseFloat(req.body.bottomLeftLong);
var bottomLeftLat = parseFloat(req.body.bottomLeftLat);
虽然我得到这些数据,我想把经度和纬度放在一个数组中。但是每当我尝试在数组中推送数据时,我都会得到下面的错误。