Skip to content

Commit

Permalink
Enable MVT default format for WMS (retired reference to GD). Removed …
Browse files Browse the repository at this point in the history
…msMVTSetup(), not necessary for WMS of mode=tile operation.
  • Loading branch information
sdlime committed Feb 10, 2017
1 parent 47c55e0 commit c4da16b
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 24 deletions.
19 changes: 0 additions & 19 deletions mapmvt.c
Expand Up @@ -312,20 +312,6 @@ static void freeMvtTile( VectorTile__Tile *mvt_tile ) {
free(mvt_tile->layers);
}

int msMVTSetup( mapObj *map )
{
/* Ensure all the LAYERs have a projection. */
if( msMapSetLayerProjections(map) != 0 ) return(MS_FAILURE);

/* Set output projection to spherical Mercator. */
if( msLoadProjectionString(&(map->projection), SPHEREMERC_PROJ4) != 0 ) {
msSetError(MS_MISCERR, "Unable to load projection string.", "msMVTSetup()");
return MS_FAILURE;
}

return MS_SUCCESS;
}

int msMVTWriteTile( mapObj *map, int sendheaders ) {
int iLayer,retcode=MS_SUCCESS;
unsigned len;
Expand Down Expand Up @@ -505,11 +491,6 @@ int msPopulateRendererVTableMVT(rendererVTableObj * renderer) {
return MS_FAILURE;
}

int msMVTSetup( mapObj *map ) {
msSetError(MS_MISCERR, "Vector Tile support is not available.", "msMVTSetup()");
return MS_FAILURE;
}

int msMVTWriteTile( mapObj *map, int sendheaders ) {
msSetError(MS_MISCERR, "Vector Tile support is not available.", "msMVTWriteTile()");
return MS_FAILURE;
Expand Down
1 change: 0 additions & 1 deletion mapserver.h
Expand Up @@ -3023,7 +3023,6 @@ void msPopulateTextSymbolForLabelAndString(textSymbolObj *ts, labelObj *l, char
MS_DLL_EXPORT int msPopulateRendererVTableOGR( rendererVTableObj *renderer );
MS_DLL_EXPORT int msPopulateRendererVTableMVT( rendererVTableObj *renderer );

MS_DLL_EXPORT int msMVTSetup( mapObj *map );
MS_DLL_EXPORT int msMVTWriteTile( mapObj *map, int sendheaders );

#ifdef USE_CAIRO
Expand Down
1 change: 0 additions & 1 deletion mapservutil.c
Expand Up @@ -1515,7 +1515,6 @@ int msCGIDispatchImageRequest(mapservObj *mapserv)
msTileSetExtent(mapserv);

if(!strcmp(MS_IMAGE_MIME_TYPE(mapserv->map->outputformat), "application/x-protobuf")) {
// if((status = msMVTSetup(mapserv->map)) != MS_SUCCESS) return MS_FAILURE;
if((status = msMVTWriteTile(mapserv->map, mapserv->sendheaders)) != MS_SUCCESS) return MS_FAILURE;
return MS_SUCCESS;
}
Expand Down
4 changes: 1 addition & 3 deletions mapwms.c
Expand Up @@ -1081,7 +1081,7 @@ int msWMSLoadGetMapParams(mapObj *map, int nVersion,
} else {
format = msSelectOutputFormat( map, values[i] );
if( format == NULL ||
(strncasecmp(format->driver, "GD/", 3) != 0 &&
(strncasecmp(format->driver, "MVT", 3) != 0 &&
strncasecmp(format->driver, "GDAL/", 5) != 0 &&
strncasecmp(format->driver, "AGG/", 4) != 0 &&
strncasecmp(format->driver, "UTFGRID", 7) != 0 &&
Expand Down Expand Up @@ -3673,8 +3673,6 @@ int msWMSGetMap(mapObj *map, int nVersion, char **names, char **values, int nume
/* intercept requests for Mapbox vector tiles */
if(!strcmp(MS_IMAGE_MIME_TYPE(map->outputformat), "application/x-protobuf")) {
int status=0;

if((status = msMVTSetup(map)) != MS_SUCCESS) return MS_FAILURE;
if((status = msMVTWriteTile(map, MS_TRUE)) != MS_SUCCESS) return MS_FAILURE;
return MS_SUCCESS;
}
Expand Down

0 comments on commit c4da16b

Please sign in to comment.