parse-php-sdk geoPoint withinPolygon exception



我正在尝试在美国本土的MongoDB中查找位置。为此,我使用查询"withinPolygon"和围绕美国的矩形。不准确,但应该:)工作我得到的响应是"错误的约束:$geoWithin"(代码 107(

好奇是否有其他人使用过"withinPolygon"查询,我是否做错了什么?

以下是基本代码:

$query = new ParseParseQuery( "Church" );
$nwCornerContiguous = new ParseParseGeoPoint( $top, $left );
$neCornerContiguous = new ParseParseGeoPoint( $top, $right );
$swCornerContiguous = new ParseParseGeoPoint( $bottom, $left );
$seCornerContiguous = new ParseParseGeoPoint( $bottom, $right );
$query->withinPolygon( "locationGeopoint",
array( $nwCornerContiguous, $neCornerContiguous, $swCornerContiguous, 
$seCornerContiguous ) );
$results = $query->find();
  • PHP 版本: 5.5.38
  • 解析 PHP SDK 版本:1.4
  • 解析服务器版本:2.3.3-2

"withinPolygon"功能已添加到解析服务器版本 2.5