0

Hi frendz,
In my vehicle tracking project, I need to draw the route (polyline) of my vehicle in google map. When the vehicle is moving away from that route, it should give alert msg.
So how to specify the route line on google map?

2
Contributors
7
Replies
10
Views
6 Years
Discussion Span
Last Post by karthik_ppts
0

Have you had a look at the Google Maps API?

Yes Ardav, I used the google map API through out project. I got the code only to draw the polylines with set of latitude and longitude points. But I need to track whether the vehicle is moving on that line or not. Now i'm searching for that only.

Edited by karthik_ppts: n/a

0

how to generate latitude and longitude points by drawing lines on google map using javascript?

0

How are you receiving the vehicle's data? Which format?

latitude and longitude points as seperate column in database like this.

[B]latitude [/B]         [B]Longitude[/B]
11.027847         77.007263
11.027687         77.006943
11.025792         77.006935

Edited by karthik_ppts: n/a

0

Can't you add and remove points via the API? However, I don't think it will change in real time, otherwise you'd have to Ajax the DB/ Map container every 30s or so.

My take:
If you can store the data automatically.
On page load, get the latest DB lat/long and then load the map with only the latest point and the route.
Is that what you want/need. Can you do it?

If you're using V.3:

var myLatlng = new google.maps.LatLng(-25.363882,131.044922);
  var myOptions = {
    zoom: 4,
    center: myLatlng,
    mapTypeId: google.maps.MapTypeId.ROADMAP
  }
  var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
    
  var marker = new google.maps.Marker({
      position: myLatlng, 
      map: map, 
      title:"Hello World!"
  });

from the API documentation.

Edited by diafol: n/a

0

Can't you add and remove points via the API? However, I don't think it will change in real time, otherwise you'd have to Ajax the DB/ Map container every 30s or so.

My take:
If you can store the data automatically.
On page load, get the latest DB lat/long and then load the map with only the latest point and the route.
Is that what you want/need. Can you do it?

If you're using V.3:

var myLatlng = new google.maps.LatLng(-25.363882,131.044922);
  var myOptions = {
    zoom: 4,
    center: myLatlng,
    mapTypeId: google.maps.MapTypeId.ROADMAP
  }
  var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
    
  var marker = new google.maps.Marker({
      position: myLatlng, 
      map: map, 
      title:"Hello World!"
  });

from the API documentation.

Thanks for your effort Ardav. I'll try this.

Edited by karthik_ppts: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.