forked from MapComplete/MapComplete
		
	Improve docs, formatting
This commit is contained in:
		
							parent
							
								
									92c63560ef
								
							
						
					
					
						commit
						9c6822a1ac
					
				
					 2 changed files with 19 additions and 18 deletions
				
			
		| 
						 | 
					@ -249,9 +249,10 @@ export default class ReplaceGeometryAction extends OsmChangeAction {
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * For 'this.feature`, gets a corresponding closest node that alreay exsists
 | 
					     * For 'this.feature`, gets a corresponding closest node that alreay exsists.
 | 
				
			||||||
     * @constructor
 | 
					     * 
 | 
				
			||||||
     * @private
 | 
					     * This method contains the main logic for this module, as it decides which node gets moved where.
 | 
				
			||||||
 | 
					     * 
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    private async GetClosestIds(): Promise<{
 | 
					    private async GetClosestIds(): Promise<{
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -309,7 +309,7 @@ export class ConflateButton extends AbstractImportButton {
 | 
				
			||||||
                     tagSource: UIEventSource<any>, guiState: DefaultGuiState, feature: any, onCancelClicked: () => void): BaseUIElement {
 | 
					                     tagSource: UIEventSource<any>, guiState: DefaultGuiState, feature: any, onCancelClicked: () => void): BaseUIElement {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return new FixedUiElement("ReplaceGeometry is currently very broken - use mapcomplete.osm.be for now").SetClass("alert")
 | 
					        return new FixedUiElement("ReplaceGeometry is currently very broken - use mapcomplete.osm.be for now").SetClass("alert")
 | 
				
			||||||
        
 | 
					
 | 
				
			||||||
        const nodesMustMatch = args.snap_onto_layers?.split(";")?.map((tag, i) => TagUtils.Tag(tag, "TagsSpec for import button " + i))
 | 
					        const nodesMustMatch = args.snap_onto_layers?.split(";")?.map((tag, i) => TagUtils.Tag(tag, "TagsSpec for import button " + i))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        const mergeConfigs = []
 | 
					        const mergeConfigs = []
 | 
				
			||||||
| 
						 | 
					@ -365,19 +365,19 @@ export class ImportWayButton extends AbstractImportButton {
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    name: "move_osm_point_if",
 | 
					                    name: "move_osm_point_if",
 | 
				
			||||||
                    doc: "Moves the OSM-point to the newly imported point if these conditions are met",
 | 
					                    doc: "Moves the OSM-point to the newly imported point if these conditions are met",
 | 
				
			||||||
                },{
 | 
					                }, {
 | 
				
			||||||
                    name:"max_move_distance",
 | 
					                name: "max_move_distance",
 | 
				
			||||||
                doc: "If an OSM-point is moved, the maximum amount of meters it is moved. Capped on 20m",
 | 
					                doc: "If an OSM-point is moved, the maximum amount of meters it is moved. Capped on 20m",
 | 
				
			||||||
                defaultValue: "1"
 | 
					                defaultValue: "1"
 | 
				
			||||||
            },{
 | 
					            }, {
 | 
				
			||||||
            name:"snap_onto_layers",
 | 
					                name: "snap_onto_layers",
 | 
				
			||||||
                doc:"If no existing nearby point exists, but a line of a specified layer is closeby, snap to this layer instead",
 | 
					                doc: "If no existing nearby point exists, but a line of a specified layer is closeby, snap to this layer instead",
 | 
				
			||||||
                
 | 
					
 | 
				
			||||||
            },{
 | 
					            }, {
 | 
				
			||||||
                name:"snap_to_layer_max_distance",
 | 
					                name: "snap_to_layer_max_distance",
 | 
				
			||||||
            doc:"Distance to distort the geometry to snap to this layer",
 | 
					                doc: "Distance to distort the geometry to snap to this layer",
 | 
				
			||||||
defaultValue: "0.1"
 | 
					                defaultValue: "0.1"
 | 
				
			||||||
    }],
 | 
					            }],
 | 
				
			||||||
            false
 | 
					            false
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					@ -428,14 +428,14 @@ defaultValue: "0.1"
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            mergeConfigs.push(mergeConfig)
 | 
					            mergeConfigs.push(mergeConfig)
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        const moveOsmPointIfTags = args["move_osm_point_if"]?.split(";")?.map((tag, i) => TagUtils.Tag(tag, "TagsSpec for import button " + i))
 | 
					        const moveOsmPointIfTags = args["move_osm_point_if"]?.split(";")?.map((tag, i) => TagUtils.Tag(tag, "TagsSpec for import button " + i))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (nodesMustMatch !== undefined && moveOsmPointIfTags.length > 0) {
 | 
					        if (nodesMustMatch !== undefined && moveOsmPointIfTags.length > 0) {
 | 
				
			||||||
           const moveDistance = Math.min(20, Number(args["max_move_distance"]))
 | 
					            const moveDistance = Math.min(20, Number(args["max_move_distance"]))
 | 
				
			||||||
            const mergeConfig: MergePointConfig = {
 | 
					            const mergeConfig: MergePointConfig = {
 | 
				
			||||||
                mode: "move_osm_point" ,
 | 
					                mode: "move_osm_point",
 | 
				
			||||||
                ifMatches: new And(moveOsmPointIfTags),
 | 
					                ifMatches: new And(moveOsmPointIfTags),
 | 
				
			||||||
                withinRangeOfM: moveDistance
 | 
					                withinRangeOfM: moveDistance
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue