avoid warnings when geometry of object cannot be determined

This commit is contained in:
Sarah Hoffmann
2012-02-06 23:14:21 +00:00
parent 3abbeb5f08
commit 7239687e5b
3 changed files with 4 additions and 2 deletions

View File

@@ -74,10 +74,12 @@ body {
var proj_map = map.getProjectionObject();
var latlon;
<?php
if (isset($aPolyPoints)) {
foreach($aPolyPoints as $aPolyPoint)
{
echo " pointList.push(new OpenLayers.Geometry.Point(".$aPolyPoint[1].",".$aPolyPoint[2]."));\n";
}
}
?>
var linearRing = new OpenLayers.Geometry.LinearRing(pointList).transform(proj_EPSG4326, proj_map);;
var polygonFeature = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon([linearRing]),null,style);

View File

@@ -42,7 +42,7 @@
echo ','.$aResult['aBoundingBox'][3];
echo '"';
if ($bShowPolygons)
if ($bShowPolygons && isset($aResult['aPolyPoints']))
{
echo ' polygonpoints=\'';
echo javascript_renderData($aResult['aPolyPoints']);