<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ratul Roy on Medium]]></title>
        <description><![CDATA[Stories by Ratul Roy on Medium]]></description>
        <link>https://medium.com/@ratulroy?source=rss-c4714571808e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*etLf9m61wNaY555blkfM6A.jpeg</url>
            <title>Stories by Ratul Roy on Medium</title>
            <link>https://medium.com/@ratulroy?source=rss-c4714571808e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 22:50:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ratulroy/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[ONE-WEB]]></title>
            <link>https://medium.com/@ratulroy/one-web-f8fcdea02414?source=rss-c4714571808e------2</link>
            <guid isPermaLink="false">https://medium.com/p/f8fcdea02414</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Ratul Roy]]></dc:creator>
            <pubDate>Fri, 15 Nov 2019 11:52:30 GMT</pubDate>
            <atom:updated>2019-12-04T12:02:43.561Z</atom:updated>
            <content:encoded><![CDATA[<h3>The story of Ola One-Web</h3><h3>The birth.</h3><p>June 2017. The Ola web-platform team had just showcased <a href="https://book.olacabs.com/">Ola PWA</a> at the prestigious Google I/O event and was ecstatic about touching the magical <a href="https://d3frsattnbx5l6.cloudfront.net/reports/1572831181509-httpsbookolacabscom.html">100</a> <a href="https://developers.google.com/web/tools/lighthouse">lighthouse</a> performance score, first and the only commercial web-app in the world to achieve the feat. Ola PWA was getting mentioned at various summits like Chrome, Polymer and Google across the globe as one of the best designed and most performant PWAs. The team really wanted to take all that learnings forward and share it with the larger front-end communities both inside and outside of Ola. The plan was to come up with a meta-platform and guidelines that can ensure high-quality web development at scale. And ONE-WEB was born.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/366/1*EdTOANL59I15Q4fb5nN7Gw.png" /></figure><p>ONE-WEB was an initiative to streamline and standardise the process of web development across all verticals in Ola, for both consumer facing and internal applications, on desktop and mobile browsers or web-views. It provides a web platform and an architectural design pattern which can help developers develop, test and deploy scalable and performant web applications very quickly.</p><h3><strong>The problem.</strong></h3><p>Recently front-end development has become all about “choosing a Framework”. Developers first pick a popular framework which they ‘heard’ is good or they already have expertise on. Then they just forcefully blend their application logic into the framework, sometimes even without evaluating the specifics of their application.</p><p>Also there are times, when developers are so much contained by the syntaxes and verbos of a specific framework that the framework becomes a constraint for them. They start to get tagged — ‘React guys’, ‘Angular folks’ etc.</p><h3>The solution - A Philosophy. Not a Framework.</h3><p>In ONE-WEB, we are NOT going ‘choose a Framework’. We are going to ‘choose a philosophy’. A philosophy that advocates the best of the design patterns and coding standards taken from different popular frameworks and yet it’s framework agnostic. Any developer from any framework community can jump-in and contribute to ONE-WEB, a ONE-WEB developer can go ahead and code in any popular framework. One Web enables developers to look beyond frameworks and yet provides the best of all popular front-end frameworks in terms of features, capability and speed.</p><h3>Component First</h3><p>One Web also forces the developers to think “Component First” and translate any business or feature requirements into independent array of modular components which could be reused and shared across multiple projects.This way every web application is nothing but a collection of reusable, self-contained components.</p><ol><li>Components will have life-cycle hooks, properties and methods, templates and CSS all written in one file.</li><li>Any reusable piece of code can be declared as Mixins/Behavior and will be available as property/method on the component instance</li></ol><p>There are no pages, no external java-scripts, no external CSS, just components. Every component is self-sufficient. It means it has all the template information, style information ‘WITHIN’ it. Once loaded, they can be used anywhere in your application, any number of times. Easy to maintain and easy to debug.With this, your web application will simply should look like a collection of tags.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NwuS24I_JTndqnQm2Nza-Q.png" /></figure><h3>Framework attributes</h3><p>We were very particular about what all features we needed for our web developement platform.</p><ul><li>Single File Component</li><li>Inter-component communication</li><li>Zero-JS, data driven, reactive way of coding</li><li>HTML composition</li><li>Blazing fast DOM rendering</li><li>Tiny framework size</li><li>Lazy Register</li><li>Routers</li><li>State Manager/ Redux</li><li>Mixins</li><li>Browser compatibility</li><li>Component LifeCycle Events and callbacks</li><li>One click build</li></ul><p>Keeping all the above properties and requirements in mind, we could have written a vanilla javascript wrapper which supports all these features. But we really didn’t want to “re-invent the wheel”. So we started to evaluate frameworks that support most part of our philosophy and we came up with the following matrix.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VnXwg_ppdBkRsUTAudBt-A.png" /></figure><p>Provided, we are developing towards a philosophy and not towards a framework, it all boiled down to finally evaluate this matrix and <a href="https://vuejs.org/v2/guide/">Vue</a> came up as the perfect one. Vue only lacked the Lazy Register of component feature which is supported only by Polymer. Hence we developed a light wrapper (500 bytes) which provided <strong>lazy register support </strong>for Vue components.</p><p>If you want to know more about core framework differentiations like change detection policy, DOM Rendering, you can check <a href="https://vuejs.org/v2/guide/comparison.html">Vue advantages </a>and <a href="https://www.slant.co/versus/11378/10513/~vue-js_vs_react">Vue vs react</a> .</p><h4><strong>Wait a minute. So ONE-WEB is Vue based ?</strong></h4><p>YES and NO. ONE-WEB uses Vue as it’s major framework. But we at Ola, have written customized build jobs which takes away the verbose and syntax of Vue and enables developers to code once and publish components on any framework (if required) as it works more towards the philosophy.</p><h3>ONE-WEB Modules</h3><p><strong>1. One-Web Framework</strong></p><p>Vue as core library Vue, Vue Router for routes, Vuex for state management and one way data flow between parent &amp; child components</p><p><strong>2</strong>. <strong>OW.js</strong></p><p>Our secret sauce. A global mixin which provides helper functions to all one-web components.</p><p>It also takes care of adding component’s styles to the document only during its render for the first time and all instances of the same component share the same styles. Also, the styles are scoped(using component id generated by build), so that they don’t pollute the css of other components. An example rule.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*6Fjx1XfIX14E_FsUfU26rg.png" /></figure><p>Other functionalities include:</p><p>a. loadOWComponent(): This function is used to lazy loads the component. It also avoids duplication (of downloading and parsing if already downloaded) if the component has already been used before. It also provides you a callback handler to be called once the component loads.</p><p>b. owLazyRoute(): This function is used to lazy load a route.</p><p>c. trackEvent(): This function is used to send events to backend systems for tracking user behaviour</p><p><strong>3. Command Line Build Tools</strong></p><p>Standardise the build and deployment process along with providing well documented guidelines. A developer now has to bother about only writing business logic. Provides minification, compression, optimisations, service-worker support come as out of the box feature</p><p><strong>4. Centralised Components Repository</strong></p><p>We have made a repository of all components powering up the front end of various applications of Ola and made them available both as npm package and on CDN to juice out extra performance</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s7cb-VLAoxUrP7jm6IG-Ug.png" /></figure><p><strong>5. Node as Web Server</strong></p><p>We have also standardised the serving infrastructure of all front-end applications which takes care of security, performance and cookie management by connecting to Ola’s central Authentication System and API Gateways</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NiUV5zFMe9FEl7v3M49nGQ.png" /></figure><h3>Sample OW Component</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z1Oa5qW54Vrj7NB3sfNNQQ.png" /></figure><h3>Loading OW Components</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x3RwO5V8me9-JoM-TVugIg.png" /></figure><h3>Benefits</h3><p>We started the project keeping only one goal at mind. Enable high quality web development at rapid pace and at scale. When we started, Ola had more than 30 Web developers working on limited partner side applications. Consumer applications were built on native android and IOS. Today only a 10 member team handles major consumer applications along with all partner &amp; browser applications and considered as one of the most reliable and effecient teams across Ola. The credit surely goes to ONE-WEB.</p><h3>Applications built using ONE-WEB</h3><p><strong>Major Consumer Apps</strong></p><ol><li>Ola Drive</li><li>Yard Manager app for Ola Drive</li><li>Ola Food</li><li>Insurance, donation and Merchandising flows</li><li>BFSE (Book For some one else)</li><li>Ola Cycle</li><li>Ola Bus</li><li>eKYC Flow</li><li><a href="https://bookingwidget.olacabs.com/">Ola Booking widget</a></li><li><a href="https://accounts.olacabs.com/">Ola Single Sign-On</a> flow</li><li>Referral flow</li><li>2FA Authentication flow</li></ol><p><strong>Major Partner Apps</strong></p><ol><li>Partner Accounting Apps</li><li>Partner Leasing app</li><li>Partner Incentive App</li></ol><h3>The creators</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oTgibuMh1AdOwzpVRBlJOg.jpeg" /><figcaption><a href="https://www.linkedin.com/in/ratul-roy-624a3111/">Ratul Roy</a>, <a href="https://www.linkedin.com/in/rpatwal/">Ravi Patwal</a>, <a href="https://www.linkedin.com/in/ashrithkulai/">Ashrith Kulai</a>, <a href="https://www.linkedin.com/in/sankeerthana-v-50357441/">Sankeerthana V</a>, Sumeet Sarkar, Rakesh K, Ajay Sharma, Amit K</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f8fcdea02414" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[High performant real-time tracking on web using Google Maps]]></title>
            <link>https://medium.com/@ratulroy/high-performant-real-time-tracking-on-web-using-google-map-8072a666db76?source=rss-c4714571808e------2</link>
            <guid isPermaLink="false">https://medium.com/p/8072a666db76</guid>
            <category><![CDATA[web]]></category>
            <category><![CDATA[google-maps]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[animation]]></category>
            <dc:creator><![CDATA[Ratul Roy]]></dc:creator>
            <pubDate>Tue, 28 Nov 2017 12:06:18 GMT</pubDate>
            <atom:updated>2019-12-04T12:05:21.729Z</atom:updated>
            <content:encoded><![CDATA[<p>Ability to track an entity on Google Maps in real time is one of the most important features of ride-hailing and delivery centric applications. So, while building for Ola PWA, we knew, track-ride page is going to be one of the most used screens.</p><p>Like any other live tracking page, Ola PWA track-ride page also enables its users to track exact location of the cars on a specific route in real time. But what was challenging, was not only to match up to the native experience on web, but to better it on a low-end mobile device.</p><p>As they say, “Rome wasn’t built in a day”. We also didn’t achieve the desired result in first try. In fact, it took us multiple iterations and user surveys and brainstorming sessions with product team to slowly build towards the ultimate intended experience. In the process, we did a lot of R&amp;D, made quite a few POCs, tried different tricks &amp; techniques &amp; algorithms and more over, learnt a lot.</p><h4><strong>Car Data from a polling API call</strong></h4><p>Before we dive deeper into different development phases of our track-ride screen, let us be clear on what needs to be tracked on the map and how to get that data.</p><p>So, we had to move a car image on Google maps from one coordinate to another in every 5 secs (configurable). We might also need to rotate the image to certain degrees every time. We need an API which we need to poll from front-end to get all the data. A sample response of this API could be in the following format.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/1*gL5gqXUnt0l4FEtmnH9HNQ.png" /></figure><p>We used Google Maps’ <em>V3</em> apis for all our map related operations.</p><h4><strong>Note</strong>:</h4><p>All the gifs below represent a simulation of the actual animations run on a Mac book pro with 6x slow CPU setting (using Chrome Developer toolbar). There could be data loss while creating the gifs and the actual animations could be smoother. All the FPS reports truly depict the real performance of the animations.</p><h4><strong>Phase 0 : Finding an existing example</strong></h4><p>Before we started coding for this page, we wanted to check if we could find an existing page with similar functionality. We found one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*NCazlyfXuHLRT7TdOt5dnQ.gif" /></figure><p>In this page, the map was getting loaded with the new lat-lng as it’s centre every 5 sec. The car is a <strong>Marker</strong> on the map placed at the centre . Every 5 sec the map gets panned to a new centre based on the API data and a code runs to place the marker again at the centre, giving an impression that the car is moving (while the reality is that the map pans and the car remains at the centre). But there is a time lag between the old marker getting removed and a new marker getting rendered at the centre, causing a shaky experience.</p><p>FPS was really poor (20 FPS) as we expected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rRyBGi-m4vAMAcINYV0OOQ.png" /></figure><p>Also if you have noticed, new map tiles are getting loaded on every 5 sec as the map pans. Not much bandwidth friendly I guess.</p><p>It was good enough for a start as we got to know the exact issues we needed to solve to give a better experience.</p><ol><li>smoother animation</li><li>Save data and battery</li></ol><h4><strong>Phase 1 : We started.</strong></h4><p><strong>Car as a DOM element</strong></p><p>We knew we could smoothly animate the car by using hardware accelerated CSS3 animations if we could convert the car marker into a DOM element as Google Marker object does not support CSS3 animations. So, first we converted the car into an HTML img object. Now we needed to move the car from one lat-lng to the next. But DOM elements operate on pixels and not geo coordinates. So we needed a projection library to convert the lat-lng into corresponding pixels.</p><p>We started with one open source <strong><em>Mercator Projection</em></strong><em> </em>library. But finally we used getProjection() method of <strong>Google Map’s <em>Overlay</em> class</strong> (V3 apis) to get projection Object and then implemented the onAdd() method and accessed the <em>projection</em> inside onAdd(). Then used getLatLngToContainerPixel()method of the projection object to get the pixels for a given lat-lng. Sample code as follows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UcQrJVmc4zJZBcEe1XyaTA.png" /></figure><p>For a smoother effect we used <strong>bezier</strong> as CSS3 <em>transition-timing</em> function for the <em>transform</em> animation and played around with it’s configuration. Sample code as follows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/1*E-o33MB5Fusox6cIKJOysw.png" /></figure><p><strong>Saving data</strong></p><p>Now that we solved the smooth animation problem, we shifted our focus to address the data saving part. We realised that, in a standard zoom level (like 14 or 15), user can clearly track his moving car for around 1 km area without any necessity to pan the map.</p><p>We used this finding and wrote our own algorithm to pan the map to the new coordinates only when the car has reached closer to any of the four borders of the map container and then centre the car image. We also initialised the map with zoom level 14.</p><p>With this change, for every 1 km tracking, we brought down the required panning to only once, in comparison to 24 times in the earlier approach saving more data and battery. (assuming an average car speed of 30km/hr and polling interval of 5 sec)</p><p><strong>Limitation</strong></p><p>We still had a problem to solve, specially on mobile devices. “<em>What happens to the car when user pans or pinch-zooms the map?</em>” Had the car image been a Google marker, it would have moved seamlessly along with the panning or zooming map. But remember ? Our car image was a DOM element running on a different layer. We needed to catch every map events and accordingly re-render our car to new positions. For events like pan and pinch zoom (which consists of a series of drag, drag-start, drag-end, mouse-move events) the experience won’t be seamless at all with so many repaints. Also there could be a lag between users’ touches and the re-positioning of the car on a low end device.</p><p>So, we took a shortcut. We disabled the default zoom and pan features of the google maps. We created our own HTML zoom plus-minus buttons within the parent div to allow users to change the zoom level by clicking on them. We only re-rendered the car image when there is a user initiated zoom level change. Not very convenient but still neat.</p><p>No panning was allowed but we thought user could probably live with this.</p><p>You can see the final experience of the moving car in Phase1 here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*QIsTpL4RVxKdai7Qc-u28g.gif" /><figcaption>Custom Zoom Buttons. No panning allowed.</figcaption></figure><p>Here is the animation report run on Mac book Pro with 6x slowdown CPU.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9Kl2aiS4HVfd1C3-tRHoMA.png" /><figcaption>Perfect 60fps animation</figcaption></figure><h4>Phase 2 : Some quick fix.</h4><p><strong>Default panning and zoom enabled</strong></p><p>We found out that our approach on Phase1 was not quite user friendly after-all and most of our users were more inclined towards panning and zooming the map to adjust to their viewport. Very few people were actually clicking on the Custom Zoom buttons. So we re-enabled the default panning and pinch-zooming functionality on Google Maps.</p><p><strong>Hide car on pan and zoom</strong></p><p>But then we had to solve for the problem for which we had to disable them. That is to seamlessly sync DOM car element with default map events. We started exploring all google maps events and listed out the ones that occur while panning or zooming (like <em>drag, dragstart, dragend, zoom_changed, center_changed, mousemove </em>etc) and hid the HTML car on those events. We made it visible again on ‘<a href="https://developers.google.com/maps/documentation/javascript/events">idle</a>’ event (when map is stable again). You can check all the Map events <a href="https://developers.google.com/maps/documentation/javascript/events">here</a>.</p><p>Not perfect. But still better than the Phase1. You can see the final zoom/pan experience of Phase2 here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/476/1*EbrUwsPMyW1uaxOWyKt0_Q.gif" /></figure><h4>Phase 3 : R&amp;D. More R&amp;D.</h4><p>We knew we were NOT yet there and we still needed a solution that addresses both smooth animation of car and panning or zooming of the map simultaneously. We started doing different POCs.</p><p><strong>Re-rendering the car on panning &amp; zooming</strong></p><p>We tried to re-position the HTML car on every panning and zooming events. While we thought we might be getting shaky effect, to our surprise, the entire experience was really seamless on desktop. But our “hearts broke” when we found a non-documented behaviour of Google Maps because of which our solution became ineffective. We could not reposition the car while panning as the map’s centre was not getting changed while panning. You can read about the issue <a href="https://stackoverflow.com/questions/35750750/google-maps-drag-event-doesnt-capture-center-change-until-dragging-ends-in-chro/36049338#36049338"><em>here</em></a>.</p><p><strong>Back to Car as a Marker.</strong></p><p>We took a step back and started exploring the marker object once more, with a hope that we could get a way to rotate and animate the marker smoothly on canvas. With marker we didn’t have to reposition it on different events as markers are part of the map itself. We wrote our own code to move the marker on an imaginary line between 2 sets of coordinates. We played with different values of the interval time duration and the no. of divisions within the imaginary line. We could achieve a satisfactory experience on desktop. But on a medium-end mobile, we could clearly see the lag in animation.</p><p>Animation report with markers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*huzm1Jcui_odido4tKUa8Q.png" /></figure><p><strong>Car as a Symbol Object ? Eureka !!!!</strong></p><p>We had only two options left.</p><ol><li>Mimic the exact pan and zoom gestures on a transparent div on top of the Map and move the car and the map beneath accordingly. But it was lot of coding and it could be really difficult to match the default elastic effect that you get while panning.</li><li>Explore map overlays again.</li></ol><p>We took the 2nd approach and eureka!!! We found Symbol object of map which can smoothly animate on a <em>polyline</em> connecting two coordinates and at the same time can rotate &amp; move seamlessly while panning and zooming. We still needed the projection library to detect when to load new map in order to minimise map tile loading. We tested our POC on a low end mobile and it worked like magic.</p><blockquote>“Symbol animations on polyline are much smoother as they are part of the polyline itself.”.</blockquote><p>For smooth animations, we created an invisible polyline, with end point as the new position of the car and start point as the current point of the car (current position of the symbol in the map).</p><p>For an invisible polyline, the stroke opacity and stroke weight were set to a minimum.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Sb1TWUpNjH78fmm0." /></figure><p>Now our, icon moves on the polyline, using offset(from 0 to 100%) and rotation from car’s current rotation to final rotation value.</p><p>Example code for animating symbol on a line can be found <a href="https://developers.google.com/maps/documentation/javascript/examples/overlay-symbol-animate"><em>here</em></a><em>.</em></p><p><strong>Limitation</strong></p><p>There was still one small glitch. Unlike markers, Symbol object does not take an icon url. It has to be a vector with single “path” attribute. But the car image that needed to be shown was moderately complex with shadows and different shades.</p><p>You can see the Symbol experience here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/552/1*KTLrjjKlxCmJwNhh_z1GXg.gif" /></figure><h4>Phase 4 : Finally !!!!</h4><p><strong>R&amp;D with design team. Multiple Symbols for one car.</strong></p><p>We started doing R&amp;D along with the design team to try out different vectors and found out that creating a multi layered vector image with single path is extremely difficult. So we came up with a solution to move and rotate multiple smaller single path vector images together on the polyline. We placed them in layers with same anchor so that for end-users they looked like one image only.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XxQCj0A15WoahhJZ." /></figure><p><strong>One more limitation solved by <em>RequestAnimationFrame</em></strong></p><p>The animations were smooth but then we ran into the setInterval DOM problem.</p><p>Modern browsers like chrome tend to suppress DOM animations when the tab in inactive. So when, the user comes back to the screen, the car would have travelled a good distance, and all the DOM animations which were getting queued till now, would start to execute, causing the car to “<em>fly</em>” from source to destination.</p><p>Comes to our rescue, <strong>requestAnimationFrame.</strong></p><p>This API is present in all the major browsers and it eliminates the possibility of unnecessary draws and can bunch together multiple animations into a single reflow and repaint cycle, thus helping us achieve 60fps animations.</p><p>In our case, the method to animate the car is passed as a parameter to window.requestAnimationFrame. For every new position of the car, we cancel the previous request (using cancelAnimationFrame) if there is one pending. Thus, when the tab becomes active again, the latest request for animation gets executed which is between the car’s location(when the tab went inactive) to the newest location. Also, since our algorithm detects that the distance to travel is big(and unreal), it just place the car at the centre of the map without any animation (no flying around ! ).</p><p>Sample code below showing use of requestAnimationFrame.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q-YmCxAbWrQook9vpiRg1A.png" /></figure><p>moveCab determines if the animation needs to be performed or not</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sw4Ebhq8yLipGtAU." /></figure><p>As mentioned, for each new position, we clear previous intervals and animation frame request,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_rm1zNBMEe32m1HY." /></figure><p>You can see the final experience here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/317/0*BmAEeEUDJIvzn4bO." /></figure><p>The animation was also very smooth (57FPS).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nSxntM2kwuepvjbM." /></figure><p>So that was it. Work is still in progress. There are so many things that we would love to try. Like exploring other Google Maps components, optimising the polling API, new animation algorithms etc. Will keep this thread alive with all the updates !!!</p><p>Meanwhile you can book an Ola cab <a href="https://book.olacabs.com/">@ https://book.olacabs.com</a> and check the post-booking page to see the above code in production.</p><h3><strong>Authors</strong></h3><p><a href="https://www.linkedin.com/in/ratul-roy-624a3111/"><strong>Ratul Roy</strong></a><strong>.</strong> Principal Engineer, Ola</p><p><a href="https://www.linkedin.com/in/rpatwal/"><strong>Ravi Patwal.</strong></a> Software Engineer II, Ola</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8072a666db76" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>