Skip to content

Commit

Permalink
Add link to nominatim OSM when displaying result for earth "pointer"
Browse files Browse the repository at this point in the history
  • Loading branch information
tboch committed Mar 21, 2024
1 parent 7c27227 commit 4ea8530
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/js/PlanetaryFeaturesPointer.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,18 @@ export let PlanetaryFeaturesPointer = (function() {

const featureFieldIdx = fields.findIndex((element) => element.includes('feature_name'));
const featureName = values[featureFieldIdx];
const featureId = values[fields.indexOf('feature_id')]
const featureId = values[fields.indexOf('feature_id')];
const title = '<div class="aladin-sp-title"><a target="_blank" href="https://planetarynames.wr.usgs.gov/Feature/' + featureId + '">' + featureName + '</a></div>';
const featureType = values[fields.indexOf('feature_type')]
let content = '<div class="aladin-sp-content">' + ' ' + '</div>';
content += '<em>Type: </em>' + featureType + '<br><br>';
content += '<a target="_blank" href="https://planetarynames.wr.usgs.gov/Feature/' + featureId + '">More information</a>';
let moreInfoURL = 'https://planetarynames.wr.usgs.gov/Feature/' + featureId;
if (body === 'earth') {
const placeId = values[fields.indexOf('place_id')];
moreInfoURL = 'https://nominatim.openstreetmap.org/ui/details.html?place_id=' + placeId;
}

content += '<a target="_blank" href="' + moreInfoURL + '">More information</a>';

let lon = parseFloat(values[lonFieldIdx]);
const lat = parseFloat(values[latFieldIdx]);
Expand Down

0 comments on commit 4ea8530

Please sign in to comment.