0

I'm building a website to visualize layers from services on an OpenLayers Map.

The services come from different geoservers some of them which I don't own.

All services are WMS and don't have WFS.

I don't know what attributes exist on the layers.

I can only make getfeatureinfo request with text/xml or text/html formats

With this in mind, I'm trying to create a method to show the features info on click but different geoservers send me different results is there a way to ask GeoServer for a default template html?

Or use the readFeatures() from OpenLayers to read the XML returned from a getfeatureinfo request?

I can solve this with C# or JavaScript as I'm able to do some server side coding

1 Answer 1

1

The template used for HTML output can only be controlled by the server admin, cannot be passed via the request.

You can however ask for text/xml on all the servers, and then format the result client side in a uniform way.

1
  • Thanks for the reply, unfortunately I'm working with geoservers with different outputs on the text/xml. One gives back a GML and the other one XML, I would prefer to have all as XML as the xml is easier to parse and doesn't bring coordinates which I'm not interested. Is there a way to make the geoserver reply with xml instead of gml? Aug 16, 2018 at 13:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.