Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gwells-2211 *FEATURE add closed/abandoned wells colour #2264

Merged
merged 15 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/backend/wells/views_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ def geoJSONResponse(self):
"identification_plate_number",
"street_address",
"city",
"well_status",
"artesian_conditions",
"storativity",
"transmissivity",
Expand Down
7 changes: 6 additions & 1 deletion app/frontend/src/aquifers/components/AquiferMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ import observationWellInactiveLegendSrc from '../../common/assets/images/owells-
import observationWellActiveLegendSrc from '../../common/assets/images/owells-active.svg'
import wellsAllLegendSrc from '../../common/assets/images/wells-all.svg'
import wellsArtesianLegendSrc from '../../common/assets/images/wells-artesian.svg'
import wellsClosedLegendSrc from '../../common/assets/images/wells-closed.svg'
import wellsHydraulicLegendSrc from '../../common/assets/images/wells-hydraulic.svg'
import { setupFeatureTooltips } from '../../common/mapbox/popup'

Expand Down Expand Up @@ -149,13 +150,17 @@ export default {
{
imageSrc: wellsArtesianLegendSrc,
label: 'artesian'
},
{
imageSrc: wellsClosedLegendSrc,
label: 'decommissioned'
}
]
},
{
show: false,
id: WELLS_AQUIFER_PARAMETER_LAYER_ID,
label: 'Wells - aquifer parameters',
label: 'Wells - aquifer parameters',
imageSrc: wellsHydraulicLegendSrc
},
{
Expand Down
15 changes: 9 additions & 6 deletions app/frontend/src/aquifers/components/SingleAquiferMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ import {
WELLS_SOURCE,
AQUIFERS_SOURCE,
observationWellsLayer,
WELLS_OBSERVATION_LAYER_ID,


WELLS_OBSERVATION_LAYER_ID
} from '../../common/mapbox/layers'
import { computeBoundsFromMultiPolygon } from '../../common/mapbox/geometry'
import { LayersControl, LegendControl } from '../../common/mapbox/controls'
Expand All @@ -77,6 +75,7 @@ import wellsHydraulicLegendSrc from '../../common/assets/images/wells-hydraulic.

import wellsAllLegendSrc from '../../common/assets/images/wells-all.svg'
import wellsArtesianLegendSrc from '../../common/assets/images/wells-artesian.svg'
import wellsClosedLegendSrc from '../../common/assets/images/wells-closed.svg'
import uncorrelatedWellsIconSrc from '../../common/assets/images/wells-uncorrelated.svg'
import emsWellsIconSrc from '../../common/assets/images/wells-ems.svg'
import { setupFeatureTooltips } from '../../common/mapbox/popup'
Expand Down Expand Up @@ -138,13 +137,17 @@ export default {
{
imageSrc: wellsArtesianLegendSrc,
label: 'artesian'
},
{
imageSrc: wellsClosedLegendSrc,
label: 'decommissioned'
}
]
},
{
show: true,
id: WELLS_AQUIFER_PARAMETER_LAYER_ID,
label: 'Wells - aquifer parameters',
label: 'Wells - aquifer parameters',
imageSrc: wellsHydraulicLegendSrc
},
{
Expand Down Expand Up @@ -514,13 +517,13 @@ export default {
const endEvents = ['zoomend', 'moveend']
endEvents.forEach(eventName => {
this.map.on(eventName, (e) => {
this.updateMapLegendBasedOnVisibleElements();
this.updateMapLegendBasedOnVisibleElements();

})
})
}
},

