When using the Caspio Bridge Map Mashup you may want to hide the Google map when no results are found.  This article explains how to accomplish this.

1. Edit the Localization

In the Caspio Bridge homepage navigate to the Localizations listing.  Select the Localization used in your Search and  Report DataPage which is configured for map mashup.  Click the Edit button to open the Localization Wizard.  On the Define Localization Settings screen, in the Categories, select Forms/Details Pages section and select Messages.  Element ID #351 is the No Records Found message.

We are going to customize the HTML text in the Custom Text by adding an extra div tag around the message.

<div id="norecord"><h1>No records found.</h1></div>

2. Edit the Report DataPage

Now, go back to the DataPages listing and select the Report DataPage. Click on the Edit button to open the Report wizard. Proceed to the Configure Results Page Fields screen.  Using the Insert button at the lower right of the DataPage Elements panel, insert Header & Footer sections. Paste the following code into the Footer:

<script>
function func_NoRec_Map()
{
if (document.getElementById("norecord"))
          document.getElementById("map").style.display = "none";
}
window.onload=func_NoRec_Map;
<script>

Make sure the div ID you have assigned (in this example “norecord”) is the same in both the Localization message and the JavaScript code.

Now whenever the user receives the No Records Found message, the map will automatically be hidden.