I think this would be very basic question. I am building an application using codigniter in which the users have to mark the destination on the map and Google Maps should automatically draw a route from a point to destination point and save it. We would then have to use the saved route to reach the user.
I am new to Maps API. Any resources where I can study how to implement this using Google Maps API or other Maps APIs? I would also like to know whether this kind of implementation in Google Maps API would affect the privacy of user?
If you're asking users to click the map to mark a start destination, I'm not sure how this affects their privacy?
Anyway, what you want to do is have an event listener attached to the map, for a click event. When the user clicks, find out the latlng of that point, and draw directions between that point and your other point. Here's an example of an event listener which gets the coordinates of a user's click on the map: http://code.google.com/apis/maps/documentation/javascript/events.html#EventArguments
I guess you could then save the DirectionsResult with an Ajax call to a php page.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With