當前位置: 首頁>>代碼示例>>Python>>正文


Python LayerGroup.name方法代碼示例

本文整理匯總了Python中c2cgeoportal.models.LayerGroup.name方法的典型用法代碼示例。如果您正苦於以下問題:Python LayerGroup.name方法的具體用法?Python LayerGroup.name怎麽用?Python LayerGroup.name使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在c2cgeoportal.models.LayerGroup的用法示例。


在下文中一共展示了LayerGroup.name方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_layer

# 需要導入模塊: from c2cgeoportal.models import LayerGroup [as 別名]
# 或者: from c2cgeoportal.models.LayerGroup import name [as 別名]
    def test_layer(self):
        import httplib2
        from c2cgeoportal.views.entry import Entry
        from c2cgeoportal.models import Layer, LayerGroup, Theme

        request = testing.DummyRequest()
        request.headers['Host'] = host
        request.static_url = lambda url: '/dummy/static/' + url
        request.route_url = lambda url: '/dummy/route/' + url
        request.registry.settings = {
            'project': 'test_layer',
        }
        entry = Entry(request)

        self.assertEqual(entry._group(LayerGroup(), [], [], None), (None, [], False))

        layer = Layer()
        layer.id = 20
        layer.name = 'test internal WMS'
        layer.metadataURL = "http://example.com/tiwms"
        layer.isChecked = True
        layer.layerType = "internal WMS"
        layer.imageType = "image/png"
        layer.style = "my-style"
        layer.kml = "tiwms.kml"
        layer.legend = True
        layer.legendRule = "rule"
        layer.legendImage = "legend:static/tiwms-legend.png"
        layer.minResolution = 10
        layer.maxResolution = 1000
        layer.disclaimer = "Camptocamp"
        layer.identifierAttributeField = "name"
        layer.geoTable = "tiwms"
        layer.public = True
        self.assertEqual(entry._layer(layer, [], None), ({
            'id': 20,
            'name': 'test internal WMS',
            'metadataURL': 'http://example.com/tiwms',
            'isChecked': True,
            'icon': '/dummy/route/mapserverproxy?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetLegendGraphic&LAYER=test internal WMS&FORMAT=image/png&TRANSPARENT=TRUE&RULE=rule',
            'type': u'internal WMS',
            'imageType': 'image/png',
            'style': 'my-style',
            'kml': '/dummy/static/test_layer:static/tiwms.kml',
            'legend': True,
            'legendImage': '/dummy/static/legend:static/tiwms-legend.png',
            'minResolutionHint': 10,
            'maxResolutionHint': 1000,
            'disclaimer': 'Camptocamp',
            'identifierAttribute': 'name',
            'editable': True,
            'public': True,
        }, []))

        layer = Layer()
        layer.id = 20
        layer.name = 'test external WMS'
        layer.isChecked = False
        layer.icon = "tewms.png"
        layer.layerType = "external WMS"
        layer.url = "http://example.com"
        layer.imageType = "image/jpeg"
        layer.isSingleTile = True
        layer.legend = False
        layer.minResolution = 10
        layer.maxResolution = 1000
        layer.public = True
        self.assertEqual(entry._layer(layer, [], None), ({
            'id': 20,
            'name': 'test external WMS',
            'icon': '/dummy/static/test_layer:static/tewms.png',
            'isChecked': False,
            'type': u'external WMS',
            'url': 'http://example.com',
            'imageType': 'image/jpeg',
            'isSingleTile': True,
            'legend': False,
            'minResolutionHint': 10,
            'maxResolutionHint': 1000,
            'public': True,
        }, []))

        layer = Layer()
        layer.id = 20
        layer.name = 'test WMTS'
        layer.isChecked = False
        layer.layerType = "WMTS"
        layer.url = "http://example.com/WMTS-Capabilities.xml"
        layer.style = 'wmts-style'
        layer.dimensions = '{"DATE": "1012"}'
        layer.matrixSet = "swissgrid"
        layer.wmsUrl = 'http://example.com/'
        layer.wmsLayers = 'test'
        layer.legend = False
        layer.minResolution = 10
        layer.maxResolution = 1000
        layer.public = True
        self.assertEqual(entry._layer(layer, [], None), ({
            'id': 20,
            'name': 'test WMTS',
#.........這裏部分代碼省略.........
開發者ID:tonio,項目名稱:c2cgeoportal,代碼行數:103,代碼來源:test_entry.py

示例2: test_layer

# 需要導入模塊: from c2cgeoportal.models import LayerGroup [as 別名]
# 或者: from c2cgeoportal.models.LayerGroup import name [as 別名]
    def test_layer(self):
        import httplib2
        from c2cgeoportal.views.entry import Entry
        from c2cgeoportal.models import Layer, LayerGroup, Theme

        request = testing.DummyRequest()
        request.headers["Host"] = host
        request.static_url = lambda url: "/dummy/static/" + url
        request.route_url = lambda url: "/dummy/route/" + url
        request.registry.settings = {"project": "test_layer"}
        entry = Entry(request)

        self.assertEqual(entry._group(LayerGroup(), [], [], None), (None, [], False))

        layer = Layer()
        layer.id = 20
        layer.name = "test internal WMS"
        layer.metadataURL = "http://example.com/tiwms"
        layer.isChecked = True
        layer.layerType = "internal WMS"
        layer.imageType = "image/png"
        layer.style = "my-style"
        layer.kml = "tiwms.kml"
        layer.legend = True
        layer.legendRule = "rule"
        layer.legendImage = "legend:static/tiwms-legend.png"
        layer.minResolution = 10
        layer.maxResolution = 1000
        layer.disclaimer = "Camptocamp"
        layer.identifierAttributeField = "name"
        layer.geoTable = "tiwms"
        layer.public = True
        self.assertEqual(
            entry._layer(layer, [], None),
            (
                {
                    "id": 20,
                    "name": "test internal WMS",
                    "metadataURL": "http://example.com/tiwms",
                    "isChecked": True,
                    "icon": "/dummy/route/mapserverproxy?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetLegendGraphic&LAYER=test internal WMS&FORMAT=image/png&TRANSPARENT=TRUE&RULE=rule",
                    "type": u"internal WMS",
                    "imageType": "image/png",
                    "style": "my-style",
                    "kml": "/dummy/static/test_layer:static/tiwms.kml",
                    "legend": True,
                    "legendImage": "/dummy/static/legend:static/tiwms-legend.png",
                    "minResolutionHint": 10,
                    "maxResolutionHint": 1000,
                    "disclaimer": "Camptocamp",
                    "identifierAttribute": "name",
                    "editable": True,
                    "public": True,
                },
                [],
            ),
        )

        layer = Layer()
        layer.id = 20
        layer.name = "test external WMS"
        layer.isChecked = False
        layer.icon = "tewms.png"
        layer.layerType = "external WMS"
        layer.url = "http://example.com"
        layer.imageType = "image/jpeg"
        layer.isSingleTile = True
        layer.legend = False
        layer.minResolution = 10
        layer.maxResolution = 1000
        layer.public = True
        self.assertEqual(
            entry._layer(layer, [], None),
            (
                {
                    "id": 20,
                    "name": "test external WMS",
                    "icon": "/dummy/static/test_layer:static/tewms.png",
                    "isChecked": False,
                    "type": u"external WMS",
                    "url": "http://example.com",
                    "imageType": "image/jpeg",
                    "isSingleTile": True,
                    "legend": False,
                    "minResolutionHint": 10,
                    "maxResolutionHint": 1000,
                    "public": True,
                },
                [],
            ),
        )

        layer = Layer()
        layer.id = 20
        layer.name = "test WMTS"
        layer.isChecked = False
        layer.layerType = "WMTS"
        layer.url = "http://example.com/WMTS-Capabilities.xml"
        layer.style = "wmts-style"
        layer.dimensions = '{"DATE": "1012"}'
#.........這裏部分代碼省略.........
開發者ID:bbinet,項目名稱:c2cgeoportal,代碼行數:103,代碼來源:test_entry.py


注:本文中的c2cgeoportal.models.LayerGroup.name方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。