FAQ: Building a Store Locator (Part II)
|
Okay, here's part two of developing your store
locator. As I said, this will delve into the technical side of things.
Please review part I of designing
a store locator if needed. |
|
Please Note: The webhost I was using for this particular
client has rather simplifyed ASP capabilities. That's too bad honestly
because they lost my business due to their unwillingness to upgrade
their technology.
The topics covered are as follows:
- A little overview of ASP
- Designing your database
- Creating your database connection string
- Getting the data into the database
- Programming SQL scripts
- Putting it all together
- Lessons learned
|
A Little Overview of ASP
ASP is quite a powerful technology. Combined with ADO, the ability
to build scalable and secure websites comes to light. For simplicity,
I will show you the basic ASP in order to make this store locator
work.
First and foremost every programming language has it's own delimiting
tag. A tag delimitor is a set of characters that tell the code processor
to expect code from a certain language, eg: ASP to follow it.
Please Note: Every language has a beginning and ending delimitor
tag.
In ASP the tag delimitors are:
<%
some ASP code here
%>
The <% is our opening ASP tag. This tells the processor,
oh we've got some ASP coming here.
The %> is our closing delimitor tag. This tells the processor,
we've reached the end of the ASP code. Do no more here!
The web language for ASP is called VB Script. For VB Script
tutorials, see the W3C
School.
|
Designing Your Database
A store locator requires a database containing significant store
information. This includes the store's address, phone number, url
(if applicable), and maps.
The major point here is the volumn of stores and/or territories
your business covers. Because the web is global, having significate
store coverage is the key. If you only have one or two stores then
you may as well just post the storeaddresses for those on your website
and not bother with a store locator.
Leading into my third point, is where you are in your business.
For example, my client is at a point now where it makes sense for
her to have a store locator. She has competitors out there who are
doing the same thing to reach their customers. She has to stay current
and also have a database with her store information at her disposal.
|
Creating your Database Connection String
Store locators are like ice cream. They can be designed with different tastes and flavors in mind.
For instance, let's say you had a large coverage of stores in the US and/or
outside of the US. You may consider designing your store locator
so that it is searchable by city and state. You may also want to
look into MapQuest's mapping software for graphically displaying
your store locations as points on the map.
If on the other hand, you don't want your competitors to know how many stores you have, you may consider designing a zipcode based
store locator. This would be one in which the user would enter his/her zipcode. Search results based on which stores are near that zipcode would be returned.
Some considerations here would be handling results where there isn't a
zipcode match. Let's say you don't have any stores within 30 miles
of your user. What message or alternate will you offer them? This
would be based on your business model and creativity. Maybe you
are so big that
you don't offer alternatives or you are a business in which the
customer must be physically at the store in order to receive
services or goods.
|
Getting the Data into the Database
The one universal thread in store locators is that they all require zipcode
data. The US Census Bureau has a zipcode database product they
put together in November 1999. This data includes 42,000+ zipcodes
along with their corresponding latitudes and longitudes. Download
this file here.
As a heads up, your store locator will need to do trigonomic functions on the zipcodes latitude and longitude in order to return an accurate resultset to your user.
You will also need to put together a database of your stores. This can be in MicroSoft Access, MS SQL, MySQL, Oracle, or any other database system that can be accessed via a web server.
|
Programming SQL Scripts
To better understand what you will expect from your store locator, it does well to look at other store locators.
The areas to pay attention to are:
- Functionality: What drives your store locator? Is it the city/state query or is it zipcode based? Can a user enter his/her address and obtain the stores closest to that address?
- Design: What elements come first, second, third? What is the flow
of operations for the user?
- Ease of Use: Is it clear to your user what information is need in order to obtain results?
|
Putting It All Together |
Lessons Learned |
External Links
The USPS
has web tools that can help with calculating postage rates and other
things for a small to medium sized retailer or distributor.
Information
and definitions regarding zip codes.
Trig functions for calculating
the distance between two points.
Melissa
Data provides several web tools online for testing
results.
Zip
Code Downloads is a paying service that provides zip
code updates and developer tools.
|