7 Replies Latest reply: Feb 20, 2012 2:15 AM by d_wilhelm RSS

    Theme looking different before and after previewing an advanced style

    d_wilhelm
      Hello,

      i have a problem with a theme looking different before and after previewing an advanced style in mapbuilder Ver11_1_1_5_B110527

      My style xml looks like this:
      <?xml version="1.0" ?>
      <AdvancedStyle>
          <CollectionStyle>
            <style name="color_style" shape="polygon"/>
            <style name="line_style"/>
        </CollectionStyle>
      </AdvancedStyle>
      It is a combination of a color style and a line style styles:
      <?xml version="1.0" standalone="yes"?>
      <svg width="1in" height="1in">
          <desc/>
          <g class="color" style="fill:#B6D1CA">
              <rect width="50" height="50"/>
        </g>
      </svg>
      <?xml version="1.0" standalone="yes"?>
      <svg width="1in" height="1in">
        <desc/>
        <g class="line" style="fill:#969696;stroke-width:2;stroke-linecap:BUTT">
          <line class="base"/>
        </g>
      </svg>
      The styles and theme are created using insert statements, and not the mapbuilder.


      When i take a look at the theme preview in mapbuilder, it will look like this: http://dl.dropbox.com/u/22117905/before_preview.PNG

      Now i open up the advanced style and hit the preview button.

      If i take another look at the theme preview, it will now look like this (and this is the desired output btw.): http://dl.dropbox.com/u/22117905/after_preview.PNG

      Now my question is, why does the same theme look different, after previewing the advanced style?

      I tried clearing the cached geometries and metadata cache of mapviewer, but that didn't help.

      Apart from previewing every style, what can i do to make sure that the themes are styled correctly?


      Thanks for help in advance,
      Dirk
        • 1. Re: Theme looking different before and after previewing an advanced style
          jpaiva
          Hi Dirk,
          in MapBuilder when your preview the style, this becomes the current style representation in memory cache. Then if you preview a theme that refers to this style, it will be rendered with the current style there. If for some reason you close the style editor and do not save the changes, then your next theme preview will use the original style representation.
          For MapViewer to see your metadata changes in MapBuilder, first you need to save the style in MapBuilder, and then you need to clear the metadata in MapViewer.

          Joao
          • 2. Re: Theme looking different before and after previewing an advanced style
            d_wilhelm
            Hello Joao,

            thanks for your answer.

            I now tried the following:

            1. I deleted all styles and themes using sql developer.
            2. I recreated the styles and themes using my procedures and functions
            3. cleared metadatacache and tiles in mapviewer
            4. startet MapBuilder
            5. Previewed Theme -> still the wrong styling, also in mapviewer
            6. Previewed Style
            7. Previewed theme again -> now the styling is correct

            The problem is, with several hundreds of styles and themes, it is not practicable to open every stysle and preview it to make sure the themes are displayed correct.

            Is there a way to do this using pl/sql?

            Thanks in advance,
            Dirk
            • 3. Re: Theme looking different before and after previewing an advanced style
              jpaiva
              Dirk,
              MapBuilder and MapViewer are two different applications tha run independently. MapBuilder handles the metadata for MapViewer, and if you make changes there (saving the changes), then in MapViewer server you should refresh your metadata or restart the server to see the differences.

              What you are saying in step 5 does not make much sense to happen ('be wrong"). Most likely is the theme definition that may be pointing to a wrong style, or the style has a definition that is not what you expect.

              Joao
              • 4. Re: Theme looking different before and after previewing an advanced style
                d_wilhelm
                Hello Joao,

                but that is what happens. I create a video to show it, please take a look:

                http://dl.dropbox.com/u/22117905/mapbuilder.htm

                Regards,
                Dirk
                • 5. Re: Theme looking different before and after previewing an advanced style
                  jpaiva
                  Hi Dirk,
                  thanks for the detailed video. Initially I was thinking you have done changes in the style before previewing it, but that was not the case. It may be something wrong with the loading of the Collection style at the first time. I will try to reproduce your error in MapBuilder building a metadata similar to yours.

                  Best regards.

                  Joao
                  • 6. Re: Theme looking different before and after previewing an advanced style
                    jpaiva
                    Dirk,
                    I simulated your case with the version that you mentioned to be using and was unable to reproduce the error. I used the MVDEMO dataset (STATES table) and created a collection style with a color and line style like yours. Your color and style definitions above are truncated (the style="" section is empty). Send them by email to me: joao dot paiva at oracle dot com, and I will repeat my tests with your styles.
                    You can also try the test that I did, by loading the MVDEMO dataset and modifying the style to your collection style on theme related to STATES table.

                    Regards.

                    Joao
                    • 7. Re: Theme looking different before and after previewing an advanced style
                      d_wilhelm
                      Hello Joao,

                      i just found the error. It is in my pl/sql package where i create the styles.

                      Mapbuilder showed the staly as in my first post, but that i created looks like this
                      <?xml version="1.0" ?>
                      <AdvancedStyle>
                          <CollectionStyle>
                            <style name="color_style" shape="polygon"/>
                            <style name="line_style" shape="all"/>
                        </CollectionStyle>
                      </AdvancedStyle>
                      Notice the "shape=all" attribute in line_style. Apperently Mapbuilder doesn't like it, if i set this in the style. After previewing or saving the style in mapbuilder, the sttribute is removed and the style is correct.

                      I now edited my package and rerun it, and now the themes are displayed correctly.

                      Regards,
                      Dirk