Potlatch 0.7
This commit is contained in:
parent
59e2349b5a
commit
da76d64e93
4 changed files with 11 additions and 10 deletions
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
|
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue