forked from MapComplete/MapComplete
Chore: make method private, add tests
This commit is contained in:
parent
876c766130
commit
a9e145076d
2 changed files with 7 additions and 2 deletions
|
@ -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) {
|
||||||
|
|
|
@ -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