Author: ssthkjer
Date: 2007-02-19 15:31:21 +0100 (Mon, 19 Feb 2007)
New Revision: 4480

Modified:
   branches/2.9/core-api/src/main/java/no/geodata/maputil/CoordHelper.java
Log:
search-1628

Modified: 
branches/2.9/core-api/src/main/java/no/geodata/maputil/CoordHelper.java
===================================================================
--- branches/2.9/core-api/src/main/java/no/geodata/maputil/CoordHelper.java     
2007-02-19 14:03:47 UTC (rev 4479)
+++ branches/2.9/core-api/src/main/java/no/geodata/maputil/CoordHelper.java     
2007-02-19 14:31:21 UTC (rev 4480)
@@ -31,7 +31,7 @@
     public int defaultZoom = 2;
     public int imgWidth = 363; //bildestørrelse i pixler, bredde
     public int imgHeight = 363; //bildestørrelse i pixler, høyde
-    public final static int envFactor = 30; //faktor for å lage rom rundt 
envelope. Angis i pixler
+    public int envFactor = 30; //faktor for å lage rom rundt envelope. Angis i 
pixler
 
     public final static int iconPxSizeHeigth = 32;
     public final static int iconPxSizeWidth = 29;
@@ -63,7 +63,7 @@
     /** Creates a new instance of CoordHelper */
     public CoordHelper() {
     }
-    
+
     public void setDefaultZoomlevel(int defaultZoom) {
         this.defaultZoom = defaultZoom;
     }
@@ -71,7 +71,7 @@
     public int getDefaultZoomlevel() {
         return defaultZoom;
     }
-    
+
     /**
      * @param sCoord Coordinate string, x1,y1;x2,y2;x3,y3;x4,y4...osv.
      * @return Vector containing MapPoint objects.
@@ -168,7 +168,7 @@
         Vector mps = extractMapPoints(companies);
         return makeEnvelope(mps, zoomlevel);
     }
-    
+
     /**
      * Returns MapEnvelope from given list of company objects and converts 
coords to pixCoords
      * @param companies
@@ -255,7 +255,7 @@
     public MapEnvelope makeEnvelope(Vector vMapPoints) {
         return makeEnvelope(vMapPoints, getDefaultZoomlevel());
     }
-    
+
     /**
      * Generates MapEnvelope from a vector of points, imgwidth and imgheight.
      * @param vMapPoints vector containg MapPoints
@@ -436,7 +436,7 @@
         }
         double xOffset = (zoomscale * pixelSize) * adjustX;
         double yOffset = (zoomscale * pixelSize) * adjustY;
-        
+
         //boolean right = true;//flytter første like til høyre.
         for (int i = 0; i < vMapPoints.size(); i++) {
             mp1 = (MapPoint) vMapPoints.get(i);
@@ -549,9 +549,20 @@
         //double deltaY = me.getMaxY()-me.getMinY();
         zoomscale = Math.round(deltaX / imgMeterSize);
         //finne delta x/y
+
         return zoomscale;
     }
 
+    public int getZoomScaleInt(final MapEnvelope me) {
+        long zoomscale = 0;
+        double deltaX = me.getMaxX() - me.getMinX();
+        //double deltaY = me.getMaxY()-me.getMinY();
+        zoomscale = Math.round(deltaX / imgMeterSize);
+        int length = (int)zoomscale;
+
+        return length;
+    }
+
      /**
      * Returns zoomlevel for given zoomscale
      * @return zoomlevel
@@ -620,12 +631,12 @@
     public String getDefaultZoom() {
         return Integer.toString(defaultZoom);
     }
-    
+
     public int getImgWidth() {
 
         return imgWidth;
     }
-    
+
     public int getImgHeight() {
 
         return imgHeight;
@@ -648,6 +659,10 @@
         return envFactor;
     }
 
+    public void setEnvFactor(int env){
+        this.envFactor = env;
+    }
+
     public int getZoomCount() {
         return zoomCount;
     }
@@ -693,19 +708,19 @@
     public double getIconOffsetHeigth() {
         return iconOffsetHeigth;
     }
-    
+
     public void setIconOffsetHeigth(final int iconOffsetHeigth) {
         this.iconOffsetHeigth = iconOffsetHeigth;
     }
-    
+
     public double getIconOffsetWidth() {
         return iconOffsetWidth;
     }
-    
+
     public void setIconOffsetWidth(final int iconOffsetWidth) {
         this.iconOffsetWidth = iconOffsetWidth;
     }
-    
+
     public double getIconOverlapOffsetWidth() {
         return iconOverlapOffsetWidth;
     }

_______________________________________________
Kernel-commits mailing list
[email protected]
http://sesat.no/mailman/listinfo/kernel-commits

Reply via email to