1

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.

1 Answer 1

2

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.

4
  • HI thanks for that, I was suspecting something similar, but even after a pc restart I am not getting the new property?
    – vagvaf
    Commented Jul 29, 2020 at 15:48
  • 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
    Commented Jul 29, 2020 at 16:07
  • 2
    or use "incognito" mode to avoid caching
    – Ian Turton
    Commented Jul 29, 2020 at 16:19
  • 1
    Solved! Thanks guys! Incognito mode worked
    – vagvaf
    Commented Jul 29, 2020 at 16:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.