forked from osm-fr/osm-vs-fantoir
-
Notifications
You must be signed in to change notification settings - Fork 0
/
josm.html
37 lines (36 loc) · 979 Bytes
/
josm.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<html>
<head>
<meta charset="UTF-8">
<title>Correspondance entre FANTOIR et voies OSM depuis JOSM</title>
<script src="js/jquery-3.4.1.min.js"></script>
<script>
function start(){
check_url_for_coords()
};
function check_url_for_coords(){
var lon, lat
if (window.location.search){
if (window.location.search.split('lat=')[1].split('&')[0]){
lat = Number(window.location.search.split('lat=')[1].split('&')[0])
}
if (window.location.search.split('lon=')[1].split('&')[0]){
lon = Number(window.location.search.split('lon=')[1].split('&')[0])
}
}
if (-90 < lat && lat < 90 && -180 < lon && lon < 180){
console.log('ok')
$.ajax({
url: "insee_from_coords.py?lat="+lat+"&lon="+lon
})
.done(function( data ) {
window.location.replace('index.html#insee='+data[0]+'&from=josm')
})
} else {
window.location.replace('index.html#insee=404')
}
}
</script>
</head>
<body onload="start()">
</body>
</html>