forked from MapComplete/MapComplete
		
	Merge branch 'develop' into feature/velopark
This commit is contained in:
		
						commit
						ac12e85760
					
				
					 4 changed files with 15 additions and 10 deletions
				
			
		| 
						 | 
					@ -130,7 +130,7 @@
 | 
				
			||||||
        "minzoom": 15,
 | 
					        "minzoom": 15,
 | 
				
			||||||
        "pointRendering": [
 | 
					        "pointRendering": [
 | 
				
			||||||
          {
 | 
					          {
 | 
				
			||||||
            "marker": [
 | 
					            "=marker": [
 | 
				
			||||||
              {
 | 
					              {
 | 
				
			||||||
                "icon": "./assets/themes/onwheels/restaurant.svg"
 | 
					                "icon": "./assets/themes/onwheels/restaurant.svg"
 | 
				
			||||||
              }
 | 
					              }
 | 
				
			||||||
| 
						 | 
					@ -231,7 +231,7 @@
 | 
				
			||||||
        ],
 | 
					        ],
 | 
				
			||||||
        "pointRendering": [
 | 
					        "pointRendering": [
 | 
				
			||||||
          {
 | 
					          {
 | 
				
			||||||
            "marker": [
 | 
					            "=marker": [
 | 
				
			||||||
              {
 | 
					              {
 | 
				
			||||||
                "icon": "./assets/themes/onwheels/parking.svg"
 | 
					                "icon": "./assets/themes/onwheels/parking.svg"
 | 
				
			||||||
              }
 | 
					              }
 | 
				
			||||||
| 
						 | 
					@ -465,7 +465,7 @@
 | 
				
			||||||
              "point",
 | 
					              "point",
 | 
				
			||||||
              "centroid"
 | 
					              "centroid"
 | 
				
			||||||
            ],
 | 
					            ],
 | 
				
			||||||
            "marker": [
 | 
					            "=marker": [
 | 
				
			||||||
              {
 | 
					              {
 | 
				
			||||||
                "icon": "./assets/svg/statistics.svg"
 | 
					                "icon": "./assets/svg/statistics.svg"
 | 
				
			||||||
              }
 | 
					              }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -52,7 +52,7 @@ export class Overpass {
 | 
				
			||||||
        return `${this._interpreterUrl}?data=${encodeURIComponent(query)}`
 | 
					        return `${this._interpreterUrl}?data=${encodeURIComponent(query)}`
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public async ExecuteQuery(query: string): Promise<[FeatureCollection, Date]> {
 | 
					    private async ExecuteQuery(query: string): Promise<[FeatureCollection, Date]> {
 | 
				
			||||||
        const json = await Utils.downloadJson(this.buildUrl(query))
 | 
					        const json = await Utils.downloadJson(this.buildUrl(query))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (json.elements.length === 0 && json.remark !== undefined) {
 | 
					        if (json.elements.length === 0 && json.remark !== undefined) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -699,7 +699,7 @@ export class RewriteSpecial extends DesugaringStep<TagRenderingConfigJson> {
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private static escapeStr(v: string): string{
 | 
					    private static escapeStr(v: string): string {
 | 
				
			||||||
        return v
 | 
					        return v
 | 
				
			||||||
            .replace(/,/g, "&COMMA")
 | 
					            .replace(/,/g, "&COMMA")
 | 
				
			||||||
            .replace(/\{/g, "&LBRACE")
 | 
					            .replace(/\{/g, "&LBRACE")
 | 
				
			||||||
| 
						 | 
					@ -770,9 +770,7 @@ export class RewriteSpecial extends DesugaringStep<TagRenderingConfigJson> {
 | 
				
			||||||
     *     "special":{
 | 
					     *     "special":{
 | 
				
			||||||
     *          "type": "multi",
 | 
					     *          "type": "multi",
 | 
				
			||||||
     *          "key": "_nearby_bicycle_parkings:props",
 | 
					     *          "key": "_nearby_bicycle_parkings:props",
 | 
				
			||||||
     *          "tagrendering": {
 | 
					     *          "tagrendering": "<b>{id}</b> ({distance}m) {tagApply(a,b,c)}"
 | 
				
			||||||
     *            "*": "<b>{id}</b> ({distance}m) {tagApply(a,b,c)}"
 | 
					 | 
				
			||||||
     *          }
 | 
					 | 
				
			||||||
     *         }}
 | 
					     *         }}
 | 
				
			||||||
     * const context = ConversionContext.test()
 | 
					     * const context = ConversionContext.test()
 | 
				
			||||||
     * RewriteSpecial.convertIfNeeded(special, context) // => {"*": "{multi(_nearby_bicycle_parkings:props,<b>&LBRACEid&RBRACE</b> &LPARENS&LBRACEdistance&RBRACEm&RPARENS &LBRACEtagApply&LPARENSa&COMMAb&COMMAc&RPARENS&RBRACE)}"}
 | 
					     * RewriteSpecial.convertIfNeeded(special, context) // => {"*": "{multi(_nearby_bicycle_parkings:props,<b>&LBRACEid&RBRACE</b> &LPARENS&LBRACEdistance&RBRACEm&RPARENS &LBRACEtagApply&LPARENSa&COMMAb&COMMAc&RPARENS&RBRACE)}"}
 | 
				
			||||||
| 
						 | 
					@ -877,7 +875,9 @@ export class RewriteSpecial extends DesugaringStep<TagRenderingConfigJson> {
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (foundLanguages.size === 0) {
 | 
					        if (foundLanguages.size === 0) {
 | 
				
			||||||
            const args = argNamesList.map((nm) => RewriteSpecial.escapeStr(special[nm] ?? "")).join(",")
 | 
					            const args = argNamesList
 | 
				
			||||||
 | 
					                .map((nm) => RewriteSpecial.escapeStr(special[nm] ?? ""))
 | 
				
			||||||
 | 
					                .join(",")
 | 
				
			||||||
            return {
 | 
					            return {
 | 
				
			||||||
                "*": `{${type}(${args})}`,
 | 
					                "*": `{${type}(${args})}`,
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -610,6 +610,11 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
 | 
				
			||||||
     * const target = {"id":"test"}
 | 
					     * const target = {"id":"test"}
 | 
				
			||||||
     * const result = Utils.Merge(source, target)
 | 
					     * const result = Utils.Merge(source, target)
 | 
				
			||||||
     * result // =>  {"id":"test","condition":{"and":["xyz"]}}
 | 
					     * result // =>  {"id":"test","condition":{"and":["xyz"]}}
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * const source = {"=name": {"en": "XYZ"}}
 | 
				
			||||||
 | 
					     * const target = {"name":null, "x":"y"}
 | 
				
			||||||
 | 
					     * const result = Utils.Merge(source, target)
 | 
				
			||||||
 | 
					     * result // => {"name": {"en": "XYZ"}, "x": "y"}
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    static Merge<T, S>(source: Readonly<S>, target: T): T & S {
 | 
					    static Merge<T, S>(source: Readonly<S>, target: T): T & S {
 | 
				
			||||||
        if (target === null) {
 | 
					        if (target === null) {
 | 
				
			||||||
| 
						 | 
					@ -1451,7 +1456,7 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
 | 
				
			||||||
    public static scrollIntoView(element: HTMLBaseElement | HTMLDivElement) {
 | 
					    public static scrollIntoView(element: HTMLBaseElement | HTMLDivElement) {
 | 
				
			||||||
        // Is the element completely in the view?
 | 
					        // Is the element completely in the view?
 | 
				
			||||||
        const parentRect = Utils.findParentWithScrolling(element)?.getBoundingClientRect()
 | 
					        const parentRect = Utils.findParentWithScrolling(element)?.getBoundingClientRect()
 | 
				
			||||||
        if(!parentRect){
 | 
					        if (!parentRect) {
 | 
				
			||||||
            return
 | 
					            return
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        const elementRect = element.getBoundingClientRect()
 | 
					        const elementRect = element.getBoundingClientRect()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue