Created
May 16, 2018 01:30
-
-
Save dverdin83/5d2f7dfcacd284be99d82dbecdf6d40e to your computer and use it in GitHub Desktop.
Basic use of google street view api part of Udacity AJAX minicourse
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function loadData() { | |
| var $body = $('body'); | |
| var $wikiElem = $('#wikipedia-links'); | |
| var $nytHeaderElem = $('#nytimes-header'); | |
| var $nytElem = $('#nytimes-articles'); | |
| var $greeting = $('#greeting'); | |
| // clear out old data before new request | |
| $wikiElem.text(""); | |
| $nytElem.text(""); | |
| //YOUR CODE GOES HERE! | |
| var streetStr = $('#street').val(); | |
| var cityStr = $('#city').val(); | |
| var address = streetStr + ', ' + cityStr; | |
| var streetViewURL = 'https://maps.googleapis.com/maps/api/streetview?size=400x400&location=' + address + ''; | |
| $body.append('<img class="bgimg" src="' + streetViewURL + '">'); | |
| //MY CODE ABOVE! | |
| return false; | |
| }; | |
| $('#form-container').submit(loadData); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment