Openlayers does not print layer from geoserver -


i try print geoserver layer on website. application , geoserver instance running on separate tomcats , use different ports.

i have noticed in firefox' network inspector logs appropriate png images downloaded geoserver. noticed http requests such as:

http://localhost:8081/geoserver/wms?service=wms&version=1.3.0&request=getmap&format=image/png&transparent=true&layers=graves:graves&tiled=true&styles=graves&cql_filter=not(id < 0)&width=256&height=256&crs=epsg:2001&bbox=4762.7,-7860.5599999999995,4905.6900000000005,-7717.57 

and when use such link in browser gives me png of elements. application not print of elements.

my code somehow that:

var projection = new ol.proj.projection({     code: 'epsg:2001',     extent: [4762.7, -8003.55, 4950.55, -7717.57],     units: 'm' }); ol.proj.addprojection(projection);  var mapcenter = [4880, -7930];  var mapzoom = 2;  var view = new ol.view({     center: mapcenter,     projection: projection,     zoom: mapzoom });  var wmssource = new ol.source.tilewms({   url: 'http://localhost:8081/geoserver/wms',   params: {'layers': 'graves:graves', 'tiled': true, 'styles': 'graves' },   servertype: 'geoserver',   crossorigin: 'anonymous' });   var map = new ol.map({     layers: [        new ol.layer.tile({           source: wmssource       })     ],     target: 'map',     controls: ol.control.defaults({       attributionoptions: /** @type {olx.control.attributionoptions} */ ({         collapsible: false       })     }),     view: view }); 

of course have div well:

<div id="map" class="map" style="width: 1030px; height: 650px;border: 1px solid #0066cc;margin-bottom: 10px;"></div> 

what may cause of problem? can see no error on firefox javascript console. totally stuck.

best regards

i have solved issue. problem in line within tilewms:

crossorigin: 'anonymous' 

after removing works expected. thank support!


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -