Skip to content

Commit

Permalink
remove link from pop up - only show name
Browse files Browse the repository at this point in the history
  • Loading branch information
DilwoarH committed Jan 9, 2025
1 parent 0cd9393 commit 144b8b6
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/assets/js/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const boundaryLineOpacity = 1
const pointOpacity = 0.8
const pointRadius = 5
const pointColor = '#008'
const planningDataUrl = 'https://www.planning.data.gov.uk'
const popupMaxListLength = 10

/**
Expand Down Expand Up @@ -247,15 +246,11 @@ export class Map {
// feature text content
const textContent = document.createElement('p')
textContent.classList.add('govuk-body-s', 'govuk-!-margin-top-0', 'govuk-!-margin-bottom-0')
textContent.innerHTML = `${capitalize(startCase(feature.properties.dataset)) || ''}<br/>
<strong>Ref:</strong> ${feature.properties.reference || ''}<br/>`

// link to planning data
const a = document.createElement('a')
a.classList.add('govuk-link')
a.setAttribute('href', `${planningDataUrl}/entity/${feature.properties.entity}`)
a.textContent = feature.properties.name || feature.properties.reference || 'View entity'
textContent.appendChild(a)
textContent.innerHTML = `
${capitalize(startCase(feature.properties.dataset)) || ''}<br/>
<strong>Ref:</strong> ${feature.properties.reference || ''}<br/>
${feature.properties.name ?? ''}
`

inset.appendChild(textContent)
list.appendChild(inset)
Expand Down

0 comments on commit 144b8b6

Please sign in to comment.