GeoTools
  1. GeoTools
  2. GEOT-182

MapPane initial rendering is sometime upside down

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major 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.

        Activity

        Hide
        Michael Damberger added a comment -
        in ZoomPane.ListenerProxy.propertyChange there is this Code:

         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.
        Show
        Michael Damberger added a comment - in ZoomPane.ListenerProxy.propertyChange there is this Code:  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.
        Hide
        Andrea Aime added a comment -
        Mass closing all go-1 related issues as the module does not exist anymore
        Show
        Andrea Aime added a comment - Mass closing all go-1 related issues as the module does not exist anymore

          People

          • Assignee:
            Unassigned
            Reporter:
            Martin Desruisseaux
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: