Line length
This commit is contained in:
parent
96140680ee
commit
de5c41d537
@ -45,7 +45,8 @@ abstract class PMA_GIS_Geometry
|
||||
public abstract function prepareRowAsPdf($spatial, $label, $color, $scale_data, $pdf);
|
||||
|
||||
/**
|
||||
* Prepares the JavaScript related to a row in the GIS dataset to visualize it with OpenLayers.
|
||||
* Prepares the JavaScript related to a row in the GIS dataset
|
||||
* to visualize it with OpenLayers.
|
||||
*
|
||||
* @param string $spatial GIS data object
|
||||
* @param int $srid Spatial reference ID
|
||||
@ -77,9 +78,11 @@ abstract class PMA_GIS_Geometry
|
||||
protected function getBoundsForOl($srid, $scale_data)
|
||||
{
|
||||
return 'bound = new OpenLayers.Bounds(); bound.extend(new OpenLayers.LonLat('
|
||||
. $scale_data['minX'] . ', ' . $scale_data['minY'] . ').transform(new OpenLayers.Projection("EPSG:'
|
||||
. $scale_data['minX'] . ', ' . $scale_data['minY']
|
||||
. ').transform(new OpenLayers.Projection("EPSG:'
|
||||
. $srid . '"), map.getProjectionObject())); bound.extend(new OpenLayers.LonLat('
|
||||
. $scale_data['maxX'] . ', ' . $scale_data['maxY'] . ').transform(new OpenLayers.Projection("EPSG:'
|
||||
. $scale_data['maxX'] . ', ' . $scale_data['maxY']
|
||||
. ').transform(new OpenLayers.Projection("EPSG:'
|
||||
. $srid . '"), map.getProjectionObject()));';
|
||||
}
|
||||
|
||||
@ -173,8 +176,10 @@ abstract class PMA_GIS_Geometry
|
||||
$points_arr = $this->extractPoints($polygon, null);
|
||||
$row .= 'new OpenLayers.Geometry.LinearRing(new Array(';
|
||||
foreach ($points_arr as $point) {
|
||||
$row .= '(new OpenLayers.Geometry.Point(' . $point[0] . ', ' . $point[1] . '))'
|
||||
. '.transform(new OpenLayers.Projection("EPSG:' . $srid . '"), map.getProjectionObject()), ';
|
||||
$row .= '(new OpenLayers.Geometry.Point('
|
||||
. $point[0] . ', ' . $point[1] . '))'
|
||||
. '.transform(new OpenLayers.Projection("EPSG:'
|
||||
. $srid . '"), map.getProjectionObject()), ';
|
||||
}
|
||||
$row = substr($row, 0, strlen($row) - 2);
|
||||
$row .= '))';
|
||||
@ -185,8 +190,10 @@ abstract class PMA_GIS_Geometry
|
||||
$points_arr = $this->extractPoints($ring, null);
|
||||
$row .= 'new OpenLayers.Geometry.LinearRing(new Array(';
|
||||
foreach ($points_arr as $point) {
|
||||
$row .= '(new OpenLayers.Geometry.Point(' . $point[0] . ', ' . $point[1] . '))'
|
||||
. '.transform(new OpenLayers.Projection("EPSG:' . $srid . '"), map.getProjectionObject()), ';
|
||||
$row .= '(new OpenLayers.Geometry.Point('
|
||||
. $point[0] . ', ' . $point[1] . '))'
|
||||
. '.transform(new OpenLayers.Projection("EPSG:'
|
||||
. $srid . '"), map.getProjectionObject()), ';
|
||||
}
|
||||
$row = substr($row, 0, strlen($row) - 2);
|
||||
$row .= ')), ';
|
||||
|
||||
@ -165,7 +165,8 @@ class PMA_GIS_Geometrycollection extends PMA_GIS_Geometry
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepares JavaScript related to a row in the GIS dataset to visualize it with OpenLayers.
|
||||
* Prepares JavaScript related to a row in the GIS dataset
|
||||
* to visualize it with OpenLayers.
|
||||
*
|
||||
* @param string $spatial GIS GEOMETRYCOLLECTION object
|
||||
* @param int $srid Spatial reference ID
|
||||
|
||||
@ -154,7 +154,8 @@ class PMA_GIS_Linestring extends PMA_GIS_Geometry
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepares JavaScript related to a row in the GIS dataset to visualize it with OpenLayers.
|
||||
* Prepares JavaScript related to a row in the GIS dataset
|
||||
* to visualize it with OpenLayers.
|
||||
*
|
||||
* @param string $spatial GIS LINESTRING object
|
||||
* @param int $srid Spatial reference ID
|
||||
@ -183,8 +184,9 @@ class PMA_GIS_Linestring extends PMA_GIS_Geometry
|
||||
|
||||
$row = 'new Array(';
|
||||
foreach ($points_arr as $point) {
|
||||
$row .= '(new OpenLayers.Geometry.Point(' . $point[0] . ', ' . $point[1] . '))'
|
||||
. '.transform(new OpenLayers.Projection("EPSG:' . $srid . '"), map.getProjectionObject()), ';
|
||||
$row .= '(new OpenLayers.Geometry.Point(' . $point[0] . ', '
|
||||
. $point[1] . ')).transform(new OpenLayers.Projection("EPSG:'
|
||||
. $srid . '"), map.getProjectionObject()), ';
|
||||
}
|
||||
$row = substr($row, 0, strlen($row) - 2);
|
||||
$row .= ')';
|
||||
|
||||
@ -179,7 +179,8 @@ class PMA_GIS_Multilinestring extends PMA_GIS_Geometry
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepares JavaScript related to a row in the GIS dataset to visualize it with OpenLayers.
|
||||
* Prepares JavaScript related to a row in the GIS dataset
|
||||
* to visualize it with OpenLayers.
|
||||
*
|
||||
* @param string $spatial GIS MULTILINESTRING object
|
||||
* @param int $srid Spatial reference ID
|
||||
@ -213,8 +214,9 @@ class PMA_GIS_Multilinestring extends PMA_GIS_Geometry
|
||||
$points_arr = $this->extractPoints($linestring, null);
|
||||
$row .= 'new OpenLayers.Geometry.LineString(new Array(';
|
||||
foreach ($points_arr as $point) {
|
||||
$row .= '(new OpenLayers.Geometry.Point(' . $point[0] . ', ' . $point[1] . '))'
|
||||
. '.transform(new OpenLayers.Projection("EPSG:' . $srid . '"), map.getProjectionObject()), ';
|
||||
$row .= '(new OpenLayers.Geometry.Point(' . $point[0] . ', '
|
||||
. $point[1] . ')).transform(new OpenLayers.Projection("EPSG:'
|
||||
. $srid . '"), map.getProjectionObject()), ';
|
||||
}
|
||||
$row = substr($row, 0, strlen($row) - 2);
|
||||
$row .= ')), ';
|
||||
|
||||
@ -143,7 +143,8 @@ class PMA_GIS_Multipoint extends PMA_GIS_Geometry
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepares JavaScript related to a row in the GIS dataset to visualize it with OpenLayers.
|
||||
* Prepares JavaScript related to a row in the GIS dataset
|
||||
* to visualize it with OpenLayers.
|
||||
*
|
||||
* @param string $spatial GIS MULTIPOINT object
|
||||
* @param int $srid Spatial reference ID
|
||||
@ -175,8 +176,9 @@ class PMA_GIS_Multipoint extends PMA_GIS_Geometry
|
||||
|
||||
$row = 'new Array(';
|
||||
foreach ($points_arr as $point) {
|
||||
$row .= '(new OpenLayers.Geometry.Point(' . $point[0] . ', ' . $point[1] . '))'
|
||||
. '.transform(new OpenLayers.Projection("EPSG:' . $srid . '"), map.getProjectionObject()), ';
|
||||
$row .= '(new OpenLayers.Geometry.Point(' . $point[0] . ', ' . $point[1]
|
||||
. ')).transform(new OpenLayers.Projection("EPSG:' . $srid
|
||||
. '"), map.getProjectionObject()), ';
|
||||
}
|
||||
$row = substr($row, 0, strlen($row) - 2);
|
||||
$row .= ')';
|
||||
|
||||
@ -154,7 +154,8 @@ class PMA_GIS_Multipolygon extends PMA_GIS_Geometry
|
||||
|
||||
foreach ($inner as $inner_poly) {
|
||||
$points_arr = array_merge(
|
||||
$points_arr, $this->extractPoints($inner_poly, $scale_data, true)
|
||||
$points_arr,
|
||||
$this->extractPoints($inner_poly, $scale_data, true)
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -223,7 +224,8 @@ class PMA_GIS_Multipolygon extends PMA_GIS_Geometry
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepares JavaScript related to a row in the GIS dataset to visualize it with OpenLayers.
|
||||
* Prepares JavaScript related to a row in the GIS dataset
|
||||
* to visualize it with OpenLayers.
|
||||
*
|
||||
* @param string $spatial GIS MULTIPOLYGON object
|
||||
* @param int $srid Spatial reference ID
|
||||
|
||||
@ -136,7 +136,8 @@ class PMA_GIS_Point extends PMA_GIS_Geometry
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepares JavaScript related to a row in the GIS dataset to visualize it with OpenLayers.
|
||||
* Prepares JavaScript related to a row in the GIS dataset
|
||||
* to visualize it with OpenLayers.
|
||||
*
|
||||
* @param string $spatial GIS POINT object
|
||||
* @param int $srid Spatial reference ID
|
||||
@ -167,9 +168,10 @@ class PMA_GIS_Point extends PMA_GIS_Geometry
|
||||
$points_arr = $this->extractPoints($point, null);
|
||||
|
||||
$result .= 'vectorLayer.addFeatures(new OpenLayers.Feature.Vector(('
|
||||
. 'new OpenLayers.Geometry.Point(' . $points_arr[0][0] . ', ' . $points_arr[0][1] . ')'
|
||||
. '.transform(new OpenLayers.Projection("EPSG:' . $srid . '"), map.getProjectionObject())),'
|
||||
. ' null, ' . json_encode($style_options) . '));';
|
||||
. 'new OpenLayers.Geometry.Point(' . $points_arr[0][0] . ', '
|
||||
. $points_arr[0][1] . ').transform(new OpenLayers.Projection("EPSG:'
|
||||
. $srid . '"), map.getProjectionObject())), null, '
|
||||
. json_encode($style_options) . '));';
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
@ -206,7 +206,8 @@ class PMA_GIS_Polygon extends PMA_GIS_Geometry
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepares JavaScript related to a row in the GIS dataset to visualize it with OpenLayers.
|
||||
* Prepares JavaScript related to a row in the GIS dataset
|
||||
* to visualize it with OpenLayers.
|
||||
*
|
||||
* @param string $spatial GIS POLYGON object
|
||||
* @param int $srid Spatial reference ID
|
||||
|
||||
@ -209,7 +209,10 @@ class PMA_GIS_Visualization
|
||||
|
||||
// fill the background
|
||||
$bg = imagecolorallocate($image, 229, 229, 229);
|
||||
imagefilledrectangle($image, 0, 0, $this->_settings['width'] - 1, $this->_settings['height'] - 1, $bg);
|
||||
imagefilledrectangle(
|
||||
$image, 0, 0, $this->_settings['width'] - 1,
|
||||
$this->_settings['height'] - 1, $bg
|
||||
);
|
||||
|
||||
$scale_data = $this->_scaleDataSet($this->_data);
|
||||
$image = $this->_prepareDataSet($this->_data, 0, $scale_data, 'png', $image);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user