# 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:
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)
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
<%= 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() {
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");
}