JetkeySmartMap Send comments on this topic.
Passing Querystring and Form Parameters into Queries
See Also

Glossary Item Box

You can pass querystring parameter values and form values into your custom queries on the fly.  Smart Map inserts the values into your custom queries before executing them against the database.  This feature opens up endless possibilities and gives you tremendous control over what data you can dynamically pull from a database to plot on a map.

 

Query Design Example

When designing queries with Smart Map's Query Manager, enclose your input parameter names in squigly brackets {} to identify them to Smart Map. 

For example, "SELECT * FROM JetkeyCountry WHERE Country LIKE '{country}%'

The input parameter {country} must correspond to a querystring parameter with the same name, such as 'country=Australia' or 'country=A'.  Or else a form element must have "country" as the ID. 

Parameters
EnlargeClick to enlarge
 

 QID: QueryID

After adding a query to the database, it's title shows up in a table at the top of the Query Manager page along with a unique ID field called "QID".  Use this QID value in your querstrings, along with any other parameters that are necessary, to execute the query on page load.  See Querystring Formats below.

Query List
EnlargeClick to enlarge

 

Querystring Formats

To execute the query example above, which lists all countries that start with the letter "B", for example, you would use a query like this:

http://smartmap.jetkey.com/Example/tabid/54/Default.aspx?qid=1&country=B

Notice that QID=1 corresponds with the QID assigned to the query when it was saved.  Because the query calls for an input parameter "{country}", the parameter "country" also passed a value in the querystring.

Countries that begin with
EnlargeClick to enlarge

Friendly URL Format

The same querystring above can be written out in friendly URL format as follows:

http://smartmap.jetkey.com/Example/tabid/54/qid/1/country/b/Default.aspx

 

Map Properties as Input Parameters

Several Smart Map property values can also be passed into your queries as input parameters without the need to pass them through a querystring or form element.  They are:

centerlat Center Latitude. Latitude of the center point at runtime.
centerlng Center Longitude. Longitude of the center point at runtime.
zoomlevel Zoom Level. Zoom level of map at runtime.
minlat Minimum Latitude.  The latitude of the southwest corder of map.
minlng Minimum Longitude. The longitude of the southwest corner of map.
maxlat Maximum Latitude. The latitude of the northeast corner of map.
maxlng Maximum Longitude. The longitude of the northeast corner of map.
See Using Map Properties as Input Parameters for more details.

DotNetNuke Parameters

The following DotNetNuke-specific properties can be passed into your queries as input parameters:

moduleid ModuleID
portalid PortalID

See Using DotNetNuke Properties as Input Parameters for more details.

See Also