OpenLayers OpenLayers

Ticket #1622 (closed feature: fixed)

Opened 2 years ago

Last modified 1 year ago

Mapguide Layer http served tile support

Reported by: openlayers Assigned to: crschmidt
Priority: critical Milestone: 2.8 Release
Component: Layer.MapGuide Version: SVN
Keywords: Cc: zspitzer
State: Complete

Description

It is possible to bypass the mapguide server mapagent and expose the tile cache via a webserver.

The attached patch adds a boolean option to the Mapguide Layer support, called useHttpTile.

When set, rather than generating a mapguide mapagent url, it will generate the image path for the tile. The layer url needs to be set to the webserver directory containing the map's tile cache.

There are further notes on the mapguide wiki

http://trac.osgeo.org/mapguide/wiki/CodeSamples/Tiles/ServingTilesViaHttp

Attachments

mapguideHttpTile.patch (5.4 kB) - added by openlayers on 07/21/08 03:33:14.
mapguide_http_tile_v3.patch (5.5 kB) - added by openlayers on 03/01/09 21:23:39.
moved folder params into a seperate param section so they don't get passed unnecssarily to the mapagent
mapguide_http_tile_v3-r1.patch (5.5 kB) - added by ksgeograf on 03/02/09 01:42:38.
Fixed minor issues, see comment
mapguide_http_tile_v3-r2.patch (5.6 kB) - added by ksgeograf on 03/02/09 01:58:03.
Added query string parameter, see comment
MG_http_tile_v3-r3.patch (7.8 kB) - added by madair on 03/06/09 10:04:15.

Change History

07/21/08 03:33:14 changed by openlayers

  • attachment mapguideHttpTile.patch added.

07/22/08 08:33:27 changed by openlayers

  • state set to Review.

07/28/08 14:09:26 changed by euzuro

  • owner set to crschmidt.

07/28/08 14:10:32 changed by euzuro

  • milestone changed from 2.7 Release to 2.8 Release.

07/28/08 14:18:14 changed by euzuro

  • priority changed from minor to critical.

02/21/09 06:38:50 changed by crschmidt

zspitzer/madair/others: Please demonstrate in some way that this support if working for you -- for example, by presenting a link to it in action. If someone othr than the author can review the code, that would be good too.

I notice that getFullRequestString's docs went away as a result of this; can we bring those back, too?

02/21/09 22:16:58 changed by openlayers

i post a new patch soon, there is an issue with some of the additional parameters being added to the mapguide server urls which i will address first

here's a demo of the functionality http://ennoble.dreamhosters.com/maps/tm-kl/

zac

03/01/09 21:23:39 changed by openlayers

  • attachment mapguide_http_tile_v3.patch added.

moved folder params into a seperate param section so they don't get passed unnecssarily to the mapagent

03/02/09 01:42:38 changed by ksgeograf

  • attachment mapguide_http_tile_v3-r1.patch added.

Fixed minor issues, see comment

03/02/09 01:57:32 changed by ksgeograf

I have updated the patch to adress two minor issues. the 0 that is being prefixed to the tilecol/rowcol is a string, not a number. It works in the previous edition, due to automatic string conversion, but it's a bit confusing to see a statement like: "a += 0;"

The other issue is with a negative index, since the "-" sign is extracted, the numbers must be absolute, otherwise the string "-01" will be "-0-1".

03/02/09 01:58:03 changed by ksgeograf

  • attachment mapguide_http_tile_v3-r2.patch added.

Added query string parameter, see comment

03/02/09 01:58:24 changed by ksgeograf

The patch works, but only if the tilecache is fully seeded. To support on-the-fly generation, the querystring should also include the name of the mapdefiniton. Unfortunately, the mapdefinition parameter may not be present on the layer. I propose to add a "querystring" parameter to the folder options, so the user can add any information needed to support on-the-fly generation of tiles. The updated patch is in r2.

03/02/09 02:24:00 changed by openlayers

The querystring is a nice option, it will still require a 404 handler serverside either a .htaccess or ErrorDocument in apache land.

there is more information here http://trac.osgeo.org/mapguide/wiki/CodeSamples/Tiles/ServingTilesViaHttp

the really nice advantage is that the static tiles can have cache headers added as well, which mapguide currently ommits

03/02/09 03:00:15 changed by ksgeograf

Yes, on-the-fly generation will require server side configuration. I have made the variable optional, for those without such a configuration, and I chose a queryString, because various server handlers will require various parameters.

Mine includes the mapDefinition and a background color (and is for IIS).

03/06/09 10:04:15 changed by madair

  • attachment MG_http_tile_v3-r3.patch added.

03/06/09 10:11:12 changed by madair

the r3 patch is functionally the same as r2 with these changes: - add curly brackets around if statements - initialize layer.params with FOLDER_PARAMS, otherwise setting querystring as a param doesn't get passed along to the URL - remove unused code block in getImageFilePath

Also added an example of using the tile cache to the MG example, however I'm not sure if the Autodesk demo server exposes a static tile cache, if they do we can update the cacheUrl to point to that instead. Currently this is commented out since it is pointing to localhost, but shows how to configure the layer.

Tested this implementation with my localhost MapGuide instance and it works well, the speed gains are impressive.

03/11/09 01:15:30 changed by crschmidt

  • status changed from new to closed.
  • state changed from Review to Complete.
  • resolution set to fixed.

(In [9004]) Add Mapguide Layer http served tile support. Patch from madair, positive comments on usage from community members, r=me. (Closes #1622)