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


PHP FabrikString::mapStrToCoords方法代码示例

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


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

示例1: onLoadJavascriptInstance

 /**
  * Return the javascript to create an instance of the class defined in formJavascriptClass
  *
  * @param   array  $args  Array [0] => string table's form id to contain plugin
  *
  * @return bool
  */
 public function onLoadJavascriptInstance($args)
 {
     parent::onLoadJavascriptInstance($args);
     if (!is_object($this->getMapElement())) {
         return false;
     }
     $params = $this->getParams();
     list($latitude, $longitude) = $this->getSearchLatLon();
     $opts = $this->getElementJSOptions();
     $containerOverride = FArrayHelper::getValue($args, 0, '');
     if (strstr($containerOverride, 'visualization')) {
         $opts->ref = str_replace('visualization_', '', $containerOverride);
     }
     $opts->steps = (int) $params->get('radius_max', 100);
     $opts->unit = $params->get('radius_unit', 'km');
     $opts->value = $this->getValue();
     $opts->lat = $latitude;
     $opts->lon = $longitude;
     $preFilterDistance = $params->get('prefilter_distance', '');
     $opts->prefilter = $preFilterDistance === '' ? false : true;
     $opts->prefilterDone = (bool) $this->app->input->getBool('radius_prefilter', false);
     $opts->prefilterDistance = $preFilterDistance;
     $opts->myloc = $params->get('myloc', 1) == 1 ? true : false;
     $o = FabrikString::mapStrToCoords($params->get('geocode_default', ''));
     $opts->geocode_default_lat = $o->lat;
     $opts->geocode_default_long = $o->long;
     $opts->geocode_default_zoom = (int) $o->zoom;
     $opts->geoCodeAsType = $params->get('geocode_as_type', 1);
     $opts->renderOrder = $this->renderOrder;
     $opts->offset_y = (int) $params->get('window_offset_y', '0');
     $opts = json_encode($opts);
     $this->jsInstance = "new FbListRadius_search({$opts})";
     JText::script('PLG_LIST_RADIUS_SEARCH_CLEAR_CONFIRM');
     JText::script('PLG_LIST_RADIUS_SEARCH_GEOCODE_ERROR');
     return true;
 }
开发者ID:jfquestiaux,项目名称:fabrik,代码行数:43,代码来源:radius_search.php

示例2: render

 /**
  * Draws the html form element
  *
  * @param   array  $data           To pre-populate element with
  * @param   int    $repeatCounter  Repeat group counter
  *
  * @return  string  elements html
  */
 public function render($data, $repeatCounter = 0)
 {
     $id = $this->getHTMLId($repeatCounter);
     $name = $this->getHTMLName($repeatCounter);
     $element = $this->getElement();
     $val = $this->getValue($data, $repeatCounter);
     $params = $this->getParams();
     $w = $params->get('fb_gm_mapwidth');
     $h = $params->get('fb_gm_mapheight');
     $str = '';
     if ($this->_useStaticMap()) {
         return $this->_staticMap($val, null, null, null, $repeatCounter, false, $data);
     } else {
         if ($element->hidden == '1') {
             return $this->getHiddenField($name, $data[$name], $id);
         }
         if (!$this->isEditable() && $val != '' || $this->isEditable()) {
             $layout = $this->getLayout('form');
             $layoutData = new stdClass();
             $layoutData->id = $id;
             $coords = FabrikString::mapStrToCoords($val);
             $layoutData->coords = $coords->coords;
             $layoutData->geoCodeEvent = $params->get('fb_gm_geocode_event', 'button');
             $layoutData->geocode = $params->get('fb_gm_geocode');
             $layoutData->editable = $this->isEditable();
             $layoutData->width = $w;
             $layoutData->height = $h;
             $layoutData->name = $name;
             $layoutData->label = $element->label;
             $layoutData->value = htmlspecialchars($val, ENT_QUOTES);
             $layoutData->dms = $this->_strToDMS($val);
             $layoutData->osref = "";
             $layoutData->staticmap = $params->get('fb_gm_staticmap');
             $layoutData->showdms = $params->get('fb_gm_latlng_dms');
             $layoutData->showlatlng = $params->get('fb_gm_latlng');
             $layoutData->showosref = $params->get('fb_gm_latlng_osref');
             return $layout->render($layoutData);
         } else {
             $str .= FText::_('PLG_ELEMENT_GOOGLEMAP_NO_LOCATION_SELECTED');
         }
         /*
          * $$$ hugh - not sure why we still do this.  If they want to show lat/lng details, they can use the
          * gm_latlng option.  Problem with showing this is we never change it, so it's misleading.
          */
         // $str .= $this->_microformat($val);
         return $str;
     }
 }
开发者ID:jfquestiaux,项目名称:fabrik,代码行数:56,代码来源:googlemap.php


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