Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Won't Fix
-
Affects Version/s: 2.1.M0
-
Fix Version/s: None
-
Component/s: unsupported
-
Labels:None
Description
In some occasion, a map rendered with MapPane is initially rendered upside down. A workaround is to invokes the following methods explicitly:
mapPane.setPreferredArea(mapPane.getVisibleArea());
mapPane.reset();
Something similar should be invoked automatically on MapPane initialization. However, user reported that it fails to be in some kind. We need to investigates more what happen.
if (propertyName.equalsIgnoreCase("layers"))
{
final RenderedLayer[] layers = (RenderedLayer[]) event.getOldValue();
if (layers != null && layers.length == 0)
{
reset();
}
return;
}
which calls reset() if there are no layers present.
My problem was there. because reset() is called after the first layer was added, the first layer seems to determine the
coordinate system axes.
Therefire in my case it is better to add the RenderedMapScale at the end,then the upside down display is resovled.
Note: calling Renderer.dispose() which I also had tried, is not a
good idea because it removes the PropertyChangeListener, and reset()
will not be called. Anyway, Renderer.dispose() is not public.