0

I want to create a web app that lets me create, store and display my travels. Something similar to this service here actually. The basic structure/ideas:

  1. create my trips by the following options
    • load a gpx
    • create a polyline (e.g. flight path)
    • create a route using google directions
    • Each trip consists of one ore several "stages" or "legs" that each can be creates like above
  2. store the routes so that i can display them on a google map or edit them (draggable) later

So one map would then contain several "trips" that look like this
I have already read a lot about this matter and I think I should be able to handle the part about creating the routes, however when it comes to storing them I'm not sure if I have understood what's possible and how to do it.

My questions:

  • Storing: I was thinking to either convert each trip once it is complete to their own XML file containing all the required information such as waypoints and stages. Those file would be stored on my webspace and can then be parsed to display the trips at any time
  • I see a problem however when creating a leg using google directions: how can I store/retrieve such a leg and conserve the directions informations? It's rather easy as long as I don't change the route by dragging wayoints (I coudl simply store the start and end points and create it on the fly) however I would like to be able to edit them later, again by dragging the line. Would it be possible to extract all the additionally inserted waypoints to recreate the route later by using not only the start and end point but also those additional points (i.e. will google show me the same variation of the route?)
  • Is there any aspect that is against the terms of gmaps?
  • I could also use a mySQL database to store the information, is this the better approach?

BTW I am new to the whole gMaps API programming. My system is php based.

4

1 に答える 1

1

I would recommend you a mysql database to store the information. A directions is only a bunch of lat-long pairs, travel time, and polyon points. Usually I store it in a JS array but you can also use a Json or JS objects. I think you can serialize the array and store it in database. I would use xml only for configuration or formated output with xlst. The idea is also to store the lat-lng as points and use a spatial index on it to get faster search.

于 2012-06-17T18:37:06.500 に答える