iag-geo/bootleaf

Problem with identify geoserver wms and query

Closed this issue · 12 comments

Hello, first I would like to congratulate for this project.
I am preparing a map in which I load several wms services generated with geoserver and that now I would be able to ask for information and make queries about them.
However, in both cases I am having problems and I do not know how to solve them.
imagen
imagen

On the other hand, how can the repetition of the labeling be solved. I have been testing with the meta tile option but without success.

Thanks in advance

slead commented

Sometimes WMS sites need a reverse-proxy in order to avoid cross-origin issues. This isn't my area of expertise, but I put some information at https://github.com/iag-geo/bootleaf/blob/master/reverseProxy.md with things to try which worked for me.

If that doesn't help, can you please attach a copy of your config.js file?

Hi again Stephen.
I have managed, using nginx, to operate the identification tool on wms, in any of the available navigator. What I can not make it work is the query tools. The layer and fields are showing in the tool but when I run the query get this error:

image

I leave the definition of the layer in the configuration file.

	{
		"id": "TTMM",
		"name": "Terminos Municipales",
		"type": "wmsTiledLayer",
		"url": "http://pruebasvisor.tcasa.es/geoserver/Cordoba/wms?",
		"layers": "TTMM",
  		"visible": true,
  		"format": 'image/png',
  		"transparent": true,
		"maxZoom": 12,
		"useCors": true,
		"identify": {
		"layerName": "TTMM",
		"buffer": 10,
		"outFields": [
				{"name": "NOMBRE", "alias": "NOMBRE"},
				{"name": "LINK", "alias": "ENLACE"}
			]
		},
	    "maxAllowableOffset": 0.01,
		"queryWidget": {
			"queries" : [
				{"name": "NOMBRE", "alias": "NOMBRE", "defaultOperator": "contains"}
			],
			"outFields": [
				{"name": "NOMBRE", "alias": "NOMBRE"}
			]
		}
	}

King regards

I've run into a similar issue for geoserver when using hosted layers that have an EPSG other than 4326. After some investigation, I was able to fix this while using the 'Within current map extent' filter by doing the following:

In app.js->runQueryWidget()->near // Search within the map extent or a polygon change:

queryData.CQL_FILTER += "and BBOX(" + geomField + "," + bounds._southWest.lng + "," + bounds._southWest.lat + "," + bounds._northEast.lng + "," + bounds._northEast.lat + ")"

to

queryData.CQL_FILTER += "and BBOX(" + geomField + "," + bounds._southWest.lng + "," + bounds._southWest.lat + "," + bounds._northEast.lng + "," + bounds._northEast.lat + " ,'EPSG:4326')"

The 'Within polygon' filter is less straight forward. It would appear, from my research that it cannot be done with a CQL_FILTER through geoserver. An OGC filter may work in this case.

References:

https://gis.stackexchange.com/questions/102994/wfs-request-with-cql-filter-projection
http://osgeo-org.1560.x6.nabble.com/How-to-tell-SRID-in-CQL-FILTER-td5289150.html

Hi, i modify app.js to show field value of layer as link and it works fine.

imagen

Now, I have another problem, in this case when I try to see de map in a mobile. I can´t see all the tools, for example, the identify or query tools.
imagen

slead commented

@FJRicca I'm glad you solved the identify and query problems.

With regards to some windows not appearing on mobile, this is by design - the idea being that there isn't enough room for those functions, so they're not available.

You can see this in the index.html file if you search for hidden-sm and hidden-xs. These are Bootstrap options for hiding elements on small or extra-small devices.

You could try removing those classes if you want the elements to be visible on mobile, but you'll probably have to refactor them to make them fit nicely.

Hi, i modify app.js to show field value of layer as link and it works fine.

imagen

Now, I have another problem, in this case when I try to see de map in a mobile. I can´t see all the tools, for example, the identify or query tools.
imagen

Can you share how to show field value of layer as link??

Hi, i modify app.js to show field value of layer as link and it works fine.

imagen

Now, I have another problem, in this case when I try to see de map in a mobile. I can´t see all the tools, for example, the identify or query tools.
imagen

Can you show me how to show field value of layer as link, I have 1 field is image and I want to show it in info window?

I have a similar problem.. I tried to use query widget for geojson layers. Getting the options in query tool, but after clicking "run query", it shows the error "Unable to find URL to query this layer". Can anyone suggest a solution for this issue?

I have a similar problem.. I tried to use query widget for geojson layers. Getting the options in query tool, but after clicking "run query", it shows the error "Unable to find URL to query this layer". Can anyone suggest a solution for this issue?

hello can you solve this problem.
If you have any, would you share it with me.
Thanks in advance forever.