diff --git a/Docs/SettingUpPSQL.md b/Docs/SettingUpPSQL.md index 6a7f79c9a..7b19dccad 100644 --- a/Docs/SettingUpPSQL.md +++ b/Docs/SettingUpPSQL.md @@ -26,8 +26,12 @@ Use `vite-node ./scripts/osm2pgsql/generateBuildDbScript.ts` ## Importing data Install osm2pgsql (hint: compile from source is painless) -To seed the database: +Download the latest with: +`nohup transmission-cli https://planet.osm.org/pbf/planet-latest.osm.pbf.torrent &>nohup_transmission.log &` +which will download the data to `~/Downloads` + +To seed the database: ```` osm2pgsql -O flex -S build_db.lua -s --flat-nodes=import-help-file -d postgresql://user:password@localhost:5444/osm-poi .osm.pbf ```` @@ -49,6 +53,7 @@ HP ProLiant DL360 G7 (1U): 2Rx4 DDR3-memory (PC3) ## Updating data + `osm2pgsql-replication update -d postgresql://user:password@localhost:5444/osm-poi -- -O flex -S build_db.lua -s --flat-nodes=import-help-file` diff --git a/assets/themes/ghostsigns/ghostsigns.json b/assets/themes/ghostsigns/ghostsigns.json index fb17508ad..ce5c74aec 100644 --- a/assets/themes/ghostsigns/ghostsigns.json +++ b/assets/themes/ghostsigns/ghostsigns.json @@ -38,9 +38,8 @@ } }, "minzoom": 10, - "allowMove": { - "enableImproveAccuracy": true - }, + "#allowMove": "Normally, a ghost sign is snapped to a wall, so moving won't be possible in most cases", + "allowMove": false, "tagRenderings": [ { "id": "historic", diff --git a/scripts/generateLayouts.ts b/scripts/generateLayouts.ts index 54cf8e66e..58b716f42 100644 --- a/scripts/generateLayouts.ts +++ b/scripts/generateLayouts.ts @@ -12,7 +12,6 @@ import SpecialVisualizations from "../src/UI/SpecialVisualizations" import Constants from "../src/Models/Constants" import { AvailableRasterLayers, RasterLayerPolygon } from "../src/Models/RasterLayers" import { ImmutableStore } from "../src/Logic/UIEventSource" -import * as crypto from "crypto" import * as eli from "../src/assets/editor-layer-index.json" import * as eli_global from "../src/assets/global-raster-layers.json" import ValidationUtils from "../src/Models/ThemeConfig/Conversion/ValidationUtils" @@ -374,15 +373,6 @@ async function generateCsp( ].join("\n") } -const removeOtherLanguages = readFileSync("./src/UI/RemoveOtherLanguages.js", "utf8") - .split("\n") - .map((s) => s.trim()) - .join("\n") -const removeOtherLanguagesHash = crypto - .createHash("sha256") - .update(removeOtherLanguages) - .digest("base64") - async function createLandingPage( layout: LayoutConfig, layoutJson: LayoutConfigJson, @@ -461,9 +451,6 @@ async function createLandingPage( const loadingText = Translations.t.general.loadingTheme.Subs({ theme: layout.title }) const templateLines = template.split("\n") - const removeOtherLanguagesReference = templateLines.find( - (line) => line.indexOf("./src/UI/RemoveOtherLanguages.js") >= 0 - ) let output = template .replace("Loading MapComplete, hang on...", asLangSpan(loadingText, "h1")) .replace( @@ -474,10 +461,9 @@ async function createLandingPage( .replace( //, await generateCsp(layout, layoutJson, { - scriptSrcs: [`'sha256-${removeOtherLanguagesHash}'`], + scriptSrcs: [], }) ) - .replace(removeOtherLanguagesReference, "") .replace( /.*/s, asLangSpan(layout.shortDescription) diff --git a/src/Logic/ImageProviders/Imgur.ts b/src/Logic/ImageProviders/Imgur.ts index 0ddeb14a8..9c0146de9 100644 --- a/src/Logic/ImageProviders/Imgur.ts +++ b/src/Logic/ImageProviders/Imgur.ts @@ -85,9 +85,15 @@ export class Imgur extends ImageProvider implements ImageUploader { * expected.date = new Date(1655052078000) * expected.views = 2 * licenseInfo // => expected + * const licenseInfoJpeg = await Imgur.singleton.DownloadAttribution("https://i.imgur.com/E0RuAK3.jpeg") + * licenseInfoJpeg // => expected + * const licenseInfoUpperCase = await Imgur.singleton.DownloadAttribution("https://i.imgur.com/E0RuAK3.JPEG") + * licenseInfoUpperCase // => expected + * + * */ public async DownloadAttribution(url: string): Promise { - const hash = url.substr("https://i.imgur.com/".length).split(".jpg")[0] + const hash = url.substr("https://i.imgur.com/".length).split(/\.jpe?g/i)[0] const apiUrl = "https://api.imgur.com/3/image/" + hash const response = await Utils.downloadJsonCached(apiUrl, 365 * 24 * 60 * 60, { diff --git a/src/UI/Popup/MoveWizardState.ts b/src/UI/Popup/MoveWizardState.ts index bad0dd8a6..cdb9255e8 100644 --- a/src/UI/Popup/MoveWizardState.ts +++ b/src/UI/Popup/MoveWizardState.ts @@ -134,9 +134,10 @@ export class MoveWizardState { // This is a new point. Check if it was snapped to an existing way due to the '_referencing_ways'-tag const store = this._state.featureProperties.getStore(id) store?.addCallbackAndRunD((tags) => { - if (tags._referencing_ways !== "[]") { + if (tags._referencing_ways !== undefined && tags._referencing_ways !== "[]") { console.log("Got referencing ways according to the tags") this.moveDisallowedReason.setData(t.partOfAWay) + return true } }) }