Пример #1
0
    def test_ParameterMap(self):
        from clld.web.maps import ParameterMap

        class MockRoute(Mock):
            name = 'parameter'

        self.set_request_properties(matched_route=MockRoute())

        dt = ParameterMap(common.Parameter.get('parameter'), self.env['request'])
        for l in dt.layers:
            l.representation = 5
        dt.render()

        dt = ParameterMap(common.Parameter.get('no-domain'), self.env['request'])
        dt.render()
Пример #2
0
    def test_ParameterMap(self):
        from clld.web.maps import ParameterMap

        self.set_route('parameter')

        dt = ParameterMap(common.Parameter.get('parameter'), self.env['request'])
        for l in dt.layers:
            l.representation = 5
        dt.render()

        dt = ParameterMap(common.Parameter.get('no-domain'), self.env['request'])
        dt.render()
Пример #3
0
    def test_ParameterMap(self):
        from clld.web.maps import ParameterMap

        class MockRoute(Mock):
            name = 'parameter'

        self.set_request_properties(matched_route=MockRoute())

        dt = ParameterMap(common.Parameter.get('parameter'), self.env['request'])
        for l in dt.layers:
            l.representation = 5
        dt.render()

        dt = ParameterMap(common.Parameter.get('no-domain'), self.env['request'])
        dt.render()
Пример #4
0
 def __init__(self, ctx, req, eid='map', col=None, dt=None):
     self.col, self.dt = col, dt
     ParameterMap.__init__(self, ctx, req, eid=eid)
Пример #5
0
    def get_legends(self):
        for legend in ParameterMap.get_legends(self):
            yield legend

        yield FilterLegend(self, 'SAILS.getFamily', col=self.col, dt=self.dt)
Пример #6
0
 def __init__(self, ctx, req, eid='map', col=None, dt=None):
     self.col, self.dt = col, dt
     ParameterMap.__init__(self, ctx, req, eid=eid)
Пример #7
0
 def __init__(self, *args, **kw):
     self.family = kw.pop('family', None)
     ParameterMap.__init__(self, *args, **kw)
Пример #8
0
    def get_legends(self):
        for legend in ParameterMap.get_legends(self):
            yield legend

        yield FilterLegend(self, 'SAILS.getFamily', col=self.col, dt=self.dt)
Пример #9
0
 def get_legends(self):
     for l in ParameterMap.get_legends(self):
         if l.name != 'iconsize':
             yield l
Пример #10
0
 def get_options(self):
     return dict_merged(ParameterMap.get_options(self), **OPTIONS)