当前位置: 首页>>代码示例>>PHP>>正文


PHP Okapi::get_distance方法代码示例

本文整理汇总了PHP中okapi\Okapi::get_distance方法的典型用法代码示例。如果您正苦于以下问题:PHP Okapi::get_distance方法的具体用法?PHP Okapi::get_distance怎么用?PHP Okapi::get_distance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在okapi\Okapi的用法示例。


在下文中一共展示了Okapi::get_distance方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: call


//.........这里部分代码省略.........
                     // OC software allows entering anything here, and that's what users do.
                     // We do a formal verification so that only a valid GC code is returned:
                     if (preg_match('/^\\s*[Gg][Cc][A-Za-z0-9]+\\s*$/', $row['wp_gc'])) {
                         $entry['gc_code'] = strtoupper(trim($row['wp_gc']));
                     } else {
                         $entry['gc_code'] = null;
                     }
                     break;
                 case 'name':
                     $entry['name'] = $row['name'];
                     break;
                 case 'names':
                     $entry['names'] = array(Settings::get('SITELANG') => $row['name']);
                     break;
                     // for the future
                 // for the future
                 case 'location':
                     $entry['location'] = round($row['latitude'], 6) . "|" . round($row['longitude'], 6);
                     break;
                 case 'type':
                     $entry['type'] = Okapi::cache_type_id2name($row['type']);
                     break;
                 case 'status':
                     $entry['status'] = Okapi::cache_status_id2name($row['status']);
                     break;
                 case 'url':
                     $entry['url'] = Settings::get('SITE_URL') . "viewcache.php?wp=" . $row['wp_oc'];
                     break;
                 case 'owner':
                     $owner_ids[$row['wp_oc']] = $row['user_id'];
                     /* continued later */
                     break;
                 case 'distance':
                     $entry['distance'] = (int) Okapi::get_distance($center_lat, $center_lon, $row['latitude'], $row['longitude']);
                     break;
                 case 'bearing':
                     $tmp = Okapi::get_bearing($center_lat, $center_lon, $row['latitude'], $row['longitude']);
                     $entry['bearing'] = $tmp !== null ? (int) (10 * $tmp) / 10.0 : null;
                     break;
                 case 'bearing2':
                     $tmp = Okapi::get_bearing($center_lat, $center_lon, $row['latitude'], $row['longitude']);
                     $entry['bearing2'] = Okapi::bearing_as_two_letters($tmp);
                     break;
                 case 'bearing3':
                     $tmp = Okapi::get_bearing($center_lat, $center_lon, $row['latitude'], $row['longitude']);
                     $entry['bearing3'] = Okapi::bearing_as_three_letters($tmp);
                     break;
                 case 'is_found':
                     /* handled separately */
                     break;
                 case 'is_not_found':
                     /* handled separately */
                     break;
                 case 'is_watched':
                     /* handled separately */
                     break;
                 case 'is_ignored':
                     /* handled separately */
                     break;
                 case 'founds':
                     $entry['founds'] = $row['founds'] + 0;
                     break;
                 case 'notfounds':
                     if ($row['type'] != 6) {
                         # non-event
                         $entry['notfounds'] = $row['notfounds'] + 0;
开发者ID:Slini11,项目名称:okapi,代码行数:67,代码来源:geocaches.php


注:本文中的okapi\Okapi::get_distance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。