summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Burger <burgerc@freeside.biz>2018-11-16 11:14:32 -0500
committerChristopher Burger <burgerc@freeside.biz>2018-11-16 12:59:23 -0500
commit20319dfaa1c0f3ca4dc4c9685e3582154dcce517 (patch)
treef03e364bf074e7b69b76d4220179a3afc2cca73c
parent7bfcb1a73569815632cd7606c3d485234c21232e (diff)
RT# 81730 - added code to fix possible cross origin request error
-rw-r--r--httemplate/misc/openmap.html2
-rw-r--r--httemplate/misc/xmlhttp-openstreetmap.html15
2 files changed, 16 insertions, 1 deletions
diff --git a/httemplate/misc/openmap.html b/httemplate/misc/openmap.html
index 7cbe3db1d..88f64c1ff 100644
--- a/httemplate/misc/openmap.html
+++ b/httemplate/misc/openmap.html
@@ -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);
diff --git a/httemplate/misc/xmlhttp-openstreetmap.html b/httemplate/misc/xmlhttp-openstreetmap.html
new file mode 100644
index 000000000..bf6625c93
--- /dev/null
+++ b/httemplate/misc/xmlhttp-openstreetmap.html
@@ -0,0 +1,15 @@
+<% $return %>\
+<%init>
+
+my $DEBUG = 0;
+
+my $conf = new FS::Conf;
+
+my $return = {};
+
+my $url = "http://nominatim.openstreetmap.org/search?format=json&limit=1&q=" . $cgi->param('loc');
+
+use LWP::Simple;
+my $return = get $url;
+
+</%init> \ No newline at end of file