Skip to content

Commit

Permalink
Merge pull request #12 from OpenHistoricalMap/830-overpass-turbo-link…
Browse files Browse the repository at this point in the history
…s-to-osm-ids

Fixes OpenHistoricalMap/issues#830
  • Loading branch information
erictheise authored Jun 20, 2024
2 parents 698b20b + f4f5a03 commit 7d8a767
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion js/ide.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1671,7 +1671,7 @@ class IDE {
.bind("click", () => {
const content =
`<h4>${i18n.t("export.map_view.permalink")}</h4>` +
`<p><a href="//www.openstreetmap.org/#map=${this.map.getZoom()}/${L.Util.formatNum(
`<p><a href="//www.openhistoricalmap.org/#map=${this.map.getZoom()}/${L.Util.formatNum(
this.map.getCenter().lat
)}/${L.Util.formatNum(
this.map.getCenter().lng
Expand Down
4 changes: 2 additions & 2 deletions js/nominatim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default class nominatim {
static request(search, callback) {
// ajax (GET) request to nominatim
$.ajax(
`https://nominatim.openstreetmap.org/search` +
`https://nominatim.openhistoricalmap.org/search` +
`?X-Requested-With=${configs.appname}`,
{
data: {
Expand All @@ -29,7 +29,7 @@ export default class nominatim {
},
error() {
const err =
"An error occurred while contacting the osm search server nominatim.openstreetmap.org :(";
"An error occurred while contacting the osm search server nominatim.openhistoricalmap.org :(";
console.log(err);
callback(err, null);
}
Expand Down
18 changes: 9 additions & 9 deletions js/popup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ export function featurePopupContent(feature: GeoJSON.Feature) {
if (feature.properties.type == "node")
popup +=
`<h4 class="title is-4"><span class="t" data-t="popup.node">Node</span>` +
` <a href="//www.openstreetmap.org/node/${feature.properties.id}" target="_blank">${feature.properties.id}</a>` +
` <a href="//www.openstreetmap.org/edit?node=${feature.properties.id}" target="_blank">✏</a>` +
` <a href="//www.openhistoricalmap.org/node/${feature.properties.id}" target="_blank">${feature.properties.id}</a>` +
` <a href="//www.openhistoricalmap.org/edit?node=${feature.properties.id}" target="_blank">✏</a>` +
`</h4>`;
else if (feature.properties.type == "way")
popup +=
`<h4 class="title is-4"><span class="t" data-t="popup.way">Way</span>` +
` <a href="//www.openstreetmap.org/way/${feature.properties.id}" target="_blank">${feature.properties.id}</a>` +
` <a href="//www.openstreetmap.org/edit?way=${feature.properties.id}" target="_blank">✏</a>` +
` <a href="//www.openhistoricalmap.org/way/${feature.properties.id}" target="_blank">${feature.properties.id}</a>` +
` <a href="//www.openhistoricalmap.org/edit?way=${feature.properties.id}" target="_blank">✏</a>` +
`</h4>`;
else if (feature.properties.type == "relation")
popup +=
`<h4 class="title is-4"><span class="t" data-t="popup.relation">Relation</span>` +
` <a href="//www.openstreetmap.org/relation/${feature.properties.id}" target="_blank">${feature.properties.id}</a>` +
` <a href="//www.openstreetmap.org/edit?relation=${feature.properties.id}" target="_blank">✏</a>` +
` <a href="//www.openhistoricalmap.org/relation/${feature.properties.id}" target="_blank">${feature.properties.id}</a>` +
` <a href="//www.openhistoricalmap.org/edit?relation=${feature.properties.id}" target="_blank">✏</a>` +
`</h4>`;
else
popup += `<h5 class="subtitle is-5">${feature.properties.type} #${feature.properties.id}</h5>`;
Expand Down Expand Up @@ -115,7 +115,7 @@ export function featurePopupContent(feature: GeoJSON.Feature) {
}
popup += "</h3><ul>";
$.each(feature.properties.relations, (k, v) => {
popup += `<li><a href="//www.openstreetmap.org/relation/${v["rel"]}" target="_blank">${v["rel"]}</a>`;
popup += `<li><a href="//www.openhistoricalmap.org/relation/${v["rel"]}" target="_blank">${v["rel"]}</a>`;
if (v.reltags && (v.reltags.name || v.reltags.ref || v.reltags.type))
popup += ` <i>${$.trim(
(v.reltags.type ? `${htmlentities(v.reltags.type)} ` : "") +
Expand All @@ -137,9 +137,9 @@ export function featurePopupContent(feature: GeoJSON.Feature) {
k = htmlentities(k);
v = htmlentities(v);
if (k == "user")
v = `<a href="//www.openstreetmap.org/user/${v}" target="_blank">${v}</a>`;
v = `<a href="//www.openhistoricalmap.org/user/${v}" target="_blank">${v}</a>`;
if (k == "changeset")
v = `<a href="//www.openstreetmap.org/changeset/${v}" target="_blank">${v}</a>`;
v = `<a href="//www.openhistoricalmap.org/changeset/${v}" target="_blank">${v}</a>`;
popup += `<li><span class="is-family-monospace">${k} = ${v}</span></li>`;
});
popup += "</ul>";
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"name": "overpass-turbo",
"description": "A web based data mining tool for OpenStreetMap using Overpass API",
"version": "2.0.1",
"description": "A web based data mining tool for OpenHistoricalMap using Overpass API",
"homepage": "http://overpass-turbo.eu/",
"repository": "git+https://github.com/tyrasd/overpass-turbo.git",
"repository": "git+https://github.com/OpenHistoricalMap/overpass-turbo.git",
"license": "MIT",
"scripts": {
"test": "yarn run test:eslint && yarn run test:style && yarn run test:vitest",
Expand Down

0 comments on commit 7d8a767

Please sign in to comment.