|
The NearestData.xls spreadsheet allows a user to
upload, and manage, data to our server to give Nearest functionality easily.
At the time of writing we support PHP, classic ASP and .NET.
Nearest Requirements:
Step1:
Install Importer in default location
Having installed the NearestImporter.exe, the
spreadsheet buttons will call this program to upload the data to our
server. If you opted to install in a different location
to default, you will need to edit cell C10, on the settings
tab.
[Click here to Download
Installer and Template]
Step
2: Open an account with us
When you open an account, we will send you a
License ID and Datakey. These need to go in the
"Settings" sheet.
[Click
here to open an account with us]
Step
3: Buy a Store Location Pack
To allow you to upload data to our server you
need to purchase a "Store Location Pack". to trial
the system, simply use LicenseID=0, this will give you access to the
demo Store Data and Templates contained in the
spreadsheet.
[Click
here for Prices]
Step
4: Integrate into your Web Site
Now you are ready to integrate into your web
site. Examples are included in the "Nearest"
folder of the example downloads for many common web languages.
[Click
here for example downloads] [Click
here for integration notes]
[Click
here for live Web Demo of Option 2]
Step
5: Create Templates to merge your data
The
Templates drive the system, please look at the web demo page and
tick "show template information" to examine how the system
works.
[Notes
on Templates]
These templates can be imported by changing the
contents of the "Template..." sheets. The 7
examples in the downloadable sheet correspond to the 7 examples on
the Demo web page.
[Web
Demo Page]
Step
6: Upload your data
The
Templates drive the system, please look at the web demo page and
tick "show template information" to examine how the system
works.
These templates can be imported by changing the
contents of the "List x" sheets.
DO NOT
ADD/REMOVE ROWS/COLUMNS in the sheets
How it works
Upload your data:
Firstly you use the "List" template to upload
your data:

Please note: you must supplier a Unique
ID for each item in the list, column D in the above example.
The full structure of data is listed at the
bottom of this page.
Edit and upload Template:
Having uploaded your data, you then edit the
template to change the appearance of the data displayed. In
the example spreadsheet their are 7 example templates which
correspond to the examples found on our demo page.
[View Demo page]
Pick the one that matches your requirements
best then edit that template.

Cells C7-C9 and C26, contain HTML with is
merged with the Store data to return the results displayed how you
want it displayed.
[Download
Pins used in examples]
Template Example:
Header:
Click on Pin to view details<br><h2>Example 2: _recordcount_
Stores Found</h2><font size=1>page _pageno_ of _nopages_ _pageselection_
_previouspage_ _nextpage_</font><hr>
Please note we also have tags _recordcount_, _listcount_
and _pincount_. They return different count of results. _recordcount_
is the obvious choice of number count of results, but when filtering
is used you may want to try using _listcount_ or _pincount_ to
return the desired figure. (see Tag notes below)
Details:
<b> _rank_ _km_km Store: </b>_postcode_
_yourdata1_<br><b>Details:</b>_yourdata2_ <font color=blue><b>Phone:_yourdata3_</b></font><br><a
href="StoreDetails.aspx?id=_yourid_">Click here for more
information</a><hr>
Footer:
<font size=1>page _pageno_ of _nopages_ _pageselection_
_previouspage_ _nextpage_</font>
Is merged to display:

...

If a template is made in C26 then when the user clicks on a pin
then the user will see that template merged with your data.
More templates can be entered on C27 onwards, which will be
displayed in Tabs. see "Temp 3 Map with Tabs" in example
spreadsheet.
C10 of the Template sheet, contains the "NextPageURL". This
template is merged with data to call the next page, when the list
shows more than one page.
Paging example:
demonearest.aspx?postcode=_targetpostcode_&page=_page_&example=2
calls "demonearest.aspx", which would be your web page, with the
page number. Which in turn calls our server again to show list for
page "_page_"
Test your page:
Now select the "Test page", having set the settings in the settings
page.

