The prof gave us an assigment to finish in the next couple of months, we have to write a web app that is basically a mapping system for a floor of a building. Like a very very simple version of google maps, people need to be able to look up a room and be able to get directions from one part of the floor to another. I have never done any major web programming and don't even know how to start. Is there a google maps or mapquest API that I can use or do I have to start it from scratch? I'm not asking anyone to solve it for me, just nudge me in the right direction so as where to start.
+1
A:
I would suggest thinking of the task as three parts:
- Displaying the image of the map (probably, for best efficiency, as lazily-loaded tiles like Google Maps does)
- Representing the rooms and the connections between them, probably as a graph. Using a graph allows you to easily use a well-documented algorithm like A* or Dijkstra's to find the shortest route from point A to point B.
- Converting from a click on the image to a node on the graph, and from a node on the graph to a point in the image. Probably each node should just store a pair of (x,y) coordinates.
With an arrangement like this, all your code has to do is:
The first time the user clicks
{
Identify the nearest node to their click as node A;
}
The second time the user clicks
{
Identify the nearest node to their click as node B;
Use Dijkstras Algorithm or A* to find the shortest route from node A to node B;
For each edge in the resulting route
{
Add a line to the image of the map;
}
Mark node A with a green dot and node B with a red dot (or something);
}
Jon Rodriguez
2010-09-17 02:29:12
Jon nails this. Your question, as original asked, reads to us as "oh my God, help!" Split the question into multiple parts, and ask more focused things.
Dean J
2010-09-17 14:25:55