Re: [Geoserver-users] WMS Layers not identifying

2018-05-23 Thread timita
Hi Amelia,

Arguably this would be a question for the OpenLayers user group. From your
description, it looks like GeoServer works almost without problems (at most
it might have an issue related to the charset meta tag, similar to this:
https://github.com/webpack/webpack-dev-server/issues/1)

You might want to research this further and fill a bug / sponsor a fix if
your investigation reveals that it's something related to GeoServer.

However, a quick hint: if you want to get data via getGetFeatureInfo, you
are way better off requesting it in a format that you can actually process
in JavaScript, rather than text/html. With that you won't get this kind of
error.

Here's a good example of how to request the data as JSON, which is a much
better format for what you need: https://gis.stackexchange.com/a/133278

Best,
Manuel



--
Sent from: http://osgeo-org.1560.x6.nabble.com/GeoServer-User-f3786390.html

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users


[Geoserver-users] WMS Layers not identifying

2018-05-17 Thread Nauwanga Nauwanga
Hello there,

I loaded my WMS layers that I have created in Geoserver in Openlayers. I
have 5 layers and only the first one that I have loaded get to Identify.
The rest of the other layers the popup shows up empty.

I did some research and found this code to be the solution

map.on('click', function (evt) {
var url = wms_layer.getSource().getGetFeatureInfoUrl(
evt.coordinate, viewResolution, viewProjection,
{
'INFO_FORMAT': 'text/html',
'QUERY_LAYERS':
'HissarFullData:block_boundary,HissarFullData:habitations,HissarFullData:pwd'
});


I changed the code accordingly but now I am getting an error on this line

'INFO_FORMAT': 'text/html',

It is says in chrome Uncaught Syntax Error Unexpected token:

Mozilla firefox says the character encoding of the Html document is not
declared.

So now I am have been trying to figure out how to declare the encoding in
Openlayers and I cannot seem to get that right. Can someone please advise
if I am heading the right path and refer some codes/tutorials for me to try
and figure out the solution.

Many thanks.

Regards
Amelia
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users