本文整理匯總了PHP中Point::setSRID方法的典型用法代碼示例。如果您正苦於以下問題:PHP Point::setSRID方法的具體用法?PHP Point::setSRID怎麽用?PHP Point::setSRID使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Point
的用法示例。
在下文中一共展示了Point::setSRID方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: location
/**
* Logs a user's location.
*
* @param WP $wp Wordpress object.
* @return boolean True if the request was handled.
*/
private static function location($wp)
{
if (isset($wp->query_vars['lat']) && isset($wp->query_vars['lon']) && isset($wp->query_vars['acc']) && isset($wp->query_vars['user-id']) && isset($wp->query_vars['collection-id'])) {
$collection = get_post($wp->query_vars['collection-id']);
if (!$collection) {
return false;
}
$user = XMapsUser::get_user_by_api_key($wp->query_vars['key']);
if ($user->id != $wp->query_vars['user-id']) {
return false;
}
$geom = new Point($wp->query_vars['lon'], $wp->query_vars['lat']);
$geom->setSRID(XMAPS_SRID);
$wkt = new WKT();
$location = $wkt->write($geom);
XMapsDatabase::log_location($user->id, $wp->query_vars['key'], $wp->query_vars['collection-id'], $location, floatval($wp->query_vars['acc']));
return true;
}
return false;
}