Permalink
Browse files

plug vector tile driver into template output

  • Loading branch information...
tbonfort committed Sep 11, 2015
1 parent 50482bf commit 0de02306b65b6a8b157abdb1ddf051b333056782
Showing with 17 additions and 40 deletions.
  1. +1 −1 CMakeLists.txt
  2. +4 −39 mapmvt.cpp → mapmvt.c
  3. +2 −0 mapserver.h
  4. +10 −0 maptemplate.c
@@ -265,7 +265,7 @@ mapogcfiltercommon.c maprendering.c mapwcs20.c mapogcsld.c
mapresample.c mapwfs.c mapgdal.c mapogcsos.c mapscale.c mapwfs11.c mapwfs20.c
mapgeomtransform.c mapogroutput.c mapwfslayer.c mapagg.cpp mapkml.cpp
mapgeomutil.cpp mapkmlrenderer.cpp fontcache.c textlayout.c maputfgrid.cpp
mapogr.cpp mapcontour.c mapsmoothing.c mapv8.cpp ${REGEX_SOURCES} kerneldensity.c renderers/mvt/vector_tile.c mapmvt.cpp)
mapogr.cpp mapcontour.c mapsmoothing.c mapv8.cpp ${REGEX_SOURCES} kerneldensity.c renderers/mvt/vector_tile.c mapmvt.c)
set(mapserver_HEADERS
cgiutil.h dejavu-sans-condensed.h dxfcolor.h fontcache.h hittest.h mapagg.h
@@ -33,47 +33,12 @@
#include "vector_tile.pb-c.h"
#endif
int msMVTWriteFromQuery( mapObj *map, outputFormatObj *format, int sendheaders ) {
return MS_SUCCESS;
}
int msPopulateRendererVTableMVT(rendererVTableObj * renderer) {
#ifdef USE_PBF
renderer->compositeRasterBuffer = NULL;
renderer->supports_pixel_buffer = 0;
renderer->use_imagecache = 0;
renderer->supports_clipping = 0;
renderer->supports_svg = 0;
renderer->default_transform_mode = MS_TRANSFORM_SIMPLIFY;
renderer->cleanup = mvtCleanup;
renderer->renderLine = &mvtRenderLine;
renderer->renderPolygon = &mvtRenderPolygon;
renderer->renderPolygonTiled = &mvtRenderPolygon;
renderer->renderLineTiled = &mvtRenderLineTiled;
renderer->renderGlyphs = &mvtRenderGlyphsPath;
renderer->renderVectorSymbol = &mvtRenderVectorSymbol;
renderer->renderPixmapSymbol = &mvtRenderPixmapSymbol;
renderer->renderEllipseSymbol = &mvtRenderEllipseSymbol;
renderer->renderTile = &mvtRenderTile;
renderer->getRasterBufferHandle = NULL;
renderer->getRasterBufferCopy = NULL;
renderer->initializeRasterBuffer = NULL;
renderer->mergeRasterBuffer = NULL;
renderer->loadImageFromFile = NULL;
renderer->createImage = &mvtCreateImage;
renderer->saveImage = &mvtSaveImage;
renderer->startLayer = &mvtStartNewLayer;
renderer->endLayer = &mvtCloseNewLayer;
renderer->freeImage = &mvtFreeImage;
renderer->freeSymbol = &mvtFreeSymbol;
renderer->cleanup = mvtCleanup;
return MS_SUCCESS;
#else
msSetError(MS_MISCERR, "Vector Tile Driver requested but support is not compiled in",
@@ -405,6 +405,7 @@ extern "C" {
#define MS_RENDERER_TEMPLATE(format) ((format)->renderer == MS_RENDER_WITH_TEMPLATE)
#define MS_RENDERER_KML(format) ((format)->renderer == MS_RENDER_WITH_KML)
#define MS_RENDERER_OGR(format) ((format)->renderer == MS_RENDER_WITH_OGR)
#define MS_RENDERER_MVT(format) ((format)->renderer == MS_RENDER_WITH_MVT)
#define MS_RENDERER_PLUGIN(format) ((format)->renderer > MS_RENDER_WITH_PLUGIN)
@@ -3021,6 +3022,7 @@ void msPopulateTextSymbolForLabelAndString(textSymbolObj *ts, labelObj *l, char
MS_DLL_EXPORT int msPopulateRendererVTableKML( rendererVTableObj *renderer );
MS_DLL_EXPORT int msPopulateRendererVTableOGR( rendererVTableObj *renderer );
MS_DLL_EXPORT int msPopulateRendererVTableMVT( rendererVTableObj *renderer );
MS_DLL_EXPORT int msMVTWriteFromQuery( mapObj *map, outputFormatObj *format, int sendheaders );
#ifdef USE_CAIRO
MS_DLL_EXPORT void msCairoCleanup(void);
@@ -255,6 +255,16 @@ int msReturnTemplateQuery(mapservObj *mapserv, char *queryFormat, char **papszBu
if( MS_RENDERER_PLUGIN(outputFormat) ) {
msInitializeRendererVTable(outputFormat);
}
if( MS_RENDERER_MVT(outputFormat) ) {
if( mapserv != NULL )
checkWebScale(mapserv);
status = msMVTWriteFromQuery(map, outputFormat, mapserv->sendheaders);
return status;
}
if( MS_RENDERER_OGR(outputFormat) ) {
if( mapserv != NULL )

0 comments on commit 0de0230

Please sign in to comment.