问题
Trying to write app for service technicians that will display open service calls within X miles of them on a map and allow them to perform custom actions by clicking on the pushpin for each individual location. Locations would need to belong to groups with different colored pushpins. So I need to provide a list of locations from a SQL database and have the map display only the ones within X miles. Then based on the group that pushpin is in, have certain options available for how to proceed with beginning service at that location. I've been reading the info on the Google Map API and the Bing API, but I am self taught and that stuff is real jargony and I can't really tell if what I want to do is even possible. I'm sure I could plot the locations within X miles, but I am unsure of the different color pushpins and the custom options for each. Can any one point me in the right direction for a layman?
回答1:
Google maps has a distance matrix function that could be used to implement this. Effectively you could pass in your current location as the origin and a list of possible points (taken from your database) as destinations to get the distances from the current location. Filtering based on your value of X would give you the list of destinations to display.
There is also a tutorial on using a db with Google Maps - https://developers.google.com/maps/articles/phpsqlajax_v3
来源:https://stackoverflow.com/questions/11043668/android-map-apis