watch: {
aquiferId (newAquiferId, oldAquiferId) {
this.setSelectedAquifer(oldAquiferId, false)
Expand Down
5 changes: 5 additions & 0 deletions app/frontend/src/common/assets/images/wells-closed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions app/frontend/src/common/mapbox/images.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,17 @@ export class PulsingArtesianWellImage extends PulsingDotImage {
}
}

export class PulsingClosedWellImage extends PulsingDotImage {
constructor (map) {
super(map, {
size: 90,
dotColour: 'rgba(48, 45, 87, 1)',
dotStrokeColour: 'rgba(0, 0, 0, 1)',
pulseColour: 'rgba(173, 171, 199, %d)'
})
}
}

export function buildLeafletStyleMarker (longitude, latitude, options = {}) {
const element = document.createElement('div')
element.className = 'map-pin'
Expand Down
12 changes: 11 additions & 1 deletion app/frontend/src/common/mapbox/layers.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const FOCUSED_WELLS_LAYER_ID = 'focused-wells'
export const FOCUSED_WELLS_ARTESIAN_LAYER_ID = 'focused-wells-artesian'
export const FOCUSED_WELL_IMAGE_ID = 'focused-well-image'
export const FOCUSED_WELL_ARTESIAN_IMAGE_ID = 'focused-artesian-well-image'

export const FOCUSED_WELL_CLOSED_IMAGE_ID = 'focused-closed-well-image'
export const SEARCHED_REGISTRIES_SOURCE_ID = 'searched-registries-source'
export const SEARCHED_REGISTRIES_LAYER_ID = 'searched-registries-layer'

Expand Down Expand Up @@ -278,12 +278,16 @@ export function wellsBaseAndArtesianLayer (options = {}) {
const styles = defaultsDeep(options.styles, {
'circle-color': [
'case',
['==', ['get', 'well_status'], 'CLOSURE'], '#302d57',
['==', ['get', 'well_status'], 'ABANDONED'], '#302d57',
['to-boolean', ['get', 'artesian']], '#1099FE',
'#0162FE'
],
'circle-radius': 3,
'circle-stroke-color': [
'case',
['==', ['get', 'well_status'], 'CLOSURE'], 'transparent',
['==', ['get', 'well_status'], 'ABANDONED'], 'transparent',
['to-boolean', ['get', 'artesian']], '#EE14CA',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you're presenting the changes to the SO, make sure you highlight everything listed in the PR (sometimes the comments don't get read) and specifically this one. Given my understanding of how artesian conditions are used, they might want wells that have them to still be highlighted even when closed. I'm not saying undo the change right now, but double check with the SO.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack, I will do that now, thank you!

'transparent'
],
Expand Down Expand Up @@ -316,12 +320,16 @@ export function searchedWellsLayer (options = {}) {
const styles = defaultsDeep(options.styles, {
'circle-color': [
'case',
['==', ['get', 'well_status'], 'CLOSURE'], '#302d57',
['==', ['get', 'well_status'], 'ABANDONED'], '#302d57',
['to-boolean', ['get', 'artesian_conditions']], '#1099FE',
'#0162FE'
],
'circle-radius': 5,
'circle-stroke-color': [
'case',
['==', ['get', 'well_status'], 'CLOSURE'], 'transparent',
['==', ['get', 'well_status'], 'ABANDONED'], 'transparent',
['to-boolean', ['get', 'artesian_conditions']], '#EE14CA',
'black'
],
Expand All @@ -337,6 +345,8 @@ export function focusedWellsLayer (options = {}) {
const layout = defaultsDeep(options.layout, {
'icon-image': [
'case',
['==', ['get', 'well_status'], 'CLOSURE'], FOCUSED_WELL_CLOSED_IMAGE_ID,
['==', ['get', 'well_status'], 'ABANDONED'], FOCUSED_WELL_CLOSED_IMAGE_ID,
['to-boolean', ['get', 'artesian_conditions']], FOCUSED_WELL_ARTESIAN_IMAGE_ID,
FOCUSED_WELL_IMAGE_ID
]
Expand Down
13 changes: 10 additions & 3 deletions app/frontend/src/wells/components/SearchMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,21 @@ import {
focusedWellsLayer,
FOCUSED_WELL_IMAGE_ID,
FOCUSED_WELL_ARTESIAN_IMAGE_ID,
FOCUSED_WELL_CLOSED_IMAGE_ID,
wellLayerFilter,
SEARCHED_WELLS_LAYER_ID,
WELLS_SOURCE,
WELLS_SOURCE
} from '../../common/mapbox/layers'
import { LegendControl, BoxZoomControl, SearchOnMoveControl, ClearSearchCriteriaControl } from '../../common/mapbox/controls'
import { createWellPopupElement } from '../popup'
import { PulsingWellImage, PulsingArtesianWellImage } from '../../common/mapbox/images'
import { PulsingWellImage, PulsingArtesianWellImage, PulsingClosedWellImage } from '../../common/mapbox/images'
import { DEFAULT_MAP_ZOOM, CENTRE_LNG_LAT_BC, buildWellsGeoJSON, convertLngLatBoundsToDirectionBounds, boundsCompletelyContains } from '../../common/mapbox/geometry'

import { RESET_WELLS_SEARCH, SEARCH_WELLS } from '../../wells/store/actions.types'

import wellsAllLegendSrc from '../../common/assets/images/wells-all.svg'
import wellsArtesianLegendSrc from '../../common/assets/images/wells-artesian.svg'
import wellsClosedLegendSrc from '../../common/assets/images/wells-closed.svg'
import { mapGetters } from 'vuex'
import { setupFeatureTooltips } from '../../common/mapbox/popup'

Expand All @@ -61,7 +63,7 @@ const WELL_FEATURE_PROPERTIES_FOR_POPUP = [
'street_address',
'is_published'
]
const FOCUSED_WELL_PROPERTIES = WELL_FEATURE_PROPERTIES_FOR_POPUP.concat(['artesian_conditions'])
const FOCUSED_WELL_PROPERTIES = WELL_FEATURE_PROPERTIES_FOR_POPUP.concat(['artesian_conditions', 'well_status'])

export default {
name: 'SearchMap',
Expand All @@ -88,6 +90,10 @@ export default {
imageSrc: wellsArtesianLegendSrc,
label: 'artesian'
},
{
imageSrc: wellsClosedLegendSrc,
label: 'decommissioned'
}
]
}
],
Expand Down Expand Up @@ -200,6 +206,7 @@ export default {
this.map.on('load', () => {
this.map.addImage(FOCUSED_WELL_ARTESIAN_IMAGE_ID, new PulsingArtesianWellImage(this.map), { pixelRatio: 2 })
this.map.addImage(FOCUSED_WELL_IMAGE_ID, new PulsingWellImage(this.map), { pixelRatio: 2 })
this.map.addImage(FOCUSED_WELL_CLOSED_IMAGE_ID, new PulsingClosedWellImage(this.map), { pixelRatio: 2 })

const tooltipLayers = {
[WELLS_BASE_AND_ARTESIAN_LAYER_ID]: {
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '3.7'
# version: '3.7'
# NOTE For Red Hat or other images on the internal registry please login as follows:
# 1. Be logged into the BC Gov OpenShift Console
# https://console.pathfinder.gov.bc.ca:8443/console/catalog)
Expand Down
Loading