Solved

how to animate markers on google maps along with a route ?

Posted on 2010-09-04
5
2,882 Views
Last Modified: 2016-10-06
Hi,

I have some couple of co-ordinates and time. I'm looking to animate the marker along with the route. Please help me on how to animate the marker along with the routes and if possible at particluar times. I tried some links in google and none of them works.

-Abhi
0
Comment
Question by:abhi376
5 Comments
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 33604724
Please post the code you've been working on, and tell us what kinds of errors you're getting.  

Also, please post the links to Google that show the examples you tried.

Thanks, ~Ray
0
 
LVL 13

Accepted Solution

by:
Molnar István earned 500 total points
ID: 33662554
my idea is :
1.) to create a database or xml file to store the coordinates
2.) retrieve the coords from database and create a polyline from the coords in JS
3.) display the polyline and the marker on the google map (JS)
  -add a marker to the map with the first coord (this will be the starting point)
  -loop through each coord and refresh the coordinates of the marker (you can create a button to stop/start the loop)
  -you can use setInterval()/clearInterval() functions in JS to automate the loop

you can use http://en.googlemaps.subgurim.net/ free .net control if you would like to avoid writing javascript


here is an example how to animate the marker along the route:
http://econym.org.uk/gmap/example_cartrip2.htm
(more examples :http://econym.org.uk/gmap/ - look for "fun stuff")

hope it helps

0
 
LVL 6

Author Closing Comment

by:abhi376
ID: 33698862
Thanks !!
0
 

Expert Comment

by:cyberhulk
ID: 37786504
Here is the code of moving marker, the coordinates can be taken either from database or form somewhere you would like!

Find the code attached, just initialize the x and y arrays and use....
map.js
0
 

Expert Comment

by:Teja G
ID: 41831333
Can anybody post the source code of the same in ios using objective c? Thanks in advance
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now