瀏覽代碼

fixed view the_geom on map widget

Piotr Labudda 8 年之前
父節點
當前提交
288f4e91a1
共有 2 個文件被更改,包括 7 次插入11 次删除
  1. 3 0
      SE/se-lib/AclQueryFeatures.php
  2. 4 11
      SE/se-lib/TableAjaxMap.php

+ 3 - 0
SE/se-lib/AclQueryFeatures.php

@@ -73,6 +73,9 @@ class AclQueryFeatures {
 		if ('NULL' === $searchQuery) return ['is null', null];
 		if ('IS NULL' === $searchQuery) return ['is null', null];
 		switch ($fieldType) {
+			case 'p5Type:polygon':
+			case 'p5Type:lineString':
+			case 'p5Type:point':
 			case 'gml:PolygonPropertyType':
 			case 'gml:PointPropertyType':
 			case 'gml:LineStringPropertyType':

+ 4 - 11
SE/se-lib/TableAjaxMap.php

@@ -1426,24 +1426,17 @@ class TableAjaxMapWfsAction {
 					18.614273071289062 54.33634445792519
 					18.614273071289062 54.33614429135817
 		 */
-		Lib::loadClass('Data_Source');
-		$dataSource = new Data_Source($this->_acl->getDB());
-		$dataSource->setTable($this->_acl->getName());
-		$dataSource->addCol('ID');
-		$dataSource->addCol('the_geom');
-		$dataSource->setColTypes($this->_acl->getTypes());
-
 		$params = array();
 		$params['limit'] = 10000;
 		if (!empty($args['BBOX'])) {
 			$params['f_the_geom'] = 'BBOX:' . implode(',', $args['BBOX']);
 		}
-		$items = $dataSource->getItems($params);
+		$items = $this->_acl->buildQuery($params)->getItems();
 
 		$buildingsGml = array();
-		foreach ($items as $r) {
-			if (!empty($r->the_geom)) {
-				$buildingsGml[$r->ID] = $this->generateGmlFromWKT($r->the_geom);
+		foreach ($items as $item) {
+			if (!empty( $item['the_geom'] )) {
+				$buildingsGml[ $item['@primaryKey'] ] = $this->generateGmlFromWKT( $item['the_geom'] );
 			}
 		}