georchestra / mapstore2-georchestra

geOrchestra newest viewer
Other
6 stars 23 forks source link

GetMap format list in GetCapabilities not respected #301

Open landryb opened 3 years ago

landryb commented 3 years ago

whatever the server says in the getcapabilities, it seems mapstore hardcodes the image format list in several places:

i know (from the doc in https://github.com/geosolutions-it/MapStore2/blob/master/docs/user-guide/catalog.md#advanced-settings-1) that one can configure that per catalog service (well, in the UI one can only remove some formats from the 'default list', but i guess in the .js its configurable more finely), and i guess this hardcoded list comes from the default formats supported by geoserver (which mapstore2 is developed/tested against, other servers being less tested..) but could we at least prune the list from the formats not listed in the servers' GetCapabilities ?

for example mapserver has this:

<GetMap>
<Format>image/png</Format>
<Format>image/jpeg</Format>
<Format>image/png; mode=8bit</Format>
<Format>image/vnd.jpeg-png</Format>
<Format>image/vnd.jpeg-png8</Format>
<Format>application/x-pdf</Format>
<Format>image/svg+xml</Format>
<Format>image/tiff</Format>
<Format>application/vnd.google-earth.kml+xml</Format>
<Format>application/vnd.google-earth.kmz</Format>
<Format>application/x-protobuf</Format>
<Format>application/json</Format>

so in the mapstore UI if one selects image/gif or image/png8 the layer breaks.

landryb commented 3 years ago

@tdipisa this issue is really preventing us from fully using mapstore with our background WMS/WMTS services not coming from geoserver. Is there any luck you can properly get the format list from getcapabilities, for GetMap and GetFeatureInfo (cf #302) ?

poke @catmorales :)

tdipisa commented 3 years ago

@landryb there is this https://github.com/geosolutions-it/MapStore2/issues/6522 MS side already closed in March and working in our MS dev. It is available only in MS master branch because it will be available in the next major release in June. mapstore2-georchestra is using the stable branch of MS where this update is missing. As soon as we release the next major of MS a new stable branch will be available with this update ready to be used also for mapstore2-georchestra

The same is still missing for GetFeatureInfo.

landryb commented 3 years ago

okay, good to know this is being worked on in upstream mapstore2, i'll make sure to test that with all our mapserver/mapproxy services.

landryb commented 1 year ago

@tdipisa fwiw, i've seen that geosolutions-it/Mapstore2#6522 indeed implements that and it's great ! There still a minor annoyance, if the layer is added straight away to the map without looking at source formats in the source advanced properties, one still needs to 'refresh' the getmap format list by clicking on the button at the right of the format list in the layer display properties in the TOC. At that point, getcapabilities was already called once to get layer list so the client code already knows format list and should properly update it.