Hi there,
If I understand what tutorial you’re looking at, you’ll have to change request.POST[‘layer’] to something like request.POST.getlist(‘layer’) or request.POST.getlist(‘layer[]’). This will return a list of the values instead of just one value. You’d also have to iterate through that list and make a MVLayer object for each being added.
i.e. something like:
if request.POST and 'layer' in request.POST:
selected_layers = request.POST.getlist('layer')
for layer in selected_layers:
legend_title = layer.title()
geoserver_layer = MVLayer(
source='ImageWMS',
options={
'url': 'http://localhost:8181/geoserver/wms',
'params': {'LAYERS': layer},
'serverType': 'geoserver'
},
legend_title=legend_title,
legend_extent=[-114, 36.5, -109, 42.5],
legend_classes=[
MVLegendClass('polygon', 'County', fill='#999999'),
])
map_layers.append(geoserver_layer)
Thanks,
Dustin Brown
--
You received this message because you are subscribed to the Google Groups "Tethys Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
tethysplatfor...@googlegroups.com.
To view this discussion on the web visit
Blockedhttps://groups.google.com/d/msgid/tethysplatform/2d62cbca-3a72-4cbf-88de-36a124f9479f%40googlegroups.comBlocked.
For more options, visit
Blockedhttps://groups.google.com/d/optoutBlocked.