Skip to content

Instantly share code, notes, and snippets.

@marxian
Created March 16, 2016 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marxian/bd04b0c236cb817bf53b to your computer and use it in GitHub Desktop.
Save marxian/bd04b0c236cb817bf53b to your computer and use it in GitHub Desktop.
<html>
<head>
</head>
<body>
<script>
function loolister () {
// Make a lovely button
var button = document.createElement('button');
// label it
button.innerText = 'Find nearby loos';
// Add a click handler
button.addEventListener('click', function() {
// Call the geolocation api with a callback
// in the call back get the lat and long and
// and construct an appropriate url
// make a request to the url
// parse the response
// loop over the features drawing some html
});
// Add the button to the body
document.querySelector('body').appendChild(button);
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment