The Point of it All
I use this map to plan bike rides around Phoenix. It shows me where the bike lanes go and I click off a route so I can see the distance and make sure I don't get in over my head. If you want to use it for finding bike routes in Phoenix, you can probably get right to it. If you want to get fancy and use other maps, you'll want to read these instructions.
Track points
When you begin tracking a route on the map, it will put dots everywhere you click and lines connecting the dots.
Clicking the shaded "Add point to end" button will cycle through available marker colors. All dots and lines will be drawn in whatever color you select. This button is also used to return to point drawing after using the Remove Point and Insert Point buttons.
The "Remove Point" button will remove the last track point from the map. Note that it removes the point from the end of the route, not necessarily the point added most recently.
The "Remove any point" button will remove any point. To use it, click it then click track points that you want to remove. To stop removing points you can click the same button again, or click the ! button. Alternatively, you can just begin clicking new locations on the map.
The "Insert point" button will insert a new point in the route. The new point will appear where you click, and the route will be adjusted to include the new point. To stop inserting points click the ! button.
To erase all of the old track points and begin a new route, click the "Remove All" button. This will clear all track points and reset the distance to 0 units. It will not erase the current scale of the map.
Maps
The page will load with a bike map of Phoenix by default. If you want a different map, specify its URL when you request the page like this:
mapdistance.html?map=http://www.srpnet.com/water/canals/graphics/CanalMap.gif
or off your own machine like this:
mapdistance.html?map=file://c:/maps/hikingmap.jpg
If you use the default map you do not need to specify a scale, but other maps can't calculate distances until you set a scale. You'll know you need to do this if you see a distance of "Infinity.0." I realize that this behavior could be construed as a bug, but I sort of enjoy the idea of "Infinity to one decimal place," so it stays.
I got this map from the MAG web site, and I think it was awfully nice of them to publish the front and back sides in the first place.
Scale & Precision
To set the scale of a map, you will need to know the distance between two points on it. To do this:
Enter the number of units between your two points into the text box, then press the "Set" button. Click one point, then the other. The page will calculate the distance between the points and calibrate itself. If, for example, the map you are using has a scale printed on it that displays a distance of 5 miles, you would enter "5" in the text box, click the "Set" button, then click the beginning and end of the scale. All distances would be in miles.
Alternatively, you can enter the the number of units and the number of pixels in the URL, like this: mapdistance.html?map=http://www.srpnet.com/water/canals/graphics/CanalMap.gif&units=30&scale=168. This link says "It takes 168 pixels to make 30 units (miles) on this map."
Because maps vary in size, resolution, and accuracy, it is probably silly to worry about highly precise decimal numbers. You can use the ç and è buttons to see less or more decimal places.
Moving the control panel
If the control panel is obscuring an important part of the map, you can use the ë button to move the control panel to the opposite corner of the screen.
Saving a route
My current hosting arrangements don't allow much latitude in terms of server-side scripting or database connectivity. Nevertheless, I thought it would be nice to be able to save routes. If you want to do that, click the "Map to XML" button at the bottom of the browser window & keep the text that shows up in the text box (you'll have to save it to your own computer or email it to yourself or something). Later, when you want to reload the route, enter that text in the text box and click the "XML to Map" button. That will plot the route on the map and display the distance. This saves the route along with the map and the scale (so you don't have to go clickin' the scale off next time).
You can also use it to save just a map & scale (without any route points). For example, if you paste this into the text box:
25
and click "XML to Map" it will load a ridiculously large map of Phoenix with the scale already set for you.
Note that this is equivalent to specifying the link mapdistance.html?map=img/bikemap150.jpg&units=25&scale=2107 which also contains the map, scale, and units.
Requirements
I'd be pretty surprised if you were even reading this on a browser other than IE because that's the only one I wrote it to work on.
You'll need the MSXML parser from Microsoft too.
Standard Disclaimer
This little script is provided as-is with no warranties and confers no rights.
This product is not intended to diagnose, treat, prevent, or cure any disease.
If itching or rash develops, discontinue use.
Copyright © 2005, Andy Allen. Please see the license agreement for full licensing details.
Me
I'm Andy Allen. You can reach me at andy@recpath.com.
If you find this tool useful, I'd like to hear from you.