Integrate into your page:
Now integrate into your own web site, using the code in the "Nearest
Store" directory of our example code. At the time
of writing we support PHP, classic ASP and .NET.
The code in the examples, simply calls our web server, which return
two sections of code, which are simply written to your web page.
Therefore you have total control of the appearance of the List and
Map, whilst being removed from the complexity of creating the
Nearest store list and creating the JAVA code to draw the Google Map
with Pins which relate to the Nearest Stores.
[Click
here for example downloads]
How does it work on my own page?
The
following generates a list of nearest stores and the code to display
a Google map.
HTTP
call
http://www.simplylookupadmin.co.uk/nearest/GetNearestToPostcodeMapXML.aspx
?licenseid=0&templateid=1&listid=1&password=&datakey=YourDataKey
&targetpostcode=PE132QL&withinkm=100&pagesize=10&pageno=1&typefilter=
&extraflags=&nopins=1000&mapkey=YourGoogleMapKey
&zoomlevel=10&showcontrols=1&showoverview=1&showmaptype=1
HTTP
calls should only be made by server side script since they contain
your password.
If
error then returns error description:
<errordesc>"Postcode
not found!</errordesc>
This
call returns both the merged template data (list of stores) and the Google map
code in XML. This returned code is then simply displayed
on your own page, using your own Google Map key.
See the PHP
or classic ASP example, in the "nearest" directory of our example
code, to see how to use this. The .net code simply uses a SOAP
call instead of HTTP/XML, to achieve the same functionality.
Our
"Store" database structure is:
|
Name
|
Description
|
|
YourID
|
Your identifier, you can use to get full
record from your database.
UNIQUE
REQUIRED Integer
|
|
YourData1
|
This
can be loaded with any text you want to display. This could be
loaded with the ID of your record, full address, directions,
etc.
This
data is then merged with your template to expand to full HTML
[Click
here for simple example]
|
|
YourData2
|
As YourData1
|
|
YourData3
|
As YourData1
|
|
YourData4
|
As YourData1
|
|
YourData5
|
As YourData1
|
|
YourData6
|
As YourData1
If using filters
then can stop details being shown on pin click if set to "NODETAILS".
This allows control over each Pin
|
|
YourData7
|
As YourData1
|
|
YourData8
|
As YourData1
|
|
Longitude
|
We populate this for you when added to
database
|
|
Latitude
|
We populate this for you when added to
database
|
|
PostCode
|
The Postcode of your store.
REQUIRED
|
|
DataAdded
|
Date
added to database.
We
assign this when added.
format
YYYYMMDD
|
|
Type
|
Can
be used to filter out certain kinds of locations, in nearest
list and show different icons on a map
Optional
Char
[See
Example 5]
TypeFilter
will optionally filter out records from the nearest
list. You could use "A" for major stores,
"B" small stores and "C" for Petrol
stations. Then if displayed on map they could all have
different Pins. The actual list returned could
only include "AB", so the petrol stations would not
be listed.
This field could also be loaded with codes, which
relate to qualifications. Then the service is called with
the type code (qualification code) to product a list of
nearest consultants with curtail qualifications. |
|
Area
|
Allows you to
display all Stores in a certain area.
Optional String (2)
To display a map
for Area simple call the
GetNearestToPostCodeTemplateAndMap
with
ExtraFlags="AreaCode=Area"
the TargetPostcode should be set to center the
map
[See
Example 6,7]
|
Template Tags:
The tags used are:
For
DetailsTemplate:
| Tag |
Description |
|
_yourid_
|
Replaced with Your ID,from the database |
|
_yourdata1_
|
Replaced with Your Data1, from the database |
|
_yourdata2_
|
Replaced with Your Data2, from the database |
|
_yourdata3_
|
Replaced with Your Data3, from the database |
|
_yourdata4_
|
Replaced with Your Data4, from the database |
|
_yourdata5_
|
Replaced with Your Data5, from the database |
|
_yourdata6_
|
Replaced with Your Data6, from the database
If using filters
then can stop details being shown on pin if "NODETAILS"
|
|
_yourdata7_
|
Replaced with Your Data7, from the database |
|
_yourdata8_
|
Replaced with Your Data8, from the database |
|
_postcode_
|
Replaced with postcode,from the database |
|
_longitude_
|
Replaced with Longitude,from the database |
|
_latitude_
|
Replaced with Latitude,from the database |
|
_km_ or _mile_
|
Distance from target |
|
_dateadded_
|
Replaced with date added to the database |
|
_rank_
|
Replaced with rank count for page of results |
|
_type_
|
Replaced with type |
|
_alphcount_
|
Replaced with A,B,C... count for page of results |
For HeaderTemplate
and FooterTemplate:
| Tag |
Description |
|
_recordcount_
|
Replaced with record count of results
found in list. |
|
_pincount_
|
Replaced with map pin count of results
found in list. |
|
_listcount_
|
Replaced with number of items in
list on current page |
|
_nopages_
|
Replaced with number of pages of results |
|
_pageno_
|
Replaced with page number |
|
_pageselection_
|
Replaced with link to pages [1] [2]
[3]... |
|
_previouspage_
|
Replaced with link to previous page
if on page 2 onwards |
|
_nextpage_
|
Replaced with link to next page if
on page 1 to last but one. See example below... |
For NextPageURL:
| Tag |
Description |
|
_targetpostcode_
|
Replaced with Target Postcode in
link |
|
_page_
|
Replaced with
Target Page in link
See example
below... |
All must be in lower case
All the other parameters are used by mapping
functions, and can be left blank if map is not needed.
IconsLocation
is optional, but should point to web directory where pin icons can
be found. Icons should be named "icon" &
type & ".png" so different icons can be used for
different types of nearest property. Such as schools etc. If
blank will use default Google pin. If type is not used you
should give a "icon.png", and "shadicon.png" if
shadows are on. [See
Example 5 shows type icons]
if
ShowTargetPin
then displays a ping for the Target Postcode "icontarget.png",
and "shadicontarget.png" if shadows are on.
[See
Example 2 and 3]
TargetPin_Details
show if user clicks on pins. Leave blank if not needed.
Click on target pin in example 2 and 3.
ShowShadowOnPins,
if true then uses shadow pins. Uses the same names as other
icon with prefix "shad". Therefore "icontarget.png"
becomes "shadicontarget.png". If using filter
on types then icon for shadow is called "shadiconfilterout.png".
All examples use shadows.
UseNumberedPins
if True then uses "iconx.png" where x is the rank
in the results. This allows you to create pins representing
1-10 (or A-Z) and display them which match the text results (using
_rank_ or
_alphcount_ tag to match). [See
Example 4 and 5]
Target_PinIcon_Details,Included_PinIcon_Details
and
FilteredOut_PinIcon_Details
should
be a list of co-ordinates for each type of icon. IconsSizeX,
IconSizeY, ShadowSizeX, ShadowSizeY, IconAnchorX, IconAnchorY,
InfoWindowAnchorX and InfoWindowAnchorY
TabTemplate1
template to merge with your data to show details when user clicks on
pin. Leave blank to just show pins. [See
Example 2]
TabTemplate2-4
extra tabs on pins. Leave blank if not needed. Use tag <tabname>Tab
Name</tabname> to define tab names within TabTemplate1-4.
[See
Example 3]
ExtraFlags
allows extra functionality, as listed below:
|
if contains
|
Description |
|
NOSCALE
|
removes scale on Google map. |
| |
|
| |
|
| |
|
Each
value should be separated by comma
|