LeafletJS and Tilecache

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

LeafletJS and Tilecache

Jakeman, Neil

Re-posting as I attached an image last time which made the message too large:

 

I am having real problems getting this configuration to work.

I am using Leaflet 0.4 to create a WMS layer ;

 

mapserver = new L.TileLayer.WMS('http://mapsrv.cch.kcl.ac.uk/tilecache-2.11/tilecache.cgi',{

                layers: 'postgres_worldmap',

                format: 'image/png',

                version: '1.1.0',

                });          

 

It is serving this layer in tilecache:

 

[postgres_worldmap]

type=WMS

url=/sample_map_script.cgi

extension=png

size=256,256

srs=EPSG:3857

extent_type=loose

transparent=true

maxResolution=156543.0

 

… from this setup in a mapfile:

 

 

MAP

                NAME   "Test"

                MAXSIZE              14096

                IMAGETYPE        AGG

                OUTPUTFORMAT

                                NAME 'AGG'

                                DRIVER AGG/PNG

                                MIMETYPE "image/png"

                                IMAGEMODE RGBA

                                EXTENSION "png"

                END

                SIZE 256 256

                EXTENT -180 -90 180 90

                PROJECTION

                                "init=epsg:3857"

                END

 

                LAYER

                                NAME "postgres_worldmap"

                                METADATA

                                                "wms_title"        "worldmap"

                                                "wms_srs"          "EPSG:4326 EPSG:3857"

                                END

                PROJECTION

                                                "init=epsg:4326"

                                END

                                TYPE POLYGON

                                CONNECTIONTYPE POSTGIS

                                                EXTENT -180 -90 180 90

                                CONNECTION "host=XXX.XXX.XXX.XXX port=5432 dbname=postgres user=postgres password=XXXXXX"

                                DATA "the_geom from tbl_simple_world_border"

                                CLASS

                                                STYLE

                                                                OUTLINECOLOR 255 0 0

                                                                ANTIALIAS TRUE

                                                END

                                END

                END

 

                WEB

                                METADATA

                                                "wms_title"        "WGS84 Server"

                                                "wms_srs"          "EPSG:4326 EPSG:3857"

                                                "wms_onlineresource" "http://mapsrv.cch.kcl.ac.uk/sample_map_script.cgi"

                                                "ows_enable_request"   "*"

                                END

                                IMAGEPATH "/tmp/"

                END

END

 

 

This request:

http://mapsrv.cch.kcl.ac.uk/tilecache-2.11/tilecache.cgi?service=WMS&request=GetMap&version=1.1.0&layers=postgres_worldmap&styles=&format=image/png&transparent=false&height=256&width=256&srs=EPSG:3857&bbox=-27517.33018266345,6591317.82308732,-27211.582069522745,6591623.571200458

 

is failing with…

 

An error occurred: Current x value -27517.330183 is too far from tile corner x -27391.576172

 

I have trawled Google with no luck.

If I add spherical_mercator=true to the config, then I get an error saying the URL is invalid.

 

I have dealt (I think) with other issues regarding resolutions being wrong etc, but am stuck on this.

What I can’t understand is why the corner should matter – I thought the tile I needed would be generated and ‘positioned’ appropriately with its corner outside of my map window if necessary as happens with other tms layers. Of course the tilecache is being used as a WMS in this instance.

I haven’t tried this with OpenLayers so maybe the Leaflet library is the issue?

 

i.e. – the map bounds, although in the url request, would still return the tile required even though its ll corner is outside of the bounds

 

I’m obviously misunderstanding something fundamental here, and any help would be gratefully received.

 

Neil


_______________________________________________
Tilecache mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/tilecache