set_locale

The set_locale method is used to set the time zone, language, date format, or tile density for the layers.

Copied!
svc=render/set_locale&params={"tzOffset":<uint>,
			      			  "language":"<text>",
			      			  "flags":<uint>,
			      			  "formatDate":"<text>",
			      			  "density":<uint>}

Parameters

Parameter Description
tzOffset Required. Time zone.
language Language (2-character code).
formatDate Date and time format string (see below). Always applied — omit only if you want to clear the current format.
flags Optional. Bitmask of renderer options. The two lowest bits set the measurement system:

  • 0 for metric (SI);
  • 1 for US;
  • 2 for imperial;
  • 3 for metric with gallons.
The other bits control the rendering behavior.
density Optional. Tile size.

The value of flags replaces the current flags of the session completely. If you send this request only to change the measurement system, the other bits are reset. To keep them, include them in the new value.

Date and time format:

Parameter Description
%H The hour of the day with a leading 0 if necessary (from “00” to “23”).
%B The full month name (from “January” to “December”).
%b The abbreviated month name (from “Jan” to “Dec”).
%m The month of the year with a leading 0 if necessary (from “01” to “12”).
%l The month of the year (from “1” to “12”).
%P The format of the Persian calendar (“01 Farvardin 1392 00:00:00”).
%A The day of the week full name (from “Monday” to “Sunday”).
%a The abbreviated day name (from “Mon” to “Sun”).
%E The day of the month with a leading 0 if necessary (from “01” to “31”).
%e The day of the month (from “1” to “31”).
%I The hour of the day with a leading 0 if necessary (from “01” to “12”)
%M The minute of the hour with a leading 0 if necessary (from “00” or “59”)
%S The seconds of the minute with a leading 0 if necessary (“00” to “59”).
%p The A.M./P.M. designator (“AM” or “PM”).
%Y The full four digit year (“1999” or “2008”).
%y The year as a two-digit number (“99” or “08”).

Example:

Copied!
"formatDate":"%Y-%m-%E %H:%M:%S"

Result:

Copied!
2013-01-26 12:34:56

Density:

Value Tile size Ratio
1 256*256 1
2 378*378 1.5
3 512*512 2
4 768*768 3
5 1024*1024 4

The default tile size is 256*256.

Returned result

If the request is successful, an empty JSON is returned.

Copied!
{ }

If not, an error code is returned. Possible error codes:

Code Description
6 Undefined error.
4 Wrong input parameters.

If you find a mistake in the text, please select it and press Ctrl+Enter.