Fix image_view usage in metatiling

The previous code ended up with the complete metatile being
included in every tile.
This commit is contained in:
Jon Burgess
2015-05-25 18:15:01 +01:00
parent 13a7c55688
commit bd463dc85d

View File

@ -40,7 +40,7 @@
#define image_data_32 image_rgba8
#define image_32 image_rgba8
#include <mapnik/image.hpp>
#include <mapnik/image_view.hpp>
#include <mapnik/image_view_any.hpp>
#else
#include <mapnik/graphics.hpp>
#if MAPNIK_VERSION < 200000
@ -269,12 +269,12 @@ static enum protoCmd render(struct xmlmapconfig * map, int x, int y, int z, char
for (yy = 0; yy < render_size_ty; yy++) {
for (xx = 0; xx < render_size_tx; xx++) {
#if MAPNIK_VERSION >= 300000
mapnik::image_view<mapnik::image<mapnik::rgba8_t>> vw(xx * map->tilesize, yy * map->tilesize, map->tilesize, map->tilesize, buf);
tiles.set(xx, yy, save_to_string(vw.data(), "png256"));
mapnik::image_view<mapnik::image<mapnik::rgba8_t>> vw1(xx * map->tilesize, yy * map->tilesize, map->tilesize, map->tilesize, buf);
struct mapnik::image_view_any vw(vw1);
#else
mapnik::image_view<mapnik::image_data_32> vw(xx * map->tilesize, yy * map->tilesize, map->tilesize, map->tilesize, buf.data());
tiles.set(xx, yy, save_to_string(vw, "png256"));
#endif
tiles.set(xx, yy, save_to_string(vw, "png256"));
}
}
return cmdDone; // OK