'Constructor
@param levels: list or tuple of hierarchy levels (names) to expose,
in order (e.g. ("L0", "L1", "L2"))
@param required_levels: list or tuple of required hierarchy levels (if empty,
only the highest selectable Lx will be required)
@param hide_lx: hide Lx selectors until higher level has been selected
@param reverse_lx: render Lx selectors in the order usually used by
street Addresses (lowest level first), and below the
address line
@param show_address: show a field for street address.
If the parameter is set to a string then this is used as the label.
@param show_postcode: show a field for postcode
@param show_latlon: show fields for manual Lat/Lon input
@param latlon_mode: (initial) lat/lon input mode ("decimal" or "dms")
@param latlon_mode_toggle: allow user to toggle lat/lon input mode
@param show_map: show a map to select specific points
@param open_map_on_load: show map on load
@param feature_required: map feature is required
@param lines: use a line draw tool
@param points: use a point draw tool
@param polygons: use a polygon draw tool
@param circles: use a circle draw tool
@param color_picker: display a color-picker to set per-feature styling
(also need to enable in the feature layer to show on map)
@param catalog_layers: display catalogue layers or just the default base layer
@param min_bbox: minimum BBOX in map selector, used to determine automatic
zoom level for single-point locations
@param labels: show labels on inputs
@param placeholders: show placeholder text in inputs
@param error_message: default error message for server-side validation
@param represent: an S3Represent instance that can represent non-DB rows
@param prevent_duplicate_addresses: do a check for duplicate addresses & prevent
creation of record if a dupe is found'

def __init__(self, levels=None, required_levels=None, hide_lx=True, reverse_lx=False, show_address=False, show_postcode=None, show_latlon=None, latlon_mode='decimal', latlon_mode_toggle=True, show_map=None, open_map_on_load=False, feature_required=False, lines=False, points=True, polygons=False, circles=False, color_picker=False, catalog_layers=False, min_bbox=None, labels=True, placeholders=False, error_message=None, represent=None, prevent_duplicate_addresses=False):

    settings = current.deployment_settings
    self._initlx = True
    self._levels = levels
    self._required_levels = required_levels
    self._load_levels = None
    self.hide_lx = hide_lx
    self.reverse_lx = reverse_lx
    self.show_address = show_address
    self.show_postcode = show_postcode
    self.prevent_duplicate_addresses = prevent_duplicate_addresses
    if (show_latlon is None):
        show_latlon = settings.get_gis_latlon_selector()
    self.show_latlon = show_latlon
    self.latlon_mode = latlon_mode
    if show_latlon:
        self.latlon_mode_toggle = latlon_mode_toggle
    else:
        self.latlon_mode_toggle = False
    if feature_required:
        show_map = True
        if (not any((points, lines, polygons, circles))):
            points = True
        if (lines or polygons or circles):
            required = ('wkt' if (not points) else 'any')
        else:
            required = 'latlon'
        self.feature_required = required
    else:
        self.feature_required = None
    if (show_map is None):
        show_map = settings.get_gis_map_selector()
    self.show_map = show_map
    self.open_map_on_load = (show_map and open_map_on_load)
    self.lines = lines
    self.points = points
    self.polygons = polygons
    self.circles = circles
    self.color_picker = color_picker
    self.catalog_layers = catalog_layers
    self.min_bbox = (min_bbox or settings.get_gis_bbox_min_size())
    self.labels = labels
    self.placeholders = placeholders
    self.error_message = error_message
    self._represent = represent
