Ignore:
Timestamp:
2010-06-27T21:30:20+02:00 (14 years ago)
Author:
pieren
Message:

improve new feature addr

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/Address.java

    r22041 r22042  
    119119        MapView mv = Main.map.mapView;
    120120        Point mousePos = e.getPoint();
    121 //        Node mouseOnExistingNode = null;
    122121        List<Way> mouseOnExistingWays = new ArrayList<Way>();
    123122        mouseOnExistingWays = new ArrayList<Way>();
    124 //        mouseOnExistingNode = Main.map.mapView.getNearestNode(mousePos, OsmPrimitive.isSelectablePredicate);
    125123        Node currentMouseNode = mv.getNearestNode(mousePos, OsmPrimitive.isSelectablePredicate);
    126124        if(currentMouseNode != null) {
     
    164162            }
    165163            if (mouseOnExistingWays.size() == 1) {
     164                // clicked on existing highway => set new street name
    166165                inputStreet.setText(mouseOnExistingWays.get(0).get(tagHighwayName));
     166            } else if (mouseOnExistingWays.size() == 0) {
     167                // clicked a non highway and not a node => add the new address
     168                Node n = Main.map.mapView.getNearestNode(mousePos, OsmPrimitive.isSelectablePredicate);
     169                if (n != null)
     170                    if (!n.hasKey(tagHouseNumber))
     171                        addAddrToNode(n);
     172                else
     173                    createNewNode(mousePos);
    167174            }
    168175        }
    169176
     177    }
     178   
     179    private void addAddrToNode(Node n) {
     180        // node exists : just add the tag addr:housenumber and member in relation
     181    }
     182   
     183    private void createNewNode(Point mousePos) {
     184       
    170185    }
    171186
Note: See TracChangeset for help on using the changeset viewer.