I have two maps one is OSM and one is google maps. I want show WMS with projection EPSG:2180 and when I switch layer to wms then features hidden and show border from WMS but wrong. When I set google map(ol3gl) then it's good to time when map crash - I can't zoom. I upload two images(there where is red, there is good) Some code with WMS:
proj4.defs("EPSG:2180","+proj=tmerc +lat_0=0 +lon_0=19 +k=0.9993 +x_0=500000 +y_0=-5300000 +ellps=GRS80 +units=m +no_defs");
var extent = [171700.190996, 140135.919877, 861883.198003, 774942.471876];
var proj=ol.proj.get("EPSG:2180");
proj.setExtent(extent);
var projection = new ol.proj.Projection({
code: 'EPSG:2180',
extent: extent
});
var WMS=new ol.layer.Tile({
extent: extent,
source: new ol.source.TileWMS({
url: 'http://mapserver.bdl.lasy.gov.pl/ArcGIS/services/WMS_BDL/mapserver/WMSServer',
crossOrigin: null,
projection: ol.proj.get('EPSG:2180'),
params: {
'LAYERS': '3',
'FORMAT': 'image/png',
'TRANSPARENT':true,
//'WIDTH':"1070",
//"HEIGHT":"400",
},
serverType: /** @type {ol.source.WMSServerType} */ ('geoserver')
})
});
//manager['main_osm'].setVisible(false);
//manager['main_google'].setVisible(false);
var _view=new ol.View({
center: ol.proj.fromLonLat([0, 0], projection),
zoom: 0,
extent: [171700.190996, 140135.919877, 861883.198003, 774942.471876],
projection: ol.proj.get('EPSG:2180'),
});
manager["wms"]=WMS;
map.setView(_view);
WMS.setOpacity(0.7);
map.addLayer(WMS);