Latitude and Longitude

If users will place your container tag (site tag) on a map, it will need to store latitude and longitude coordinates and have a way to refresh those values. Both parameters and variables are required.

The parameter list must include Latitude and Longitude, to provide a means for users to locate the site on a map:

Latitude   <:TagField("SQL_LONGVARCHAR" ):> { The location of this site };
Longitude  <:TagField("SQL_LONGVARCHAR" ):> { The location of this site };

Matching constants must be created, as for all tag parameters.

In the tag's list of variables, you will create the following:

LatitudeValue  { Evaluated location of this site };
LongitudeValue { Evaluated location of this site };

 

The main state for the tag must provide a way to set those internal variables:

TagMain [
  { Set the Latitude and Longitude }
  LatitudeValue = (Valid(Scope(Root, "Latitude", TRUE)) ? 
                   \ExpressionManager : Invalid)\ToValue(Scope(Root, "Latitude",  TRUE));
  LongitudeValue  = (Valid(Scope(Root, "Longitude", TRUE)) ? 
                   \ExpressionManager : Invalid)\ToValue(Scope(Root, "Longitude", TRUE));
]

 

And finally, the Refresh module must provide a way to update the variables:

...
\ExpressionManager\SafeRefresh(&Latitude, Parms[#Latitude]);
\ExpressionManager\SafeRefresh(&Longitude, Parms[#Longitude]);
...