2

I added a Geoserver WMS to OpenLayers, and if I zoom, the layers become pixelated. I've created the layers and SLDs (for symbology) with QGIS. Is the problem with the zoomlevels or elsewhere?

var map = new OpenLayers.Map('terkep_helye', 
   {
     projection: "EPSG:4612", // EPSG:3857 = Spherical Mercator
     maxExtent: new OpenLayers.Bounds(-179.76129999999998,-60.60800000099994,179.8569000000001,59.38540000100005),
   });
 // hozáadunk egy OSM réteget
 map.addLayer(new OpenLayers.Layer.OSM());
  // Google hybrid
 map.addLayer(new OpenLayers.Layer.Google("Google Hybrid",{type: google.maps.MapTypeId.HYBRID, numZoomLevels: 12}));
 // Google satellite
 map.addLayer(new OpenLayers.Layer.Google("Google Satellite",{type: google.maps.MapTypeId.SATELLITE, numZoomLevels: 12}))
 // létrehozunk egy WMS réteget var wms = new OpenLayers.Layer.WMS( "Földrengések",
    'http://localhost:8080/geoserver/ujProjekt/wms',
    {
      layers: ['rengesekk'], 
      isBaseLayer: false,
      transparent: true,
      srs: "EPSG:4612",
      numZoomLevels: 24
    },
    {


      singleTile: true
    });     
var wms2 = new OpenLayers.Layer.WMS( "Szubdukciós vonal",
    'http://localhost:8080/geoserver/ujProjekt/wms',
    {
      layers: ['tvonal'], 
      isBaseLayer: false,
      transparent: true,
      srs: "EPSG:4612",
      numZoomLevels: 12
    }{
      //opacity: 0.5,
      singleTile: true
    });     
    var wms3 = new OpenLayers.Layer.WMS( "Intenzitás",
    'http://localhost:8080/geoserver/ujProjekt/wms',
    {
      layers: ['intenzitas'], 
      isBaseLayer: false,
      transparent: true,
      srs: "EPSG:4612",
      numZoomLevels: 12
    },
    {
      //opacity: 0.5,
      singleTile: true
    });  
    var wms4 = new OpenLayers.Layer.WMS( "Maximális Talajgyorsulás",
    'http://localhost:8080/geoserver/ujProjekt/wms',
    {
      layers: ['maxtalajgyors'], 
      isBaseLayer: false,
      transparent: true,
      srs: "EPSG:4612",
      numZoomLevels: 12
    },
    {
      //opacity: 0.5,
      singleTile: true
    });  
    var wms5 = new OpenLayers.Layer.WMS( "Domborzat",
    'http://localhost:8080/geoserver/ujProjekt/wms',
    {
      layers: ['domborzat'], 
      isBaseLayer: false,
      transparent: true,
      srs: "EPSG:4612",
      numZoomLevels: 12
    },
    {
      //opacity: 0.5,
      singleTile: true
 });  
 // hozzáadjuk a réteget a térképhez
 map.addLayer(wms);
 map.addLayer(wms2);
 map.addLayer(wms3);
 map.addLayer(wms4);
 map.addLayer(wms5);
 // a LayerSwitcher kezelőszerv segítsével kapcsolgathajuk a rétegeket

 // kb. Magyarországra nagyítunk
 map.zoomToMaxExtent();
 map.addControl(new OpenLayers.Control.LayerSwitcher); 
 map.addControl(new OpenLayers.Control.OverviewMap());

 map.addControl(new OpenLayers.Control.Scale());
 map.addControl(new OpenLayers.Control.Navigation());
 map.addControl(new OpenLayers.Control.ScaleLine({
    maxWidth: 200,
    bottomOutUnits: '',
    bottomInUnits: ''
  }));

}

 <head>
  <body onload="init()">
  <h1>OpenLayers - térkép több réteggel</h1>
  <h2>Az alap az OSM (OpenStreetMap), rajta egy Geoserver wms réteg</h2>
  <div style="width:989px; height:330px" id="terkep_helye"></div>
 </body>
</html>
  • Are you creating them from a vector source or a raster source. – John Powell Dec 11 '14 at 14:58
  • from raster source. but maybe the georeference is the problem – GyaNoLi Dec 12 '14 at 10:32
  • Is this supposed to be in Japan? spatialreference.org/ref/epsg/4612 Geoserver, will reproject if it can, but if your source is a raster in degrees and you are reprojecting to 3857 to work with google tiles, you are likely to have a distorted output. – John Powell Dec 12 '14 at 11:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.