| 42 | == API additions to MgTileService == |
| 43 | |
| 44 | To support HTTP cacheability we need to be able to do the following via the MgTileService: |
| 45 | |
| 46 | a) Get timestamp information about a generated tile (to be able to apply expiry dates) |
| 47 | |
| 48 | b) "Peek" at the timestamp for a tile that may or may not be generated (to be able to compare against dates from if-modified-since headers) |
| 49 | |
| 50 | An API addition to MgTileService like the one below should be able to support the above scenarios. |
| 51 | |
| 52 | {{{ |
| 53 | |
| 54 | class MG_MAPGUIDE_API MgTileService : MgService |
| 55 | { |
| 56 | PUBLISHED_API: |
| 57 | /// Returns the timestamp of when the tile for the specified map/group/row/col was generated. Returns NULL if no such tile exists |
| 58 | /// |
| 59 | MgDateTime* GetTileCreationDate(MgMap* map, CREFSTRING baseMapLayerGroupName, INT32 tileColumn, INT32 tileRow); |
| 60 | |
| 61 | /// Returns the timestamp of when the tile for the specified map/group/row/col/scale was generated. Returns NULL if no such tile exists |
| 62 | /// |
| 63 | MgDateTime* GetTileCreationDate(MgResourceIdentifier* mapDefinition, CREFSTRING baseMapLayerGroupName, INT32 tileColumn, INT32 tileRow, INT32 scaleIndex); |
| 64 | |
| 65 | /// Returns the specified base map tile for the given map. If a cached tile |
| 66 | /// image exists it will return it, otherwise the tile is rendered and added |
| 67 | /// to the cache. |
| 68 | MgTile* GetTile(MgMap* map, CREFSTRING baseMapLayerGroupName, INT32 tileColumn, INT32 tileRow); |
| 69 | |
| 70 | /// Returns the specified base map tile for the given map. If a cached tile |
| 71 | /// image exists it will return it, otherwise the tile is rendered and added |
| 72 | /// to the cache. |
| 73 | /// |
| 74 | MgTile* GetTile(MgResourceIdentifier* mapDefinition, CREFSTRING baseMapLayerGroupName, INT32 tileColumn, INT32 tileRow, INT32 scaleIndex); |
| 75 | }; |
| 76 | }}} |
| 77 | |
| 78 | MgTile is defined like so. |
| 79 | |
| 80 | {{{ |
| 81 | class MG_MAPGUIDE_API MgTile : public MgSerializable |
| 82 | { |
| 83 | PUBLISHED_API: |
| 84 | /// Returns the tile image |
| 85 | /// |
| 86 | MgByteReader* GetImage(); |
| 87 | |
| 88 | /// Returns the date this tile was created |
| 89 | /// |
| 90 | MgDateTime* GetCreationDate(); |
| 91 | }; |
| 92 | |
| 93 | }}} |
| 94 | |
| 95 | == MapAgent modifications == |
| 96 | |
| 97 | TBD |
| 98 | |