diff --git a/static/map.js b/static/map.js index 5c9a5a8..41b518b 100644 --- a/static/map.js +++ b/static/map.js @@ -1,7 +1,16 @@ -function update_map() +function update_map(event) { + event.preventDefault(); + + var lat = document.getElementById('lat').value; + var lon = document.getElementById('lon').value; + + request_url = new URL("/render/map.svg", document.URL); + request_url.searchParams.append("lat", lat); + request_url.searchParams.append("lon", lon); + var request = new XMLHttpRequest(); - request.open("GET","/render/45/11.svg"); + request.open("GET", request_url); request.addEventListener('load', function(event) { if (request.status >= 200 && request.status < 300) { diff --git a/views/index.tpl b/views/index.tpl index f93c5ae..73227d0 100644 --- a/views/index.tpl +++ b/views/index.tpl @@ -14,8 +14,8 @@
Here you can generate a map in azimuthal-equidistant projections for any point on Earth. You get a map where the specified coordinate is in the center, and all other locations are projected such that locations with the same physical distance from the given coordinate are also the same distance from the center on the map.
The generated output is a Scalable Vector Graphics (SVG) image that can be edited as needed. I recommend Inkscape as an SVG editor.
-Please note: It may take a few seconds to generate the map. Please give it some time. The map will appear below the form.
-