Caspio - now you can

Basic Map Mashup Instructions

We have put together a quick guide and ready-made scripts to make map mashups with Caspio Bridge as easy as possible.

Below are instructions for both Yahoo! and Google Map services, however, you only need to follow one or the other. In our experience, Yahoo! maps are more forgiving when plotting addresses. With Google maps, expect to get error alerts for addresses with the slightest imperfection.

Step 1 – Get Your Map API Key

Both Google and Yahoo! require that you register your domain name and get your site-specific key. Get your free key from the appropriate site:

Step 2 – Web Page Setup

You need to deploy two code snippets on your web page. This is in addition to your Caspio Bridge deploy code.

1. The first snippet identifies your API Key and should be placed toward the top of your page (before the other code snippet).

[+] Show Yahoo! Maps Code

[+] Show Google Maps Code

Replace [YourOwnAPIKey] with the key that you have received from Yahoo! or Google.

Optional Map Customizations:

Additional mapping parameters can be appended to the second script (yahoomapslist.asp or googlemapslite.asp) for additional control:

Here is an example of a fully parameterized call for lat, long, zoom and ssl:

<script type="text/javascript" src="https://bridge.caspio.net/scripts/yahoomapslite.asp?lat=37.16&long=-95.80&zoom=4&ssl=1"></script>

2. The next code snippet defines your map container and location on the page. Place it where you want the map to appear and adjust the width, height, border and other styling properties as you wish.

[+] Show Code

Step 3 – DataPage Setup

For Search Forms

Preparing your DataPage is as simple as copying and pasting some ready-to-use JavaScript and inserting your address fields as parameters into certain parts of the provided code. You must also have a unique identifier field in your table. An AUTONUMBER field works perfectly.

1. On the first screen of the DataPage wizard, enable Advanced Options and Parameters for your Search and Report DataPages (Figure 1).

2. Put this code in your Search Form's Footer (Figure 2):

[+] Show Code

For Results Pages

1. In Results Page configuration screen, insert an HTML Block and paste in this JavaScript code snippet (Figure 3):

[+] Show Code

DataPage Parameters:

Optional Customizations:

Icon 1 = 1   Icon 2 = 2   Icon 3 =3   Icon 4 = 4   Icon 5 = 5
Icon 6 = 6   Icon 7 = 7   Icon 8 = 8   Icon 9 = 9   Icon 10 = 10

2. In Results Page configuration screen, insert this code in the Footer without any modification (Figure 4):

[+] Show Code

For Details Pages

1. For displaying the map in your Details Page, insert this code segment in an HTML Block in the Details Page:

[+] Show Code

(See the DataPage Parameters above for field replacement details. Note that Details Pages do not require the AUTONUMBER field.)

2. In Details Page configuration screen, use this code snippet in the Footer without any modification (Figure 5):

[+] Show Code

3. Deploy your DataPage on your web page. Your mashup should now be fully functional.

Did you run into a question or problem? Discuss it on the Caspio user community forums.