def METHOD_NAME(document, lang):
    """Load and return areas linked with the given document.
    """
    maps = DBSession. \
        query(TopoMap). \
        filter(TopoMap.redirects_to.is_(None)). \
        join(
            TopoMapAssociation,
            TopoMap.document_id == TopoMapAssociation.topo_map_id). \
        options(load_only(
            TopoMap.document_id, TopoMap.version, TopoMap.protected,
            TopoMap.editor, TopoMap.scale, TopoMap.code)). \
        options(joinedload(TopoMap.locales).load_only(
            DocumentLocale.lang, DocumentLocale.title,
            DocumentLocale.version)). \
        filter(
            TopoMapAssociation.document_id == document.document_id
        ). \
        all()
    if lang is not None:
        set_best_locale(maps, lang)
    return maps