<div dir="ltr">Dear list.<div>First, I made tiled images(png) with gdal2tiles.py.</div><div>For example, python gdal2tiles.py -title "tile" -publishurl <a href="http://192.168.1.134:8089/osgeo/geo/tile/">http://192.168.1.134:8089/osgeo/geo/tile/</a> -nogooglemaps -nokml -v D:\test\raster\image.tif D:\test\raster\tile --config GDAL_CACHEMAX 120</div>
<div>and I moved the image files into Tomcat and tested <a href="http://localhost:8089/osgeo/geo/tile/openlayers.html">http://localhost:8089/osgeo/geo/tile/openlayers.html</a>.</div><div>It runs well.</div><div>Next, I want to add a WMS layer which are being serviced in Geoserver & Postgis.</div>
<div>So, I changed javascript.</div><div><br></div><div><div> function init(){</div><div> OpenLayers.DOTS_PER_INCH = 90.714;</div><div> var bounds = new OpenLayers.Bounds(</div><div> 199628.88671875, 396702.2890625,</div>
<div> 239834.30078125, 431934.58125</div><div> );</div><div> var options = {</div><div> controls: [],</div><div> maxExtent: bounds,</div><div> maxScale: 10,</div>
<div> minScale: 500000, </div><div> maxResolution: "auto",</div><div> projection: "EPSG:4326",</div><div> units: 'm'</div>
<div> };</div><div><br></div><div> map = new OpenLayers.Map('map', options);</div><div> //WMS base layer</div><div> var base_wms = new OpenLayers.Layer.WMS(</div><div> "topp:bml_gadm_as_w - Untiled",</div>
<div> "<a href="http://localhost:8888/geoserver/wms">http://localhost:8888/geoserver/wms</a>",</div><div> {layers: 'topp:bml_gadm_as_w'},</div><div> {singleTile: true, ratio: 1} </div>
<div> ); </div><div> map.addLayer(base_wms);</div><div> </div><div> // OpenLayers 2.5 TMS driver</div><div> var layer = new OpenLayers.Layer.TMS( "TMS", </div>
<div> "<a href="http://192.168.1.134:8089/osgeo/geo/tile/">http://192.168.1.134:8089/osgeo/geo/tile/</a>",</div><div> {layername: '.', serviceVersion: '.', type:'png'} );</div>
<div> map.addLayer(layer);</div><div><br></div><div> //WMS river layer</div><div> var river_wms = new OpenLayers.Layer.WMS(</div><div> "topp:bml_rivr_as_w - Untiled",</div>
<div> "<a href="http://localhost:8888/geoserver/wms">http://localhost:8888/geoserver/wms</a>",</div><div> {</div><div> layers: "topp:bml_rivr_as_w",</div>
<div> transparent: "true", format: "image/png"},</div><div> {singleTile: true, ratio: 1,minScale:"100000"} </div><div> );</div><div> map.addLayer(river_wms);</div>
<div><div> </div><div> map.addControl(new OpenLayers.Control.PanZoomBar());</div><div> map.addControl(new OpenLayers.Control.Navigation());</div><div> map.addControl(new OpenLayers.Control.Scale($('scale')));</div>
<div> map.addControl(new OpenLayers.Control.MousePosition({element: $('location')}));</div><div> map.addControl(new OpenLayers.Control.LayerSwitcher());</div><div> map.zoomToMaxExtent();</div>
</div></div><div><br></div><div>But, the problem is that tiled images do not match WMS layer. The tiled images are aerial photos of the same area.</div><div>I don't understand exactly the projection. is this projection problem?</div>
<div>Could you give some advice.</div><div><br></div><div>Best regards.</div><div>Jeong.</div><div><br></div></div>