| 104 | |
| 105 | |
| 106 | def draw_map_wfs(name, save=0): |
| 107 | #print "making map in thread %s" % (name) |
| 108 | mo = mapscript.mapObj(TESTMAPFILE) |
| 109 | |
| 110 | # WFS layer |
| 111 | lo = mapscript.layerObj() |
| 112 | lo.name = 'cheapo_wfs' |
| 113 | lo.setProjection('+init=epsg:4326') |
| 114 | lo.connectiontype = mapscript.MS_WFS |
| 115 | lo.connection = 'http://zcologia.com:9001/mapserver/members/features.rpy?' |
| 116 | lo.metadata.set('wfs_service', 'WFS') |
| 117 | lo.metadata.set('wfs_typename', 'users') |
| 118 | lo.metadata.set('wfs_version', '1.0.0') |
| 119 | lo.type = mapscript.MS_LAYER_POINT |
| 120 | lo.status = mapscript.MS_DEFAULT |
| 121 | lo.labelitem = 'zco:mid' |
| 122 | |
| 123 | so1 = mapscript.styleObj() |
| 124 | so1.color.setHex('#FFFFFF') |
| 125 | so1.size = 9 |
| 126 | so1.symbol = 1 #mo.symbolset.index('circle') |
| 127 | |
| 128 | so2 = mapscript.styleObj() |
| 129 | so2.color.setHex('#333333') |
| 130 | so2.size = 7 |
| 131 | so2.symbol = 1 #mo.symbolset.index('circle') |
| 132 | |
| 133 | co = mapscript.classObj() |
| 134 | co.label.type = mapscript.MS_BITMAP |
| 135 | co.label.size = mapscript.MS_SMALL |
| 136 | co.label.color.setHex('#000000') |
| 137 | co.label.outlinecolor.setHex('#FFFFFF') |
| 138 | co.label.position = mapscript.MS_AUTO |
| 139 | |
| 140 | co.insertStyle(so1) |
| 141 | co.insertStyle(so2) |
| 142 | lo.insertClass(co) |
| 143 | mo.insertLayer(lo) |
| 144 | |
| 145 | if not mo.web.imagepath: |
| 146 | mo.web.imagepath = os.environ.get('TEMP', None) or INCOMING |
| 147 | mo.debug = mapscript.MS_ON |
| 148 | im = mo.draw() |
| 149 | if save: |
| 150 | im.save('threadtest_wfs_%s.png' % (name)) |
| 151 | |
| 152 | def draw_map_wms(name, save=0): |
| 153 | #print "making map in thread %s" % (name) |