share
Geographic Information SystemsGeoServer layer property inaccessible from OpenLayers
[+1] [1] vagvaf
[2020-07-29 15:32:22]
[ geoserver openlayers ]
[ https://gis.stackexchange.com/questions/369070/geoserver-layer-property-inaccessible-from-openlayers ]

I have a PostGIS table linked to GeoServer and eventualy with OpenLayers in a web map app.

Recently, I have created and populated a new column in the table (called atgid) but it seems that I am unable to get the respective feature value in OpenLayers via feature.get() function.

In GeoServer:

I can see the new property/column (atgid) being listed under Feature Type Details in GeoServer and when I use the layer preview functionality, I see the different values when I click on a specific feature.

In OpenLayers:

However, when I load the layer as VectorTile in OpenLayers and get its features properties (feature.getProperties()) my newly created property (atgid) is not even listed, let alone accessed.

Any ideas as to what may be causing this?

I have restarted my browser and even my PC to avoid cache related issues.

[+2] [2020-07-29 15:40:32] Ian Turton [ACCEPTED]

Your web browser has cached your vector tiles because they are big and it is slow to download them so your new features won't show up until such time as your cached copy is cleared or expires.


HI thanks for that, I was suspecting something similar, but even after a pc restart I am not getting the new property? - vagvaf
(2) Even a restart is not guaranteed to clear the cache. Try using a different browser, or use a tileUrlFunction in you code to break the cache by adding a dummy timestamp parameter to the url string. - Mike
(2) or use "incognito" mode to avoid caching - Ian Turton
(1) Solved! Thanks guys! Incognito mode worked - vagvaf
1