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


PHP XMLElement::getProperty方法代码示例

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


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

示例1: addElement

    public function addElement(XMLElement $element)
    {
        $name = $element->name();
        $value = $element->value();

        switch ($name)
        {
            case 'NAME':
                $this->layerName = $value;
                break;
            case 'TITLE':
                $this->title = $value;
                break;
            case 'ABSTRACT':
                $this->abstract = $value;
                break;
            case 'MAXSCALEDENOMINATOR':
                $this->maxScaleDenom = $value;
                break;
            case 'MINSCALEDENOMINATOR':
                $this->minScaleDenom = $value;
                break;
            case 'CRS':
                $projNumber = end(explode(':', $value));
                $this->projections[$projNumber] = $value;
                break;
            case 'EX_GEOGRAPHICBOUNDINGBOX':
                $this->bboxes[self::GEOGRAPHIC_PROJECTION] = array(
                    'xmin' => $element->getProperty('WESTBOUNDLONGITUDE'),
                    'xmax' => $element->getProperty('EASTBOUNDLONGITUDE'),
                    'ymin' => $element->getProperty('SOUTHBOUNDLATITUDE'),
                    'ymax' => $element->getProperty('NORTHBOUNDLATITUDE'),
                    );
                break;
            case 'BOUNDINGBOX':
                $this->bboxes[$element->getAttrib('CRS')] = array(
                    'xmin' => $element->getAttrib('MINX'),
                    'xmax' => $element->getAttrib('MAXX'),
                    'ymin' => $element->getAttrib('MINY'),
                    'ymax' => $element->getAttrib('MAXY'),
                    );
                break;
            case 'STYLE':
                $this->styles[] = $element;
                break;
            default:
                parent::addElement($element);
                break;
        }
    }
开发者ID:nicosiseng,项目名称:Kurogo-Mobile-Web,代码行数:50,代码来源:WMSDataParser.php

示例2: addElement

 public function addElement(XMLElement $element)
 {
     $name = $element->name();
     $value = $element->value();
     switch ($name) {
         case 'ICONSTYLE':
             $iconChild = $element->getChildElement('ICON');
             $this->iconStyle = array(MapStyle::ICON => $iconChild->getProperty('HREF'), MapStyle::WIDTH => $element->getProperty('W'), MapStyle::HEIGHT => $element->getProperty('H'), MapStyle::SCALE => $element->getProperty('SCALE'));
             break;
         case 'BALLOONSTYLE':
             $this->balloonStyle = array(MapStyle::FILLCOLOR => $element->getProperty('BGCOLOR'), MapStyle::COLOR => $element->getProperty('TEXTCOLOR'));
             break;
         case 'LINESTYLE':
             $this->lineStyle = array(MapStyle::COLOR => $element->getProperty('COLOR'), MapStyle::WEIGHT => $element->getProperty('WEIGHT'));
             break;
         case 'POLYSTYLE':
             // if OUTLINE == 1, keep track and use lineStyle for outlines
             // if FILL == 1, use supplied color, otherwise just ignore color
             $shouldFill = $element->getProperty('FILL');
             $color = $shouldFill ? $element->getProperty('COLOR') : null;
             $this->polyStyle = array(MapStyle::FILLCOLOR => $color, MapStyle::SHOULD_OUTLINE => $element->getProperty('OUTLINE'));
             break;
         case 'LABELSTYLE':
             $this->labelStyle = array();
             break;
         case 'LISTSTYLE':
             $this->listStyle = array();
             break;
         case 'PAIR':
             $state = $element->getProperty('KEY');
             $styleRef = substr($element->getProperty('STYLEURL'), 1);
             $style = $this->styleContainer->getStyle($styleRef);
             // store the style URL if the parser hasn't yet loaded the associated simple style
             if ($state == 'normal') {
                 $this->normalStyle = $style ? $styleRef : $style;
             } else {
                 if ($state == 'highlighted') {
                     $this->highlightStyle = $style ? $styleRef : $style;
                 }
             }
             break;
         default:
             parent::addElement($element);
             break;
     }
 }
开发者ID:nncsang,项目名称:Kurogo,代码行数:46,代码来源:KMLStyle.php

示例3: addElement

 public function addElement(XMLElement $element)
 {
     $name = $element->name();
     $value = $element->value();
     switch ($name) {
         case 'NAME':
             $this->layerName = $value;
             break;
         case 'TITLE':
             $this->title = $value;
             break;
         case 'ABSTRACT':
             $this->abstract = $value;
             break;
         case 'MAXSCALEDENOMINATOR':
             $this->maxScaleDenom = $value;
             break;
         case 'MINSCALEDENOMINATOR':
             $this->minScaleDenom = $value;
             break;
         case 'CRS':
             $projNumber = end(explode(':', $value));
             if ($projNumber == '4326') {
                 // 4326 flips x and y cooordinates (x = lat, y = lon)
                 // TODO we need a better way to deal with this special case
                 $this->projections[$projNumber] = self::GEOGRAPHIC_PROJECTION;
             } else {
                 $this->projections[$projNumber] = $value;
             }
             break;
         case 'EX_GEOGRAPHICBOUNDINGBOX':
             $this->bboxes[self::GEOGRAPHIC_PROJECTION] = array('xmin' => floatval($element->getProperty('WESTBOUNDLONGITUDE')), 'xmax' => floatval($element->getProperty('EASTBOUNDLONGITUDE')), 'ymin' => floatval($element->getProperty('SOUTHBOUNDLATITUDE')), 'ymax' => floatval($element->getProperty('NORTHBOUNDLATITUDE')));
             break;
         case 'BOUNDINGBOX':
             $this->bboxes[$element->getAttrib('CRS')] = array('xmin' => floatval($element->getAttrib('MINX')), 'xmax' => floatval($element->getAttrib('MAXX')), 'ymin' => floatval($element->getAttrib('MINY')), 'ymax' => floatval($element->getAttrib('MAXY')));
             break;
         case 'STYLE':
             $this->styles[] = $element;
             break;
         default:
             parent::addElement($element);
             break;
     }
 }
开发者ID:nncsang,项目名称:Kurogo,代码行数:44,代码来源:WMSDataParser.php


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