Skip to content

Commit

Permalink
Add drop animation to bus stops
Browse files Browse the repository at this point in the history
  • Loading branch information
yamamuteki committed May 4, 2016
1 parent 4362dd9 commit cde502c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,16 @@ function drawMap(markersJson, polylinesJson, busStopsCount, centerMakerImagePath
handler = Gmaps.build('Google');
handler.buildMap({ provider: { scrollwheel: false, MinZoom:15 }, internal: {id: 'map'}}, function(){
var markers = $.map(markersJson, function(busStop){
var marker = handler.addMarker(busStop);
var marker = handler.addMarker(busStop, { visible: false });
marker.id = busStop.id;
return marker;
});
$.each(markers, function(index){
var marker = this.getServiceObject();
window.setTimeout(function(){
marker.setOptions({ animation: google.maps.Animation.DROP, visible: true });
}, index * 100);
});
document.body.meta.markers = markers;
if (polylinesJson) {
var polylines = $.map(polylinesJson, function(busRoute){
Expand Down

0 comments on commit cde502c

Please sign in to comment.