Formatting and small cleanups

This commit is contained in:
pietervdvn 2021-03-29 02:53:06 +02:00
parent 15a6794e59
commit 4342b38e9d
8 changed files with 40 additions and 37 deletions

View file

@ -81,7 +81,7 @@ export default class LayerConfig {
this.source = new SourceConfig({
osmTags: osmTags,
geojsonSource: json.source["geoJsonSource"],
geojsonSource: json.source["geoJson"],
overpassScript: json.source["overpassScript"],
});
} else {

View file

@ -39,7 +39,9 @@ export interface LayerConfigJson {
* NOTE: the previous format was 'overpassTags: AndOrTagCOnfigJson | string', which is interpreted as a shorthand for source: {osmTags: "key=value"}
* While still supported, this is considered deprecated
*/
source: {osmTags: AndOrTagConfigJson | string} | {geoJsonSource: string} | {overpassScript: string}
source: { osmTags: AndOrTagConfigJson | string } |
{ osmTags: AndOrTagConfigJson | string, geoJson: string } |
{ osmTags: AndOrTagConfigJson | string, overpassScript: string }
/**
*
@ -52,7 +54,7 @@ export interface LayerConfigJson {
* ]
*
*/
calculatedTags? : string[];
calculatedTags?: string[];
/**
* If set, this layer will not query overpass; but it'll still match the tags above which are by chance returned by other layers.
@ -114,7 +116,7 @@ export interface LayerConfigJson {
*
* Note: strings are interpreted as icons, so layering and substituting is supported
*/
iconOverlays?: {if: string | AndOrTagConfigJson, then: string | TagRenderingConfigJson, badge?: boolean}[]
iconOverlays?: { if: string | AndOrTagConfigJson, then: string | TagRenderingConfigJson, badge?: boolean }[]
/**
* A string containing "width,height" or "width,height,anchorpoint" where anchorpoint is any of 'center', 'top', 'bottom', 'left', 'right', 'bottomleft','topright', ...
@ -156,7 +158,7 @@ export interface LayerConfigJson {
* If set, this layer will pass all the features it receives onto the next layer.
* This is ideal for decoration, e.g. directionss on cameras
*/
passAllFeatures?:boolean
passAllFeatures?: boolean
/**
* Presets for this layer.

View file

@ -1,5 +1,5 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeInspection/Highlighting/SweaWarningsMode/@EntryValue">ShowAndRun</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/SweaWarningsMode/@EntryValue">DoNotShowAndRun</s:String>
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=d2f95dca_002Defa2_002D40b6_002D8190_002D724496f13a75/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" IsActive="True" Name="Session" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;
&lt;Nothing /&gt;
&lt;/SessionState&gt;</s:String></wpf:ResourceDictionary>

View file

@ -103,7 +103,6 @@ Some advanced functions are available on <b>feat</b> as well:
throw "Undefined distance!"
}
if(closestFeature === undefined || distance < closestDistance){
console.log("Distance between ", feature.properties.id, "and", otherFeature.properties.id, "is", distance)
closestFeature = otherFeature
closestDistance = distance;
}

View file

@ -1,7 +1,6 @@
import FeatureSource from "./FeatureSource";
import {UIEventSource} from "../UIEventSource";
import * as $ from "jquery";
import {Layer} from "leaflet";
/**
* Fetches a geojson file somewhere and passes it along

View file

@ -57,9 +57,8 @@ export default class TagRenderingQuestion extends UIElement {
this._inputElement = this.GenerateInputElement()
const self = this;
const save = () => {
console.log("Save clicked!")
const selection = self._inputElement.GetValue().data;
console.log("Selection is", selection)
console.log("Save button clicked, the tags are is", selection)
if (selection) {
(State.state?.changes ?? new Changes())
.addTag(tags.data.id, selection, tags);

View file

@ -27,7 +27,9 @@ export default class ShowDataLayer {
layoutToUse.addCallbackAndRun(layoutToUse => {
for (const layer of layoutToUse.layers) {
self._layerDict[layer.id] = layer;
if (self._layerDict[layer.id] === undefined) {
self._layerDict[layer.id] = layer;
}
}
});

View file

@ -17,6 +17,8 @@
"startLon": 4.3516970,
"startZoom": 16,
"widenFactor": 0.05,
"layers": ["drinking_water"],
"layers": [
"drinking_water",
],
"roamingRenderings": []
}