Hello Google map API experts, What would be the best(good) way to develop a real time dynamic map using Google Map API.
Example: http://whrrl.com/
It would be really helpful if someone points me towards the right direction. Thank you
If you and your close contacts use Google Maps, you might want to use the app's location sharing feature. Using this optional tool, friends, co-workers and family can share their location with each other and see their locations on the map in real-time.
1. NASA Worldview. NASA's Worldview is a real-time satellite map that is available online. It shows satellite imagery, real-time cloud cover, and 800+ layers of the world.
Just to add another example for you to check out, here is the source code for a live map showing the position of trains on the London Underground. The site can be found at http://traintimes.org.uk:81/map/tube/?from=map;to=tube, although unfortunately it is no longer active as Transport for London has suspended their API service due to high demand. Hopefully you might be able to get an idea from the source code though about how to develop a dynamic, real-time map.
Best place to start is the Google Maps Javascript API. Here is the documentation.
You will find lots of sample there, but basically with a few lines of javascript you can associate a Google Maps object with an element in the DOM (map_canvas):
var latlng = new google.maps.LatLng(-34.397, 150.644);
var myOptions = {
zoom: 8,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
Having a look at what Whrrl is doing specifically. They are updating their map center (and displaying a custom popup) based on a pre-rendered set of users in the their system (If you view the source for their home page, you can see the big chunk of user JSON at the bottom of the file). This javascript fires events on a timer panning the map from one location to the next.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With