61 | | For this RFC, we will take the RFC90 implementation of meta-tiling and retro-fit it into the Tile Set Definition infrastructure. |
62 | | |
63 | | Meta-tiling support will be surfaced via new tile set parameters: |
| 65 | For this RFC, we will take the RFC90 implementation of meta-tiling and retro-fit it into the new Tile Set Definition infrastructure. |
| 66 | |
| 67 | Firstly, we will add new {{{RenderTile}}} and {{{RenderTileXYZ}}} primitives that accept a meta-tiling factor: |
| 68 | |
| 69 | {{{ |
| 70 | class MG_MAPGUIDE_API MgRenderingService : public MgService |
| 71 | { |
| 72 | ... |
| 73 | EXTERNAL_API: |
| 74 | ///////////////////////////////////////////////////////////////// |
| 75 | /// \brief |
| 76 | /// Returns the specified base map tile for the given map. |
| 77 | /// |
| 78 | /// \remarks |
| 79 | /// This method only renders the given tile. No tile caching is performed |
| 80 | /// by this method. To render and cache the tile, use the |
| 81 | /// \link MgTileService::GetTile GetTile \endlink method instead. However, |
| 82 | /// using that method will use default tile width/height/dpi/format specified |
| 83 | /// in your MapGuide Server configuration |
| 84 | /// |
| 85 | /// \param map |
| 86 | /// Input |
| 87 | /// map object containing current state of map. |
| 88 | /// \param baseMapLayerGroupName |
| 89 | /// Input |
| 90 | /// Specifies the name of the baseMapLayerGroup for which to render the tile. |
| 91 | /// \param tileColumn |
| 92 | /// Input |
| 93 | /// Specifies the column index of the tile to return. |
| 94 | /// \param tileRow |
| 95 | /// Input |
| 96 | /// Specifies the row index of the tile to return. |
| 97 | /// \param tileWidth |
| 98 | /// Input |
| 99 | /// Specifies the width of the tile to return. |
| 100 | /// \param tileHeight |
| 101 | /// Input |
| 102 | /// Specifies the height of the tile to return. |
| 103 | /// \param tileDpi |
| 104 | /// Input |
| 105 | /// Specifies the dpi the tile to return. |
| 106 | /// \param tileImageFormat |
| 107 | /// Input |
| 108 | /// Specifies the image format of the tile. See \link MgImageFormats \endlink |
| 109 | /// \param tileExtentOffset |
| 110 | /// Specifies the ratio by which the tile to be rendered should be "buffered out". The tile will be rendered at the specified width |
| 111 | /// multiplied by the given ratio, which will be cropped back to the original requested size after rendering. This is to improve |
| 112 | /// label placement on rendered tiles by giving extra "breathing space" to label placement algorithms. |
| 113 | /// \param metaTilingFactor |
| 114 | /// The meta-tiling factor, If less than or equal to 1 no meta-tiling is done. If greater than 1, a tile m times the original requested |
| 115 | /// size is rendered instead (where m is the specified factor) |
| 116 | /// |
| 117 | /// \return |
| 118 | /// A byte reader containing the rendered tile image. If metaTilingFactor is greater than 1, then a raw image frame buffer is returned |
| 119 | /// instead. This raw image frame buffer is not intended to be used by MapGuide applications and is reserved for the rendering infrastructre |
| 120 | /// to sub-divide back into tiles of the original requested size. |
| 121 | /// |
| 122 | /// \since 3.3 |
| 123 | virtual MgByteReader* RenderTile( |
| 124 | MgMap* map, |
| 125 | CREFSTRING baseMapLayerGroupName, |
| 126 | INT32 tileColumn, |
| 127 | INT32 tileRow, |
| 128 | INT32 tileWidth, |
| 129 | INT32 tileHeight, |
| 130 | INT32 tileDpi, |
| 131 | CREFSTRING tileImageFormat, |
| 132 | double tileExtentOffset, |
| 133 | INT32 metaTileFactor) = 0; |
| 134 | |
| 135 | ///////////////////////////////////////////////////////////////// |
| 136 | /// \brief |
| 137 | /// Returns the specified map tile for the given map. Tile structure is |
| 138 | /// based on the XYZ tiling scheme used by Google Maps, OpenStreetMap, and |
| 139 | /// others |
| 140 | /// |
| 141 | /// \param map |
| 142 | /// Input |
| 143 | /// map object containing current state of map. |
| 144 | /// \param baseMapLayerGroupName |
| 145 | /// Input |
| 146 | /// Specifies the name of the baseMapLayerGroup for which to render the tile. |
| 147 | /// \param x |
| 148 | /// Input |
| 149 | /// Specifies the row index of the tile to return. |
| 150 | /// \param y |
| 151 | /// Input |
| 152 | /// Specifies the column index of the tile to return. |
| 153 | /// \param z |
| 154 | /// Input |
| 155 | /// Specifies the zoom level of the tile to return. |
| 156 | /// \param dpi |
| 157 | /// Input |
| 158 | /// Specifies the dpi of the tile to return. |
| 159 | /// \param tileImageFormat |
| 160 | /// Input |
| 161 | /// Specifies the image format of the tile to return. |
| 162 | /// \param tileExtentOffset |
| 163 | /// Specifies the ratio by which the tile to be rendered should be "buffered out". The tile will be rendered at the specified width |
| 164 | /// multiplied by the given ratio, which will be cropped back to the original requested size after rendering. This is to improve |
| 165 | /// label placement on rendered tiles by giving extra "breathing space" to label placement algorithms. |
| 166 | /// \param metaTilingFactor |
| 167 | /// The meta-tiling factor, If less than or equal to 1 no meta-tiling is done. If greater than 1, a tile m times the original requested |
| 168 | /// size is rendered instead (where m is the specified factor) |
| 169 | /// |
| 170 | /// \return |
| 171 | /// A byte reader containing the rendered tile image. If metaTilingFactor is greater than 1, then a raw image frame buffer is returned |
| 172 | /// instead. This raw image frame buffer is not intended to be used by MapGuide applications and is reserved for the rendering infrastructre |
| 173 | /// to sub-divide back into tiles of the original requested size. |
| 174 | /// |
| 175 | /// \since 3.3 |
| 176 | virtual MgByteReader* RenderTileXYZ( |
| 177 | MgMap* map, |
| 178 | CREFSTRING baseMapLayerGroupName, |
| 179 | INT32 x, |
| 180 | INT32 y, |
| 181 | INT32 z, |
| 182 | INT32 dpi, |
| 183 | CREFSTRING tileImageFormat, |
| 184 | double tileExtentOffset, |
| 185 | INT32 metaTilingFactor) = 0; |
| 186 | }; |
| 187 | }}} |
| 188 | |
| 189 | These new overloads are designated {{{EXTERNAL_API}}} because meta-tiles are not intended to be consumed by regular MapGuide applications. They are raw image frame buffers that the rendering infrastructure will use to sub-divide back into tiles of the original requested size. But at the same time, these overloads have to be present in the {{{MgRenderingService}}} contract to allow a server-based tile service to still request meta-tiles through a proxy instance (should a server-based instance not be available) hence the {{{EXTERNAL_API}}} designation. |
| 190 | |
| 191 | Meta-tiling support will be surfaced via new tile set definition parameters: |