tags:

views:

76

answers:

2

Hi I own a taxi and transportation business.

1.Any way i can use latitutde to bring up my drivers location on my google map(they will carry smart phones)?

2.Knowing customers pickup address(stored in database) can i make individual pickups popup on my map also?

3.How would i implement a dispatch notice to my drivers based on their location relevant to pickup address?

thanx avi

A: 

shalom avi! you can gave the smart phones update their positions and send this data to the database on your server. and you will have a client set up on your local machine that will get the data from the server and create a KML file. here's an example of a KML file. please note that u will use google earth to open this file.

 <?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.1"&gt;
<Document>
   <name>New Addresses</name> 


<Style id="a">
<IconStyle>
<Icon>
<href>http://maps.google.com/mapfiles/ms/icons/green-dot.png&lt;/href&gt;
</Icon>
</IconStyle>
</Style>
<Folder><name>Sales Reps</name>   <Placemark>
      <name>Bret</name>
<styleUrl>#a</styleUrl>      <Point>
         <coordinates>-75.841866, 39.823108,0</coordinates>
      </Point>
      <description><![CDATA[215 Larchmont Lane West Grove, PA 19390</br>West Grove, PA  19390</br></br>Code: , Sales Reps</br>]]></description>
   </Placemark>
   <Placemark>
      <name>Brian</name>
<styleUrl>#a</styleUrl>      <Point>
         <coordinates>-83.923687, 36.049932,0</coordinates>
      </Point>
      <description><![CDATA[2300 Woodrow Drive Knoxville, TN 37918</br>Knoxville, TN  37918</br></br>Code: , Sales Reps</br>]]></description>
   </Placemark>
   <Placemark>
      <name>Ryan</name>
<styleUrl>#a</styleUrl>      <Point>
         <coordinates>-119.758448, 36.859115,0</coordinates>
      </Point>
      <description><![CDATA[407 E. Niles Fresno, CA 93720</br>Fresno, CA  93720</br></br>Code: , Sales Reps</br>]]></description>
   </Placemark>
   <Placemark>
      <name>Malena</name>
<styleUrl>#a</styleUrl>      <Point>
         <coordinates>-92.036204, 30.170481,0</coordinates>
      </Point>
      <description><![CDATA[201 Settlers Trace Blvd #3411 Lafayette, LA 70508</br>Lafayette, LA  70508</br></br>Code: , Sales Reps</br>]]></description>
   </Placemark>
   <Placemark>
      <name>Beth</name>
<styleUrl>#a</styleUrl>      <Point>
         <coordinates>-81.516432, 30.287809,0</coordinates>
      </Point>
      <description><![CDATA[13035 Fringetree Drive East Jacksonville, FL 32246</br>Jacksonville, FL  32246</br></br>Code: , Sales Reps</br>]]></description>
   </Placemark>
  </Folder>
</Document>
</kml>

when you start building your application you will have lots of questions. please come here and ask them.

i am a girl
avinash
@avi 1. the server can generate a new KML file every minute or so for you and download it to your PC so that u can view it using google earth. with KML file you can have different icons. 2. you can do this using winforms in .NET. you should ask about DRAGGING functionality for .NET in winforms. this will trigger a call to google maps using data stored in your database and will send the directions as a text or whatever. there are sevices in the US that will send SMS messages for about 3 cents per message.
i am a girl
A: 
  1. Yes but you will need to use lat/long, not just lat. If you can get access too all their lat longs you can plot them on a map by creating a point for each one and then adding them to the map. See this code for an example. How often you update the map will determine how accurate it is.

  2. Yes, you would do this using the same method described above but you should specify a different icon for them. (maybe cars for your drivers and dollar signs for customers). You can use the GetLocations() method to go from an address to a lat/long coordinate.

  3. I'd need a little more info on this one. What is a dispatch notice? Could it just be an email to their phone? If you had the information for the first two you could figure out which driver is closest to the customer and send them the dispatch notice.

Depending on how much you wanted to "stalk" your drivers you could even keep a map for each driver that should everywhere they drove over a period of time...

UPDATE

This is the pseudo code for what I would do to get the drag and drop functionality you are requesting working:

1) Plot driver and customer markers on the map. You will make the driver markers draggable.

2) on the Marker.dragend event you will fire an ajax function call. This function will send an email to the "dragged" driver. This email can contain the address, lat/long, map link or whatever you want for the "dragged to" customer.

Abe Miessler
hi thanx for ur reply..what i meant is since we know closest driver..any way to send them the pickup address with passenger info and ride details as an email or chat im..id prefer to do this from the map itself...it would keep the job easy for the dispatcher...say drag $1 to DRIVER 1...and this will send driver all the info regards the ride..
avinash
Yeah I'm sure you could get that drag/drop functionality working. You'll have to do a bit of research to get that working though, I imagine it will be a decent amount of work to get the project you are talking about going.
Abe Miessler
hi..yes it has involved a lot of work.the databases everything is good.driver locations im getting.geocoding part might help my developers for the addresses..the click and drag is proving to be a pain..anyway u can point me off in the right direction?im not a programmer..so im going in blind..and helping my developers with some research.thanx.avi
avinash
Ok i added an update to my answer. It gives you some pseudo code for how I would initially approach this problem. It also talks about the `Marker.dragend` event which i think will be the biggest part of this puzzle.
Abe Miessler
thanx abe..i can show u the page where we are trying to get this to work..u can take a look at the stuff if u want to..my putting this question up here has probably solved a 2week issue...ur a real help.If your interested in further helping me out..please let me know il share the details of the website with u..thnx..avi
avinash
Glad to hear I could help avi. If you think my answer was the best feel free to click on the check mark in the top left of my response to accept it. Don't forget to keep posting on SO if you get stuck on anything!
Abe Miessler