I have a layer (PostGIS table) that I load into JMapFrame. When I zoom to the layers extent I use this:
featureLayer.getBounds();
If I add an object in this layer outside the current exten, it will show when I use "Zoom to layer".
But if I delete the objects on the edge of the layer, I would expect that "Zoom to layer" would zoom in more, but it does not. Not even if I restart my computer and then open the layer in JMapFrame again.
If I make a copy of the geometry and remove the original geometry column in the layer:
query = "ALTER TABLE \"" + layerName +
"\" ADD COLUMN tmp_geom geometry(\"" + geoType + "\", " + crs +");\r\n" +
"UPDATE \"" + layerName + "\" SET tmp_geom = \"" + geocol + "\";\r\n" +
"ALTER TABLE \"" + layerName + "\" DROP COLUMN \"" + geocol + "\";\r\n" +
"ALTER TABLE \"" + layerName + "\" RENAME COLUMN \"tmp_geom\" TO
\"" + geocol + "\";";
and try to open it in JMapFrame it will zoom to the "new" and correct extent. But if I close JMapFrame once more and open it again with the layer we are back with the same "old" and wrong extent!
Is it in the cashe somehow and survives a reboot of the computer? How do I update the extent of the layer?