开发者

google maps integration

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开发者_如何学JAVA i implement a dispatch notice to my drivers based on their location relevant to pickup address?

thanx avi


  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.


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">
<Document>
   <name>New Addresses</name> 


<Style id="a">
<IconStyle>
<Icon>
<href>http://maps.google.com/mapfiles/ms/icons/green-dot.png</href>
</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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