Here is the code which i am using to load vector tiles.I have verified already that VIEWPARMS is going through URL but not getting response as per VIEWPARMS. Results are coming as per default value configured in geoserver.
new VectorTileLayer({declutter: true,renderMode:'image',renderBuffer:0,
style: function(feature, resolution) {
return heatMapStyle(feature);
},
source: new VectorTileSource({
tilePixelRatio: 1, // oversampling when > 1
tileGrid: createXYZ({
maxZoom: 19
}),
format: new MVT({featureClass:Feature}),
tileUrlFunction: function(tileCoord, pixelRatio, projection) {
return 'http://192.168.1.101:8080/geoserver/gwc/service/wmts?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&LAYER=gmap:growthArea&STYLE=' +
'&TILEMATRIX=' + projection.getCode() + ':' + tileCoord[0] +
'&TILEMATRIXSET=' + projection.getCode() +
'&FORMAT=application/x-protobuf;type=mapbox-vector' +
'&TILECOL=' + tileCoord[1] +
'&TILEROW=' + (-(tileCoord[2]+1)) +
'&VIEWPARAMS=table:blockgroups;gid:bgnum;' ;
}
})
});