# Path: glottolog3/models.py
# class LanguoidLevel(DeclEnum):
#     family = 'family', 'family'
#     language = 'language', 'language'
#     dialect = 'dialect', 'dialect'


from clld.web.maps import Map, Layer, Legend
from clld.web.adapters.geojson import GeoJson
from clld.web.util.htmllib import HTML, literal
from glottolog3.models import LanguoidLevel
        from glottolog3.util import languoid_link
        return res + list(ctx.get_geocoords())

    def featurecollection_properties(self, ctx, req):
        return {'layer': getattr(ctx, 'id', '')}

    def feature_properties(self, ctx, req, feature):
        return {'icon': self.icon_map[feature[0]], 'branch': feature[0]} if self.icon_map else {}

    def get_language(self, ctx, req, feature):
        return Language(*feature)


class LanguoidMap(Map):
    def __init__(self, ctx, req, eid='map', icon_map=None):
        super(LanguoidMap, self).__init__(ctx, req, eid=eid)
        self.icon_map = icon_map or {}

    def get_layers(self):
        yield Layer(
            self.ctx.id,
            self.ctx.name,
            LanguoidGeoJson(
                self.ctx, self.icon_map).render(self.ctx, self.req, dump=False))

    def get_options(self):
        res = {'max_zoom': 12}
        if self.req.matchdict.get('ext') == 'bigmap.html':
            res['hash'] = True
        else:
            res['sidebar'] = True

# Path: glottolog3/models.py
# class LanguoidLevel(DeclEnum):
#     family = 'family', 'family'
#     language = 'language', 'language'
#     dialect = 'dialect', 'dialect'


# Path: glottolog3/maps.py
from clld.web.maps import Map, Layer, Legend
from clld.web.adapters.geojson import GeoJson
from clld.web.util.htmllib import HTML, literal
from glottolog3.models import LanguoidLevel
        from glottolog3.util import languoid_link

        return res + list(ctx.get_geocoords())

    def featurecollection_properties(self, ctx, req):
        return {'layer': getattr(ctx, 'id', '')}

    def feature_properties(self, ctx, req, feature):
        return {'icon': self.icon_map[feature[0]], 'branch': feature[0]} if self.icon_map else {}

    def get_language(self, ctx, req, feature):
        return Language(*feature)


class LanguoidMap(Map):
    def __init__(self, ctx, req, eid='map', icon_map=None):
        super(LanguoidMap, self).__init__(ctx, req, eid=eid)
        self.icon_map = icon_map or {}

    def get_layers(self):
        yield Layer(
            self.ctx.id,
            self.ctx.name,
            LanguoidGeoJson(
                self.ctx, self.icon_map).render(self.ctx, self.req, dump=False))

    def get_options(self):
        res = {'max_zoom': 12}
        if self.req.matchdict.get('ext') == 'bigmap.html':
            res['hash'] = True
        else:
            res['sidebar'] = True

        res['zoom'] = 4 if self.ctx.level != LanguoidLevel.family else 6