Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <script src="http://code.jquery.com/jquery-latest.js"></script>
- <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
- </head>
- <style type="text/css">
- .invisible { display: none }
- </style>
- <body>
- <div id="log">
- </div>
- <hr>
- <table id="results">
- <tr><th>Name</th><th>lat</th><th>lon</th></tr>
- </table>
- <form><input type="button" id="b" value="Laden"/></form>
- <script>
- handleOSMResponse = function(data) {
- $("#b").addClass("invisible");
- $.each(data.elements, function(idx, obj) {
- $("<tr><td>"+ obj.tags.name + "</td><td>" + obj.lat +"</td><td>"+obj.lon+"</td></tr>").appendTo("#results")
- });
- }
- $("#b").click(function() {
- $("#b").val("Loading...");
- $.getScript('http://overpass.osm.rambler.ru/cgi/interpreter?jsonp=handleOSMResponse&data=[out:json];node[amenity=restaurant](50.7,7.1,50.8,7.25);out;');
- });
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement