September 2016
Beginner to intermediate
531 pages
12h 55m
English
A Voronoi geom chops a geographic shape into discrete regions around points, such that no section overlaps and the entirety of the area is covered. Anything within a particular point's section is closer to that point than to any other point. We're going to use this to figure out what the closest major airport is to your current location, which we'll supply via the HTML5 Geolocation API.
Replace your call to app.get in chapter6.js with the following:
app.get('/', (req, res) => { res.send(`<!doctype html> <html> <head> <title>Find your nearest airport!</title> </head> <body> <form method="POST" action="/"> <h1>Enter your latitude and longitude, or allow your browser to check.</h1> <input type="text" name="location" ...Read now
Unlock full access