default to a session cookie instead of setting an explicit timeout, weird timezone...
[freeside.git] / httemplate / misc / openmap.html
index 7cbe3db..15de288 100644 (file)
@@ -18,7 +18,7 @@
 
   <script>
 
-    var url = 'http://nominatim.openstreetmap.org/search?format=json&limit=1&q=<%$loc%>';
+    var url = 'xmlhttp-openstreetmap.html?loc=<%$loc%>';
     $.getJSON(url,function(data){
       var latlong = [data[0].lat, data[0].lon];
       var mymap = L.map('mapid').setView(latlong, 15);
@@ -44,8 +44,7 @@
       function getCensusTract(lat, lon) {
        var url = 'xmlhttp-censustract.html?lat=' + lat + '&lon=' + lon + '&census_year=<%$census_year%>';
        $.getJSON(url,function(data){
-         var tract = (data.Block.FIPS.substr(0, 11) / 100).toFixed(2);
-         document.getElementById("mycensustract").innerHTML = tract;
+         document.getElementById("mycensustract").innerHTML = data.Block.FIPS;
        });
       }
 
@@ -79,6 +78,6 @@ my $census_year = $cgi->param('census_year');
 my $pre         = $cgi->param('pre');
 my $zip_code    = $cgi->param('zip_code');
 my $address     = $cgi->param('address');
-my $loc = $zip_code ? $zip_code : $address;
+my $loc = $zip_code ? $zip_code.', United States' : $address;
 
-</%init>
\ No newline at end of file
+</%init>