Building a Store Locator ASP.NET Application Using Google Maps API (Part 1)

Over the past couple of months I’ve been working on a couple of projects that have used the free Google Maps APIto add interactive maps and geocoding capabilities to ASP.NET websites. In a nutshell, the Google Maps API allow you todisplay maps on your website, to add markers onto the map, and to compute the latitude and longitude of an address, among many other tasks.

With some Google Maps API experience under my belt, I decided it would be fun to implement a store locator feature and share it here on 4Guys. A store locator lets a visitorenter an address or postal code and then shows the nearby stores.

Typically, store locators display the nearby stores on both a map and in a grid, along with the distancebetween the entered address and each store within the area. To see a store locator in action, check out the Wells Fargo storelocator.

This article is the first in a multi-part series that walks through how to add a store locator feature to your ASP.NET application. In this inaugural article, we’ll build the database table to hold the store information.

Next, we’ll explore how to use the Google Maps API’s geocoding feature to allow for flexible address entry and how to translate an address into latitude and longitude pairs.

Armed with the latitude and longitude coordinates, we’ll see how to retrieve nearby locations as well as how to compute the distance between the address entered by the visitor and the each nearby store.

View the Original article

Leave a Reply

Your email address will not be published. Required fields are marked *