forked from MapComplete/MapComplete
		
	Fix bug which blocked uploads
This commit is contained in:
		
							parent
							
								
									bcf71a601e
								
							
						
					
					
						commit
						2c677ee8a2
					
				
					 4 changed files with 13 additions and 1 deletions
				
			
		| 
						 | 
					@ -22,6 +22,10 @@ export default class OsmApiFeatureSource implements FeatureSource {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public load(id: string) {
 | 
					    public load(id: string) {
 | 
				
			||||||
 | 
					        if(id.indexOf("-") >= 0){
 | 
				
			||||||
 | 
					            // Newly added point - not yet in OSM
 | 
				
			||||||
 | 
					            return;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
        OsmObject.DownloadObject(id, (element, meta) => {
 | 
					        OsmObject.DownloadObject(id, (element, meta) => {
 | 
				
			||||||
            const geojson = element.asGeoJson();
 | 
					            const geojson = element.asGeoJson();
 | 
				
			||||||
            geojson.id = geojson.properties.id;
 | 
					            geojson.id = geojson.properties.id;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -149,6 +149,9 @@ export abstract class OsmObject {
 | 
				
			||||||
    TagsXML(): string {
 | 
					    TagsXML(): string {
 | 
				
			||||||
        let tags = "";
 | 
					        let tags = "";
 | 
				
			||||||
        for (const key in this.tags) {
 | 
					        for (const key in this.tags) {
 | 
				
			||||||
 | 
					            if(key.startsWith("_")){
 | 
				
			||||||
 | 
					                continue;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
            const v = this.tags[key];
 | 
					            const v = this.tags[key];
 | 
				
			||||||
            if (v !== "") {
 | 
					            if (v !== "") {
 | 
				
			||||||
                tags += '        <tag k="' + Utils.EncodeXmlValue(key) + '" v="' + Utils.EncodeXmlValue(this.tags[key]) + '"/>\n'
 | 
					                tags += '        <tag k="' + Utils.EncodeXmlValue(key) + '" v="' + Utils.EncodeXmlValue(this.tags[key]) + '"/>\n'
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,7 +2,7 @@ import { Utils } from "../Utils";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export default class Constants {
 | 
					export default class Constants {
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    public static vNumber = "0.7.1b";
 | 
					    public static vNumber = "0.7.1c";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // The user journey states thresholds when a new feature gets unlocked
 | 
					    // The user journey states thresholds when a new feature gets unlocked
 | 
				
			||||||
    public static userJourney = {
 | 
					    public static userJourney = {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										5
									
								
								Utils.ts
									
										
									
									
									
								
							
							
						
						
									
										5
									
								
								Utils.ts
									
										
									
									
									
								
							| 
						 | 
					@ -1,4 +1,5 @@
 | 
				
			||||||
import * as $ from "jquery"
 | 
					import * as $ from "jquery"
 | 
				
			||||||
 | 
					import {type} from "os";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export class Utils {
 | 
					export class Utils {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -14,6 +15,10 @@ export class Utils {
 | 
				
			||||||
    private static extraKeys = ["nl", "en", "fr", "de", "pt", "es", "name", "phone", "email", "amenity", "leisure", "highway", "building", "yes", "no", "true", "false"]
 | 
					    private static extraKeys = ["nl", "en", "fr", "de", "pt", "es", "name", "phone", "email", "amenity", "leisure", "highway", "building", "yes", "no", "true", "false"]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    static EncodeXmlValue(str) {
 | 
					    static EncodeXmlValue(str) {
 | 
				
			||||||
 | 
					        if(typeof str !== "string"){
 | 
				
			||||||
 | 
					            str = ""+str
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
        return str.replace(/&/g, '&')
 | 
					        return str.replace(/&/g, '&')
 | 
				
			||||||
            .replace(/</g, '<')
 | 
					            .replace(/</g, '<')
 | 
				
			||||||
            .replace(/>/g, '>')
 | 
					            .replace(/>/g, '>')
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue