'Custom lookup method for Location(GIS) rows.Parameters
key and fields are not used, but are kept for API
compatiblity reasons.
@param values: the gis_location IDs'

def lookup_rows(self, key, values, fields=None):

    db = current.db
    s3db = current.s3db
    ltable = s3db.gis_location
    count = len(values)
    sep = self.sep
    translate = self.translate
    fields = [ltable.id, ltable.name, ltable.level, ltable.path, ltable.L0, ltable.L1, ltable.L2, ltable.L3, ltable.L4, ltable.L5]
    if sep:
        gis_fields = fields
    elif (self.address_only and (not self.show_marker_icon)):
        gis_fields = (fields + [ltable.parent, ltable.addr_street, ltable.addr_postcode])
    else:
        gis_fields = (fields + [ltable.parent, ltable.addr_street, ltable.addr_postcode, ltable.inherited, ltable.lat, ltable.lon])
    if (count == 1):
        query = (ltable.id == values[0])
    else:
        query = ltable.id.belongs(values)
    rows = db(query).select(limitby=(0, count), *gis_fields)
    location_ids = []
    paths = self.paths = {}
    if (sep or translate):
        for row in rows:
            path = row.path
            if (not path):
                path = current.gis.update_location_tree(row)
            split_path = path.split('/')
            paths[row.id] = split_path
            location_ids += split_path
        location_ids = set(location_ids)
    if translate:
        table = s3db.gis_location_name
        query = ((table.deleted == False) & (table.language == current.session.s3.language))
        count = len(location_ids)
        if (count == 1):
            query &= (table.location_id == row.id)
        else:
            query &= table.location_id.belongs(location_ids)
        self.l10n = db(query).select(table.location_id, table.name_l10n, limitby=(0, count)).as_dict(key='location_id')
    return rows
