
Plot Points on an Interactive Map Using DHTML #41
Chapter 4, Mapping (on) the Web
|
183
HACK
HACK
#41
Plot Points on an Interactive Map Using
DHTML Hack #41
Adding JavaScript to interactive maps on the Web can make them more
responsive by eliminating the need to hit the network for updates.
Suppose we want to make a little web application that puts a star on a map
of the world, at a given latitude and longitude. We might imagine building a
simple form interface with some HTML that looks like this:
<html>
<body>
<div>
<form name="location">
Latitude: <input name="lat" type="text" size="11" />
Longitude: <input name="lon" type="text" size="11" />
<input type="submit" value="Go" />
</form>
</div>
<div>
<img id="basemap" src="PathfinderMap.jpg" />
</div>
</body>
</html>
In a web browser, the page might look something like Figure 4-8. We have
two text input boxes, one called
lat and the other lon, and a Go button. The
map shown is the 1024x512 pixel AVHRR Pathfinder map from Dave Pape’s
Earth Images collection (http://www.evl.uic.edu/pape/data/Earth/), scaled
down to 800 pixels wide.
Figure 4-8. A simple web-based map interface