ckan / ckanext-geoview

CKAN Geospatial ResourceView
MIT License
43 stars 58 forks source link

WMS viewer JS error #41

Closed bunnis closed 8 years ago

bunnis commented 8 years ago

When trying to view a WMS resource, using http://services.arcgisonline.com/arcgis/rest/Demographics/USE_Population_Density/MapServer/WMTS or other public wms

Uncaught TypeError: Cannot read property 'layers' of undefined(anonymous function) @ ol2_preview.js:5198OpenLayers.Request.GET.success @ ol2_preview.js:5043OpenLayers.Util.extend.runCallbacks @ ol2_preview.js:1871request.onreadystatechange @ ol2_preview.js:1867cXMLHttpRequest.dispatchEvent @ ol2_preview.js:1901fReadyStateChange @ ol2_preview.js:1904_object.onreadystatechange @ ol2_preview.js:1887
pduchesne commented 8 years ago

The service you are trying to use is a WMTS (tiling service), not a WMS. The generic OpenLayers viewer you are using does not currently support the WMTS standard.

There's a leaflet-based WMTS plugin (named 'wmts_view') you can try.

bunnis commented 8 years ago

I thought they were the same! The plugin didn't automatically added the view, so I manually added WMS as teh resource type. Ill tried it out, from WMS to WMTS and i got a 409 error, but I guess that is from the server! thank you

bunnis commented 8 years ago

Trying to use a WMS service (http://maps.ipma.pt/mapserv?map=/var/www/maps/forecasts/meteorology/arome_pt_2_10uv.map) produces the same error

pduchesne commented 8 years ago

Right, that's likely the service proxy that dumps the 'map' parameter when proxying the capabilities. FYI, that's specific to mapserver implementations. Will look into fixing that.

drnextgis commented 8 years ago

It looks like duplicate of https://github.com/ckan/ckanext-geoview/issues/32

drnextgis commented 8 years ago

I've made PR https://github.com/ckan/ckanext-geoview/pull/42, please review it.

pduchesne commented 8 years ago

Thank you Denis, will merge, and apologizes for overlooking your fix.

amercader commented 8 years ago

Ups sorry @pduchesne I didn't saw you were meaning to review and merge #42

pduchesne commented 8 years ago

no worry, thank you @amercader .

One comment on this fix : stripping parameters in the js lib was on purpose, in the case where OGC services are registered with URL parameters like service, version, request, ... In that case, not stripping the parameters at all may cause such resources to fail being displayed. I'll look into a "smart" stripping strategy.

drnextgis commented 8 years ago

@bunnis can we close this issue?

bunnis commented 8 years ago

Did this get fixed? I see you guys talk about merging PR but nothing got merged, so this issue's still open, right?

drnextgis commented 8 years ago

No, PR was merged: https://github.com/ckan/ckanext-geoview/commit/1e1121137c656a4f5f75e56276d41fd30de72ee4

bunnis commented 8 years ago

Ok! Thanks for the clarification.

drnextgis commented 8 years ago

@bunnis, are these changes solves your original issue?

bunnis commented 8 years ago

Just Tested and they do work, thank you