[Mapbender-commits] r9200 - in trunk/mapbender/http: php plugins
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Thu May 21 05:16:39 PDT 2015
Author: syed
Date: 2015-05-21 05:16:39 -0700 (Thu, 21 May 2015)
New Revision: 9200
Modified:
trunk/mapbender/http/php/mod_CalculateAreaAndLength.php
trunk/mapbender/http/plugins/mb_digitize_widget.php
Log:
add handling for feature-attributes by using json-attributeschema -- minor bugfix
Modified: trunk/mapbender/http/php/mod_CalculateAreaAndLength.php
===================================================================
--- trunk/mapbender/http/php/mod_CalculateAreaAndLength.php 2015-05-21 12:14:28 UTC (rev 9199)
+++ trunk/mapbender/http/php/mod_CalculateAreaAndLength.php 2015-05-21 12:16:39 UTC (rev 9200)
@@ -27,11 +27,9 @@
// calculate length of a linetring
// var_dump($geom_data);die;
if ($geom_type == 'line') {
-
$sql = "SELECT st_length(st_GeogFromText( $1 )) as meter";
} else if ($geom_type == 'polygon') {
-
$sql = "SELECT st_area(st_GeogFromText( $1 )) as sqm, st_length(st_GeogFromText( $1 )) as meter ";
}
@@ -42,15 +40,13 @@
//fetch the array
$rslt= array();
-while($row = db_fetch_array($res)){
+while ($row = db_fetch_array($res)) {
+ $rslt[0] = round(floatval($row[0]), 4);
- $rslt[0] = round(floatval($row[0]),4);
+ if (sizeof($row) > 1) {
+ $rslt[1] = round(floatval($row[1]), 4);
- if (sizeof($row) > 1) {
-
- $rslt[1] = round(floatval($row[1]),4);
-
- }
+ }
}
Modified: trunk/mapbender/http/plugins/mb_digitize_widget.php
===================================================================
--- trunk/mapbender/http/plugins/mb_digitize_widget.php 2015-05-21 12:14:28 UTC (rev 9199)
+++ trunk/mapbender/http/plugins/mb_digitize_widget.php 2015-05-21 12:16:39 UTC (rev 9200)
@@ -738,7 +738,6 @@
attributesDialog.prepend(geometryDiv);
attributesDialog.find('.digitize-add').bind('click', function() {
- console.log( "click" );
var newRow = $('<tr><td><input style="width:81px" type="text"></input></td><td><input style="width:100px" type="text"></input></td></tr>');
attributesDialog.find('.ftr-data-tbl.Custom-Data').append(newRow);
newRow.find('input').first().bind('change', function() {
More information about the Mapbender_commits
mailing list