Announcement

Collapse
No announcement yet.

New OSM Buildings layer and how to deploy it

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • #31
    Hello all
    Thanks Jan for your explanations and conditions of use.
    I have been playing with your layer sbodmer and added a "setOpacity()" as I have it on all layers, connected to a slider 0-100, see in my Media/OSMBuildings:
    It is quite appealing as we can see-through the buildings and also flat object can show their roof details... Tell me what you think of it (I confess my javaFX goodies are still a bit jerky)
    FWIW, here is the code I added to your renderable :
    Code:
    public void setOpacity(double opacity) {
            for (Renderable renderable : renderables) {
                if (renderable instanceof Polygon) {
                    Polygon polygon = (Polygon) renderable;
                    polygon.getAttributes().setInteriorOpacity(opacity);
                    polygon.getAttributes().setOutlineOpacity(opacity);
                } else if (renderable instanceof ExtrudedPolygon) {
                    ExtrudedPolygon polygon = (ExtrudedPolygon) renderable;
                    polygon.getAttributes().setInteriorOpacity(opacity);
                    polygon.getAttributes().setOutlineOpacity(opacity);
                    polygon.getSideAttributes().setInteriorOpacity(opacity);
                    polygon.getSideAttributes().setOutlineOpacity(opacity);
                } else {
                    System.out.println("setOpacity not handled on :" + renderable);
                }
            }
        }
    Cheers

    Comment


    • #32
      Hi frenchy,

      I'm doing some project refactoring at the moment (I'm working on my version of WorldWindEarth)...
      The new approach will expose visual settings of each layer in a JPanel (opacity will certainly be one of them )
      The OSMBuldings layer will become a "plugin" of my visual framework, but the layer itself will be independant.

      frenchy, can you tell me how you integrate my OSMBuilding layer in you project ?
      Do you copy the class, do you use dynamic class loading ?
      If my layer is deployed as a .jar, can you still use it in an easy way ?

      Comment


      • #33
        Hi sbodmer,
        I did it very simply by adding your xml to the worldwind.layers.xml config file (and the .java files in the appropriate directories). There may be other ways to add a special xml config layers file, WW has been designed to be open. If your layer is in a special jar, it will become a plugin, that's another approach.

        Comment


        • #34
          frenchy You're right, opacity is fun

          Comment


          • #35
            Nice! A pity for London eye which is a big square wall but westwinster is just ok.

            Comment


            • #36
              frenchy Jan sent me an api key, I pushed the modification on my WW fork, please use the new key for now.

              Comment

              Working...
              X