MCPcopy Create free account
hub / github.com/MapServer/MapServer / draw_map_wms

Function draw_map_wms

mapscript/python/tests/cases/threadtest.py:152–179  ·  view source on GitHub ↗
(name, save=0)

Source from the content-addressed store, hash-verified

150 im.save('threadtest_wfs_%s.png' % (name))
151
152def draw_map_wms(name, save=0):
153 #print "making map in thread %s" % (name)
154 mo = mapscript.mapObj(TESTMAPFILE)
155
156 # WFS layer
157 lo = mapscript.layerObj()
158 lo.name = 'jpl_wms'
159 lo.setProjection('+init=epsg:4326')
160 lo.connectiontype = mapscript.MS_WMS
161# lo.connection = 'http://wms.jpl.nasa.gov/wms.cgi?'
162 lo.connection = 'http://labs.metacarta.com/wms/vmap0?'
163 lo.metadata.set('wms_service', 'WMS')
164 lo.metadata.set('wms_server_version', '1.1.1')
165 lo.metadata.set('wms_name', 'basic')
166 lo.metadata.set('wms_style', 'visual')
167 lo.metadata.set('wms_format', 'image/jpeg')
168 lo.type = mapscript.MS_LAYER_RASTER
169 lo.status = mapscript.MS_DEFAULT
170 lo.debug = mapscript.MS_ON
171 mo.insertLayer(lo)
172
173 if not mo.web.imagepath:
174 mo.web.imagepath = os.environ.get('TEMP', None) or INCOMING
175 mo.debug = mapscript.MS_ON
176 mo.selectOutputFormat('image/jpeg')
177 im = mo.draw()
178 if save:
179 im.save('threadtest_wms_%s.jpg' % (name))
180
181class OWSRequestTestCase(unittest.TestCase):
182

Callers

nothing calls this directly

Calls 4

getMethod · 0.80
drawMethod · 0.80
saveMethod · 0.80
setMethod · 0.45

Tested by

no test coverage detected