0

I've hit a wall trying to create a WMS service out of pre-rendered tiles, hopefully you can help me.

  1. I produced the tiles with gdal2tiles (TMS). The tiles are stored at "/home/x/D/Delete/GDAL_TILES/"

  2. My mapproxy.yaml is:

services:
  demo:
  wms:
    srs: ['EPSG:3857']
    image_formats: ['image/png']

layers:
  - name: my_layer
    title: WMS layer from tiles
    sources: [my_cache]

caches:
  my_cache:
    sources: []
    grids: [GLOBAL_WEBMERCATOR]
    cache:
      type: file
      directory: /home/x/D/Delete/GDAL_TILES/

grids:
    webmercator:
        base: GLOBAL_WEBMERCATOR

  1. The MapProxy Demo page shows:

    MapProxy Demo

  2. But once I click on the png link, the auto-generated OpenLayers map is blank. The JavaScript code is:

<script src="static/OpenLayers.js"></script>
<script type="text/javascript">
    var map;
    function init(){
        OpenLayers.Util.onImageLoadErrorColor = "transparent";

        map = new OpenLayers.Map('map', {
          maxResolution: 156543.033928,
          maxExtent: new OpenLayers.Bounds(-20037508.3428, -20037508.3428, 20037508.3428,
20037508.3428),
          projection: new OpenLayers.Projection("EPSG:3857"),
          numZoomLevels: 22
        });
        var layer = new OpenLayers.Layer.WMS( "WMS my_layer",
            "../service?",
            {layers: "my_layer", format: "image/png", srs:"EPSG:3857",
             exceptions: "application/vnd.ogc.se_inimage", transparent: true},
            {singleTile: true, ratio: 1, isBaseLayer: true} );

        map.addLayer(layer);
        map.zoomToMaxExtent();
    }
</script>
  1. Thank you for your help
  • 1
    Welcome to GIS SE! Please edit your question to include your code as text (rather than as a picture). – Midavalo Jul 17 at 21:13
  • Does the WMS work if you access it in a client like QGIS? – nmtoken Jul 27 at 14:04
  • It doesn't, I use this url: "localhost:8080/service?REQUEST=GetCapabilities", QGIS doesn't raise any error, but again it doesn't show anything either. – Joe_Carto Jul 29 at 21:11

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.