TP3.2.3怎么执行Mongodb里搜索多边形地图的功能

浏览:624 发布日期:2016/11/08 分类:求助交流
如题,我现在在做一个在地图上画圈显示圈内标点的功能 请问在TP3.2.3里怎么写啊

$cont = new \Think\Model\MongoModel("house_general");
$param = array('base_point'=>array('$geoWithin'=>array('$polygon'=>-45.917165194462875,170.4756662249565,-45.917161462449876,170.4756662249565,-45.91711667827437,170.47570377588272,-45.91709055415529,170.4757735133171,-45.91708309011901,170.4759880900383,-45.91708309011901,170.4760578274727)));

$result=$cont->where($param)->limit(10)->field(array("address"=>true,"_id"=>true,"base_point"=>true))->select();
我是这么写的报错: 127.0.0.1:27017: Malformed geo query: { $geoWithin: { $polygon: "-45.917064430023906,170.47556966543198,-45.91700471767744,170.4758432507515,-45.91698978958078,170.47599345445633,-45.91698605755599,170.4762348532676..." } }
错误位置

FILE: /phpstudy/www/Tiger/ThinkPHP/Library/Think/Db/Driver/Mongo.class.php  LINE: 418


求助!!!
最佳答案
评论( 相关
后面还有条评论,点击查看>>