Now that we have a place to get data, we will need to capture the latitude and longitude of each theater to send to our new endpoint. In movienow.geolocation.js
, we will make a minor modification. In the displayShowtimes
method, we will need to adjust where the theater name is displayed. Specifically, we will need to input the latitude and longitude and add them to a new data
attribute. This allows us to use this data later on.
Change the following line:
movieHTML+='<p class="theater">'+movie.theater.title+" "+movie.theater.address+'</p>';
Change it to:
movieHTML+='<p class="theater" data-location= "'+movie.theater.latitude+','+movie.theater.longitude+'">'+movie.theater.title+" "+movie.theater.address+'</p>';
Next, we will create a new JavaScript file called movienow.nearbytweets.js
in the js
folder. In index.php
, we will add a reference to the new JavaScript file:
<script src="js/ios-orientationchange-fix.js"></script> <script src="js...