[Webflysuesk-commits] r53 - in webflysuesk/branches/openlayers-integration: . webflys/src/main/webapp/pages

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Apr 8 16:53:38 CEST 2009


Author: iweinzierl
Date: 2009-04-08 16:53:36 +0200 (Wed, 08 Apr 2009)
New Revision: 53

Modified:
   webflysuesk/branches/openlayers-integration/ChangeLog.txt
   webflysuesk/branches/openlayers-integration/webflys/src/main/webapp/pages/InteractiveRangeSelection.js
Log:
Buffer for specification of the nearest feature to a clickpoint depends on the resolution of the map.

Modified: webflysuesk/branches/openlayers-integration/ChangeLog.txt
===================================================================
--- webflysuesk/branches/openlayers-integration/ChangeLog.txt	2009-04-08 14:09:00 UTC (rev 52)
+++ webflysuesk/branches/openlayers-integration/ChangeLog.txt	2009-04-08 14:53:36 UTC (rev 53)
@@ -1,5 +1,15 @@
 2009-04-08  Ingo Weinzierl <ingo.weinzierl at intevation.de>
 	
+	* webflys/src/main/webapp/pages/InteractiveRangeSelection.js: The buffer for
+	  the specification of the nearest feature of a clickpoint, now depends on 
+	  the resolution of the map.
+
+2009-04-08  Ingo Weinzierl <ingo.weinzierl at intevation.de>
+
+	* ChangeLog.txt: Attention: r52 is broken.
+	
+2009-04-08  Ingo Weinzierl <ingo.weinzierl at intevation.de>
+	
 	* webflys/src/main/webapp/pages/DrawMarker.js,
 	  webflys/src/main/webapp/pages/InteractiveRangeSelection.js: Bugfix: 
 	  markers will be drawn only after the user has activated the tool in the

Modified: webflysuesk/branches/openlayers-integration/webflys/src/main/webapp/pages/InteractiveRangeSelection.js
===================================================================
--- webflysuesk/branches/openlayers-integration/webflys/src/main/webapp/pages/InteractiveRangeSelection.js	2009-04-08 14:09:00 UTC (rev 52)
+++ webflysuesk/branches/openlayers-integration/webflys/src/main/webapp/pages/InteractiveRangeSelection.js	2009-04-08 14:53:36 UTC (rev 53)
@@ -24,8 +24,8 @@
 
     var options = {
         title:  "Interaktive Streckenauswahl",
-        maxCount: 2
-        //displayClass: 'olControlDrawMarker'
+        maxCount: 2,
+        displayClass: 'olControlDrawMarker'
     };
 
     tool = new DrawMarker(
@@ -178,13 +178,12 @@
 function createBBoxFromPoint(lonlat) {
 
     var res = map.getResolutionForZoom(map.getZoom());
-    console.log('Resolution: ' + res);
-    //var buf = calcBufferSize(res);
+    var buf = calcBufferSize(res);
 
-    var minx = lonlat.lon - buffer;
-    var miny = lonlat.lat - buffer;
-    var maxx = lonlat.lon + buffer;
-    var maxy = lonlat.lat + buffer;
+    var minx = lonlat.lon - buf;
+    var miny = lonlat.lat - buf;
+    var maxx = lonlat.lon + buf;
+    var maxy = lonlat.lat + buf;
 
     return new OpenLayers.Bounds(minx, miny, maxx, maxy);
 }
@@ -198,7 +197,7 @@
  * {Number} Size
  */
 function calcBufferSize(res) {
-    
+    return Math.sqrt(res) * 50;
 }
 
 



More information about the Webflysuesk-commits mailing list