Now, let's build a website that will make use of the Locations API. When the user clicks on the map, our app will fetch address information about the clicked location.
This time, we will consume the API on the server side, using .NET and C#. We'll start by creating an ASP.NET MVC blank website in Visual Studio (we're using Visual Studio 2012, and ASP.NET MVC 4, but you can use any .NET solutions that can communicate via HTTP). We'll name the project: LBM.Locator
.
Next, let's add HomeController
with one action, Index
:
public class HomeController : Controller { public ActionResult Index() { ViewBag.Title = "LBM | Locator"; return View(); } }
In this listing we specify a title for the web page, and then return View
, which looks like:
<div id="lbm-map"></div>
The listing consists of a container for our map. As specified in the _ViewStart.chtml
file (inside the Views
folder), our Index
view is included within a layout,...