コード例 #1
0
ファイル: test_cache.py プロジェクト: olt/mapproxy
class TestDirectMapLayerWithSupportedSRS(object):
    def setup(self):
        self.client = MockWMSClient()
        self.source = WMSSource(self.client)
        self.layer = DirectMapLayer(self.source, GLOBAL_GEOGRAPHIC_EXTENT)

    def test_get_map(self):
        result = self.layer.get_map(MapQuery((-180, -90, 180, 90), (300, 150), SRS(4326), "png"))
        eq_(self.client.requested, [((-180, -90, 180, 90), (300, 150), SRS(4326))])
        eq_(result.size, (300, 150))

    def test_get_map_mercator(self):
        result = self.layer.get_map(
            MapQuery((-20037508.34, -20037508.34, 20037508.34, 20037508.34), (500, 500), SRS(900913), "png")
        )
        eq_(self.client.requested, [((-20037508.34, -20037508.34, 20037508.34, 20037508.34), (500, 500), SRS(900913))])
        eq_(result.size, (500, 500))
コード例 #2
0
ファイル: test_cache.py プロジェクト: imclab/mapproxy
class TestDirectMapLayerWithSupportedSRS(object):
    def setup(self):
        self.client = MockWMSClient()
        self.source = WMSSource(self.client)
        self.layer = DirectMapLayer(self.source, GLOBAL_GEOGRAPHIC_EXTENT)

    def test_get_map(self):
        result = self.layer.get_map(MapQuery((-180, -90, 180, 90), (300, 150), SRS(4326), 'png'))
        eq_(self.client.requested, [((-180, -90, 180, 90), (300, 150), SRS(4326))])
        eq_(result.size, (300, 150))

    def test_get_map_mercator(self):
        result = self.layer.get_map(MapQuery(
            (-20037508.34, -20037508.34, 20037508.34, 20037508.34), (500, 500),
            SRS(900913), 'png'))
        eq_(self.client.requested,
            [((-20037508.34, -20037508.34, 20037508.34, 20037508.34), (500, 500),
              SRS(900913))])
        eq_(result.size, (500, 500))
コード例 #3
0
ファイル: test_cache.py プロジェクト: atrawog/mapproxy
 def setup(self):
     self.client = MockWMSClient()
     self.source = WMSSource(self.client)
     self.layer = DirectMapLayer(self.source, GLOBAL_GEOGRAPHIC_EXTENT)
コード例 #4
0
ファイル: test_cache.py プロジェクト: yili9111/mapproxy
 def layer(self, mock_wms_client):
     source = WMSSource(mock_wms_client)
     return DirectMapLayer(source, GLOBAL_GEOGRAPHIC_EXTENT)
コード例 #5
0
ファイル: test_cache.py プロジェクト: gxx0324/mapproxy
 def setup(self):
     self.client = MockWMSClient()
     self.source = WMSSource(self.client)
     self.layer = DirectMapLayer(self.source, GLOBAL_GEOGRAPHIC_EXTENT)