Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I want to request small WMS tiles instead of a single image for the entire map viewport because I know the request is going through a Tile Service (TileCache). OpenLayers handles this with the WMS layer by setting singleTile=false. JSAPI has the ability to set the maxHeight and maxWidth via the resourceInfo options attribute.

But the JSAPI does something unexpected but very practical when these values are set. Instead of getting multiple images to fill the map it still gets a single image and stretches it to fill the map (see http://jsfiddle.net/LA2aH/ for an example).

What I appears to be missing is an option to get multiple images.

The reason I'm asking about this is I have a TileCache service which is accessible via a WMS service but the requests must have specific BBOX values.

share|improve this question
    
I'm not sure how this works in OL...how does OL know to build a BBOX which corresponds to exactly one tile? Doesn't this require knowing the starting tile like in other tiling schemes? Or perhaps with tilecache the topleft of the extent is always the starting tile? If that is the case then perhaps the solution is to build a custom WMS layer like this WMTS example help.arcgis.com/en/webapi/javascript/arcgis/demos/layers/… –  ca0v Jul 26 '12 at 20:18
    
I think you're on to something here. I haven't tried the WMTS approach yet, but it sounds like the right path based on what you're seeing with normal WMS. I'm not too surprised to see it pulling only one image as that's the norm for non-tiled WMS services. And as for OL, in my opinion the best way to learn how things work is to dig in to the code to see what's going on behind the scenes! –  Ryan Twilley Jul 30 '12 at 14:28
    
I've since learned that OL uses the corner of the extent to determine the TileOrigin if no TileOrigin is explicitly provided. The JSAPI solution is to use help.arcgis.com/en/webapi/javascript/arcgis/help/… and discover the TileCache resolutions and extent via JSON by adding format=json on the query string (see nullege.com/codes/search/TileCache.Services.JSON.JSON) Also, see gis.stackexchange.com/questions/11196/… –  ca0v Jul 30 '12 at 14:39
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.