Beispiel #1
0
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))
Beispiel #2
0
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))
Beispiel #3
0
 def setup(self):
     self.client = MockWMSClient()
     self.source = WMSSource(self.client)
     self.layer = DirectMapLayer(self.source, GLOBAL_GEOGRAPHIC_EXTENT)
Beispiel #4
0
 def layer(self, mock_wms_client):
     source = WMSSource(mock_wms_client)
     return DirectMapLayer(source, GLOBAL_GEOGRAPHIC_EXTENT)
Beispiel #5
0
 def setup(self):
     self.client = MockWMSClient()
     self.source = WMSSource(self.client)
     self.layer = DirectMapLayer(self.source, GLOBAL_GEOGRAPHIC_EXTENT)