本文整理汇总了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',
#.........这里部分代码省略.........
示例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"}'
#.........这里部分代码省略.........