You can display links on your Website that link directly to specific searches of your interface.  To do this, you can add URL parameters to the page on which the MetaLocator code is hosted.  These special URL parameters will be passed into the MetaLocator interface code on that page and interpreted as part of the search.

In this example, an interface is displayed on as shown here:

If we want the page to automatically pre-populate the postal code field in the postal code search box, we can add a URL parameter as follows:

If we want to pre-populate the search box and perform the search automatically, we must add a radius, and the task parameter as follows:

Note that the URL parameter prefix is "ml" followed by 3 underscores.  Any form variable can be included this in this manner.

To link directly to the location with ID number 12,

To automatically check category check-boxes, use the following syntax, where 99 and 100 are the ID of the category, as shown in the ID column under Categories in the MetaLocator Control Panel.[]=99&ml___tags[]=100

You can also use this method to create your own search form.

A simple HTML example follows, where locator.html is the page on which your MetaLocator interface is deployed.

<input id="postal_code" type="text" />
 <input type="button" id="btn_submit" onclick="window.location.href='locator.html?ml___task=search_zip&ml___radius=200&ml___postal_code=' + document.getElementById('postal_code').value;" value="Submit" />

Passing Javascript Variables

An Interface can also accept parameters via a javascript variable declared above the Interface installation  code as follows:

var ml___params = {};

The ml___params array can contain any URL-parameter option as described above.  For example, this declaration would cause the City option to be pre-selected as Milwaukee and the keyword pre-populated to "smith".

var ml___params = {"city":"Milwaukee","keyword":"smith"};

Overriding Interface Settings

You can also override Interface settings by constructing an ml___options array.  The settings provided in this array will be overlapped, or merged with the values of the target interface.

 var ml___options = {

In the above example, the map base TLD has been changed to "DE" and the weather units have been changed to imperial.  To discover the allowable names and values for this settings, it is necessary to inspect the Interface settings as shown below:

Privacy Opt-out

You can disable MetaLocator tracking of analytics data by passing  _opt_out=1 as a parameter to your Interface.  This prevents MetaLocator from tracking analytics data and setting cookies.  This is useful for when the user has already opted out of allowing cookies to be set elsewhere on your website, and you would like that existing preference respected within the MetaLocator IFRAME.  

This disables the analytics system and would therefore allow the user to browse anonymously.  This will artificially deflate page views, hits and other events tracked by our analytics system.  Similarly, this may also cause the user to be prompted for their location multiple times, as it can no longer be stored in a cookie.

Did this answer your question?