Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions cpp/openlocationcode.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,15 @@ namespace openlocationcode {
// rectangle that encloses the coordinates. The accuracy of the code is
// controlled by the code length.
//
// Returns an Open Location Code with code_length significant digits. The string
// returned may be one character longer if it includes a separator character
// for formatting.
// Returns a full Open Location Code. code_length specifies the number of
// significant digits, excluding the '+' separator and any '0' padding.
// Requested lengths are clamped to 2 through 15, with odd lengths below 10
// rounded up.
//
// The returned string always includes '+' after eight characters. Codes with
// fewer than eight significant digits are padded with '0' before the separator,
// giving a returned length of nine characters. Otherwise, the returned length
// is the number of significant digits plus one.
std::string Encode(const LatLng &location, size_t code_length);

// Encodes a pair of coordinates and return an Open Location Code representing a
Expand Down
Loading