Potlatch 0.7
authorRichard Fairhurst <richard@systemed.net>
Fri, 1 Feb 2008 17:19:11 +0000 (17:19 +0000)
committerRichard Fairhurst <richard@systemed.net>
Fri, 1 Feb 2008 17:19:11 +0000 (17:19 +0000)
app/controllers/amf_controller.rb
app/models/geo_record.rb
app/views/site/edit.rhtml
public/potlatch/potlatch.swf

index e83ed4bb1c0239f9ae4779eb0c89610084f27524..2ef309fee0ff5714efe2219bc14f7822eee9976d 100644 (file)
@@ -733,11 +733,11 @@ class AmfController < ApplicationController
   # Co-ordinate conversion
 
   def lat2coord(a,basey,masterscale) #:doc:
-    -(lat2y(a)-basey)*masterscale+250
+    -(lat2y(a)-basey)*masterscale
   end
 
   def long2coord(a,baselong,masterscale) #:doc:
-    (a-baselong)*masterscale+350
+    (a-baselong)*masterscale
   end
 
   def lat2y(a) #:doc:
@@ -745,11 +745,11 @@ class AmfController < ApplicationController
   end
 
   def coord2lat(a,masterscale,basey) #:doc:
-    y2lat((a-250)/-masterscale+basey)
+    y2lat(a/-masterscale+basey)
   end
 
   def coord2long(a,masterscale,baselong) #:doc:
-    (a-350)/masterscale+baselong
+    a/masterscale+baselong
   end
 
   def y2lat(a)
index e675b11e0d354b8d3d43e3bce9717c51302bfb16..08808d352e87c8cb12ceb16e4fe7995ad2e3304c 100644 (file)
@@ -29,13 +29,13 @@ class GeoRecord < ActiveRecord::Base
     return self.longitude.to_f / 10000000
   end
 
-  # fuck knows
+  # Potlatch projections
   def lon_potlatch(baselong,masterscale)
-    (self.lon-baselong)*masterscale+350
+    (self.lon-baselong)*masterscale
   end
 
   def lat_potlatch(basey,masterscale)
-    -(lat2y(self.lat)-basey)*masterscale+250
+    -(lat2y(self.lat)-basey)*masterscale
   end
   
   private
index fa693051b677f10f7917dc3f4c79d2037ad727e9..ab6d70575bef726d52974de248e737edb7072a6e 100644 (file)
@@ -46,8 +46,9 @@
 <%= javascript_include_tag 'swfobject.js' %>
 <script type="text/javascript">
   var brokenContentSize = $("content").offsetWidth == 0;
-  var fo = new SWFObject("/potlatch/potlatch.swf?d="+Math.round(Math.random()*1000), "potlatch", "700", "600", "6", "#FFFFFF");
-  var changesaved = true;
+  var fo = new SWFObject("/potlatch/potlatch.swf?d="+Math.round(Math.random()*1000), "potlatch", "100%", "100%", "6", "#FFFFFF");
+  // 700,600 for fixed size, 100%,100% for resizable
+  var changesaved=true;
   var winie=false; if (document.all && window.print) { winie=true; }
   
   window.onbeforeunload=function() {
@@ -63,7 +64,7 @@
     fo.addVariable('scale',sc);
     fo.addVariable('token','<%= session[:token] %>');
     <% if params['gpx'] %>
-    fo.addVariable('gpx','<%= h(params['gpx']) + "/data" %>');
+    fo.addVariable('gpx','<%= h(params['gpx']) + "/data.xml" %>');
     <% end %>
     fo.write("map");
   }
index 1832c0a0df576f4b2e8ba39894a5d9b10bb10cba..4666a4bd6ea02b590053f9a72cded8baebb0e103 100755 (executable)
Binary files a/public/potlatch/potlatch.swf and b/public/potlatch/potlatch.swf differ