-
Hello Tethys Developers, I add a WMS layer to my map with following code: wms_layer = self.build_wms_layer(
endpoint=geoserver_wms_url, # 'http://localhost:8080/geoserver/wms'
server_type='geoserver',
layer_name='topp:states',
layer_title='Population',
layer_variable='population',
visible=False,
selectable=True,
geometry_attribute='the_geom',
excluded_properties=['STATE_FIPS', 'SUB_REGION'],
plottable=True
) And I also set class StateTempMap(MapLayout):
...
show_properties_popup = True The WMS layer is showing but there's no pop-up when I click the layer. I also checked the Layer Preview of my local GeoServer, the popup works well. Is this the problem of my environment or it's because I miss something important in my code? Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 12 replies
-
Hi @Sonia-96 are you getting any errors in the JavaScript console when you try to select a feature? Can you post if so? |
Beta Was this translation helpful? Give feedback.
-
@Sonia-96 I think I know what is going on. The JSONP format that the MapLayout is requesting is not enabled by default. See: https://docs.geoserver.org/2.22.x/en/user/services/wfs/outputformats.html and https://docs.geoserver.org/2.22.x/en/user/services/wms/global.html#wms-global-variables |
Beta Was this translation helpful? Give feedback.
-
Alternatively, you can install the GeoServer Docker container that Tethys provides using the
Note: this is an older version of GeoServer (2.8). |
Beta Was this translation helpful? Give feedback.
-
@swainn Thanks for your help. After checking your answers and the These are what I did:
class StateTempMap(MapLayout):
...
show_properties_popup = True,
geoserver_workspace = 'topp' |
Beta Was this translation helpful? Give feedback.
@swainn Thanks for your help. After checking your answers and the
tethys-layout_showcase
app, I finally fixed the issue.These are what I did:
Change endpoint to
https://tethys2.byu.edu/geoserver/wms
orhttp://localhost:8181/geoserver/wms
(usingtethys docker
)Add a variable
geoserver_workspace = 'topp'
to MapLayout