svn commit: r598 - trunk/mapbender/http/javascripts/mod_wfs_SpatialRequest.php

christoph at osgeo.org christoph at osgeo.org
Wed Jun 21 10:14:04 EDT 2006


Author: christoph
Date: 2006-06-21 14:14:04+0000
New Revision: 598

Modified:
   trunk/mapbender/http/javascripts/mod_wfs_SpatialRequest.php

Log:
1 bugfix:

mod_wfs_spatialRequest_geometry null pointer exception in drawDashedLineExt()

Modified: trunk/mapbender/http/javascripts/mod_wfs_SpatialRequest.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_wfs_SpatialRequest.php?view=diff&rev=598&p1=trunk/mapbender/http/javascripts/mod_wfs_SpatialRequest.php&p2=trunk/mapbender/http/javascripts/mod_wfs_SpatialRequest.php&r1=597&r2=598
==============================================================================
--- trunk/mapbender/http/javascripts/mod_wfs_SpatialRequest.php	(original)
+++ trunk/mapbender/http/javascripts/mod_wfs_SpatialRequest.php	2006-06-21 14:14:04+0000
@@ -46,7 +46,7 @@
 var wfsAreaType_current = "";
 
 var activeButton = null;
-var mod_wfs_spatialRequest_geometry;
+var mod_wfs_spatialRequest_geometry = null;
 
 var mod_wfs_spatialRequest_frameName = "";
 var mod_wfs_spatialRequest_epsg;
@@ -251,15 +251,17 @@
 function drawDashedLineExt(){
 	var str_mPoints = "<div style='position:absolute;left:0px;top:0px' ><img src='"+mb_trans.src+"' width='"+mod_wfs_spatialRequest_width+"' height='0'></div>";
 	str_mPoints += "<div style='position:absolute;left:0px;top:0px' ><img src='"+mb_trans.src+"' width='0' height='"+mod_wfs_spatialRequest_height+"'></div>";
-	for(var i=0; i<mod_wfs_spatialRequest_geometry.count(); i++){
-		var pos = realToMap(mod_wfs_spatialRequest_target,mod_wfs_spatialRequest_geometry.get(i));
-		str_mPoints += "<div style='font-size:1px;position:absolute;top:"+(pos.y-2)+"px;left:"+(pos.x-2)+"px;width:3px;height:3px;background-color:#ff0000'></div>";
-	}
-	if(mod_wfs_spatialRequest_geometry.count()>1){
-		for(var k=1; k<mod_wfs_spatialRequest_geometry.count(); k++){
-			var pos0 = realToMap(mod_wfs_spatialRequest_target,mod_wfs_spatialRequest_geometry.get(k));
-			var pos1 = realToMap(mod_wfs_spatialRequest_target,mod_wfs_spatialRequest_geometry.get(k-1));
-			str_mPoints += evaluateDashesExt(pos1,pos0,k);
+	if (mod_wfs_spatialRequest_geometry != null) {
+		for(var i=0; i<mod_wfs_spatialRequest_geometry.count(); i++){
+			var pos = realToMap(mod_wfs_spatialRequest_target,mod_wfs_spatialRequest_geometry.get(i));
+			str_mPoints += "<div style='font-size:1px;position:absolute;top:"+(pos.y-2)+"px;left:"+(pos.x-2)+"px;width:3px;height:3px;background-color:#ff0000'></div>";
+		}
+		if(mod_wfs_spatialRequest_geometry.count()>1){
+			for(var k=1; k<mod_wfs_spatialRequest_geometry.count(); k++){
+				var pos0 = realToMap(mod_wfs_spatialRequest_target,mod_wfs_spatialRequest_geometry.get(k));
+				var pos1 = realToMap(mod_wfs_spatialRequest_target,mod_wfs_spatialRequest_geometry.get(k-1));
+				str_mPoints += evaluateDashesExt(pos1,pos0,k);
+			}
 		}
 	}
 	writeTag(mod_wfs_spatialRequest_target,"measuring",str_mPoints);




More information about the Mapbender_commits mailing list