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

WFNEWS-1993 : Use variable for service6 URL #1827

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export function ClosedRecreationSitesLayerConfig(ls: layerSettings) {
},
],
serviceUrl:
'https://services6.arcgis.com/ubm4tcTYICKBpist/ArcGIS/rest/services/RecSitesReservesInterpForests_DetailsClosures_publicView/FeatureServer/0',
ls.services6BaseUrl + '/ubm4tcTYICKBpist/ArcGIS/rest/services/RecSitesReservesInterpForests_DetailsClosures_publicView/FeatureServer/0',
where: 'CLOSURE_IND = \'Y\'',
titleAttribute: 'PROJECT_NAME',
drawingInfo: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function FirePerimetersLayerConfig(ls: layerSettings) {
title: 'BC Wildfire Fire Perimeters',
attribution: 'Copyright 117 DataBC, Government of British Columbia',
serviceUrl:
'https://services6.arcgis.com/ubm4tcTYICKBpist/arcgis/rest/services/BCWS_FirePerimeters_PublicView/FeatureServer/0',
ls.services6BaseUrl + '/ubm4tcTYICKBpist/arcgis/rest/services/BCWS_FirePerimeters_PublicView/FeatureServer/0',
where: 'FIRE_STATUS <> \'Out\'',
opacity: 1,
attributes: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export function ForestServiceRoadsLayerConfig(ls: layerSettings) {
isQueryable: true,
attribution: 'Copyright 117 DataBC, Government of British Columbia',
serviceUrl:
'https://services6.arcgis.com/ubm4tcTYICKBpist/ArcGIS/rest/services/FSR_Safety_Information_View/FeatureServer/0',
ls.services6BaseUrl + '/ubm4tcTYICKBpist/ArcGIS/rest/services/FSR_Safety_Information_View/FeatureServer/0',
opacity: 1,
titleAttribute: 'LOCATION',
popupTemplate:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { ActiveWildfiresLayerConfig } from './active-wildfires.config';
import { ActiveWildfiresHeatmapLayerConfig } from './active-wildfires.heatmap.config';
import { AreaRestrictionsLayerConfig } from './area-restrictions.config';
import { BansAndProhibitionsLayerConfig } from './bans-and-prohibitions.config';
import { BasemapLayerConfig } from './basemap.config';
import { FireCentresLayerConfig } from './bc-fire-centres.config';
import { ProtectedLandsAccessRestrictionsLayerConfig } from './bc-parks-closures.config';
import { WildfiresInactiveLayerConfig } from './bcws-activefires-publicview-inactive.config';
Expand All @@ -21,12 +22,12 @@ import { SmokeForecastLayerConfig } from './hourly-currentforecast-firesmoke.con
import { PrecipitationLayerConfig } from './precipitation.config';
import { WeatherStationsLayerConfig } from './weather-stations.config';
import { WeatherLayerConfig } from './weather.config';
import { BasemapLayerConfig } from './basemap.config';
//import { FuelTreatmentLayerConfig } from './fuel-treatment';
//import { PrescribedFireLayerConfig } from './prescribed-fire.config';

export interface layerSettings {
openmapsBaseUrl: string;
services6BaseUrl: string;
drivebcBaseUrl: string;
wfnewsUrl: string;
evacOrdersURL: string;
Expand All @@ -39,6 +40,7 @@ export function LayerConfig(
const ls: layerSettings = {
openmapsBaseUrl: mapServices['openmapsBaseUrl'],
drivebcBaseUrl: mapServices['drivebcBaseUrl'],
services6BaseUrl: mapServices['services6BaseUrl'],
wfnewsUrl: mapServices['wfnews'],
evacOrdersURL: appConfigService.getConfig().externalAppConfig['AGOLevacOrders'].toString()
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export function PrescribedFireLayerConfig(ls: layerSettings) {
isQueryable: true,
attribution: 'Copyright 117 DataBC, Government of British Columbia',
serviceUrl:
'https://services6.arcgis.com/ubm4tcTYICKBpist/ArcGIS/rest/services/British_Columbia_Prescribed_Fire_-_View/FeatureServer/4',
ls.services6BaseUrl + '/ubm4tcTYICKBpist/ArcGIS/rest/services/British_Columbia_Prescribed_Fire_-_View/FeatureServer/4',
titleAttribute: 'Fire_Zone',
attributes: [
{
Expand Down
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think these should be parameterized in appConfig.mobile.json and set by the iOS/android deployer, since they're no longer the same across all environments

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Right I missed that.

Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@
"bcWildFireSupportPage": "https://intranet.gov.bc.ca/bcws/provincial-programs/strategic-initiatives-and-innovation/wildfire-one/wildfire-one-training",
"appStoreUrl": "https://apps.apple.com/ca/app/bc-wildfire-service/id1477675008",
"googlePlayUrl": "https://play.google.com/store/apps/details?id=ca.bc.gov.WildfireInformation&hl=en_CA&gl=US",
"AGOLfireCentres": "https://services6.arcgis.com/ubm4tcTYICKBpist/ArcGIS/rest/services/British_Columbia_Fire_Centre_Boundaries/FeatureServer/0/query?where=1%3D1&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&relationParam=&returnGeodetic=false&outFields=*&returnGeometry=false&returnCentroid=false&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&defaultSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=pjson&token=",
"AGOLevacOrders": "https://services6.arcgis.com/ubm4tcTYICKBpist/ArcGIS/rest/services/test_Emrg_Orders_and_Alerts/FeatureServer/0",
"AGOLareaRestrictions": "https://services6.arcgis.com/ubm4tcTYICKBpist/ArcGIS/rest/services/test_British_Columbia_Area_Restrictions/FeatureServer/0",
"AGOLBansAndProhibitions": "https://services6.arcgis.com/ubm4tcTYICKBpist/ArcGIS/rest/services/test_British_Columbia_Bans_and_Prohibition_Areas/FeatureServer/0/",
"AGOLDangerRatings": "https://services6.arcgis.com/ubm4tcTYICKBpist/ArcGIS/rest/services/test_British_Columbia_Danger_Rating/FeatureServer/0/",
"AGOLperimetres": "https://services6.arcgis.com/ubm4tcTYICKBpist/arcgis/rest/services/BCWS_FirePerimeters_PublicView/FeatureServer/0/",
"AGOLactiveFirest": "https://services6.arcgis.com/ubm4tcTYICKBpist/ArcGIS/rest/services/BCWS_ActiveFires_PublicView/FeatureServer/0/",
"AGOLfireCentres": "https://services6.dev.bcwildfireservices.com/ubm4tcTYICKBpist/ArcGIS/rest/services/British_Columbia_Fire_Centre_Boundaries/FeatureServer/0/query?where=1%3D1&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&relationParam=&returnGeodetic=false&outFields=*&returnGeometry=false&returnCentroid=false&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&defaultSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=pjson&token=",
"AGOLevacOrders": "https://services6.dev.bcwildfireservices.com/ubm4tcTYICKBpist/ArcGIS/rest/services/test_Emrg_Orders_and_Alerts/FeatureServer/0",
"AGOLareaRestrictions": "https://services6.dev.bcwildfireservices.com/ubm4tcTYICKBpist/ArcGIS/rest/services/test_British_Columbia_Area_Restrictions/FeatureServer/0",
"AGOLBansAndProhibitions": "https://services6.dev.bcwildfireservices.com/ubm4tcTYICKBpist/ArcGIS/rest/services/test_British_Columbia_Bans_and_Prohibition_Areas/FeatureServer/0/",
"AGOLDangerRatings": "https://services6.dev.bcwildfireservices.com/ubm4tcTYICKBpist/ArcGIS/rest/services/test_British_Columbia_Danger_Rating/FeatureServer/0/",
"AGOLperimetres": "https://services6.dev.bcwildfireservices.com/ubm4tcTYICKBpist/arcgis/rest/services/BCWS_FirePerimeters_PublicView/FeatureServer/0/",
"AGOLactiveFirest": "https://services6.dev.bcwildfireservices.com/ubm4tcTYICKBpist/ArcGIS/rest/services/BCWS_ActiveFires_PublicView/FeatureServer/0/",
"evacDefaultUrl": "https://www.emergencyinfobc.gov.bc.ca/current-wildfire-information-2023",
"evacDefaultBulletin": "https://www.emergencyinfobc.gov.bc.ca",
"contactInformation": {
Expand Down Expand Up @@ -126,6 +126,7 @@

"mapServices": {
"openmapsBaseUrl": "https://maps.dev.bcwildfireservices.com/geo/pub/ows",
"services6BaseUrl": "https://services6.dev.bcwildfireservices.com",
"#openmapsBaseUrl": "https://openmaps.gov.bc.ca/geo/pub/ows",
"drivebcBaseUrl": "https://dev-maps.th.gov.bc.ca/geoV05/ows",
"#wfnews": "http://localhost:1338",
Expand Down
12 changes: 9 additions & 3 deletions client/wfnews-war/src/main/webapp/config.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@
json.append("\"bcWildfireResponsePage\":\"").append("https://www2.gov.bc.ca/gov/content/safety/wildfire-status/wildfire-response/wildfire-personnel-and-response-tools").append("\",");
json.append("\"appStoreUrl\":\"").append(properties.getProperty("appStoreUrl", "")).append("\",");
json.append("\"googlePlayUrl\":\"").append(properties.getProperty("googlePlayUrl", "")).append("\",");
json.append("\"AGOLfireCentres\":\"").append("https://services6.arcgis.com/ubm4tcTYICKBpist/ArcGIS/rest/services/British_Columbia_Fire_Centre_Boundaries/FeatureServer/0/query?where=1%3D1&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&relationParam=&returnGeodetic=false&outFields=*&returnGeometry=false&returnCentroid=false&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&defaultSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=pjson&token=").append("\",");
json.append("\"AGOLfireCentres\":\"").append(services6).append("/ubm4tcTYICKBpist/ArcGIS/rest/services/British_Columbia_Fire_Centre_Boundaries/FeatureServer/0/query?where=1%3D1&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&relationParam=&returnGeodetic=false&outFields=*&returnGeometry=false&returnCentroid=false&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&defaultSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=pjson&token=").append("\",");
json.append("\"AGOLevacOrders\":\"").append(agolEvacOrders).append("\",");
json.append("\"AGOLareaRestrictions\":\"").append(agolAreaRestrictions).append("\",");
json.append("\"AGOLBansAndProhibitions\":\"").append(agolBansAndProhibitions).append("\",");
json.append("\"AGOLDangerRatings\":\"").append(agolDangerRatings).append("\",");
json.append("\"AGOLperimetres\":\"").append("https://services6.arcgis.com/ubm4tcTYICKBpist/arcgis/rest/services/BCWS_FirePerimeters_PublicView/FeatureServer/0/").append("\",");
json.append("\"AGOLactiveFirest\":\"").append("https://services6.arcgis.com/ubm4tcTYICKBpist/ArcGIS/rest/services/BCWS_ActiveFires_PublicView/FeatureServer/0/").append("\",");
json.append("\"AGOLperimetres\":\"").append(services6).append("/ubm4tcTYICKBpist/arcgis/rest/services/BCWS_FirePerimeters_PublicView/FeatureServer/0/").append("\",");
json.append("\"AGOLactiveFirest\":\"").append(services6).append("/ubm4tcTYICKBpist/ArcGIS/rest/services/BCWS_ActiveFires_PublicView/FeatureServer/0/").append("\",");
json.append("\"evacDefaultUrl\":\"").append("https://www.emergencyinfobc.gov.bc.ca/current-wildfire-information-2023").append("\",");
json.append("\"evacDefaultBulletin\":\"").append("https://www.emergencyinfobc.gov.bc.ca").append("\",");
json.append("\"currentRestrictions\":\"").append("https://www2.gov.bc.ca/gov/content/safety/wildfire-status/prevention/fire-bans-and-restrictions").append("\",");
Expand Down Expand Up @@ -121,9 +121,15 @@
openmaps = openmaps.substring(0, openmaps.length() - 1); //Strip off trailing slash, if it exists.
}

String services6 = EnvironmentVariable.getVariable("SERVICES6_BASE_URL");
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this needs to be moved above line 69, otherwise will it be defined there?

if (services6 != null && services6.endsWith("/")) {
services6 = services6.substring(0, services6.length() - 1); //Strip off trailing slash, if it exists.
}

// External Application Section
json.append("\"mapServices\":{");
json.append("\"openmapsBaseUrl\":\"").append(openmaps).append("\"").append(",");
json.append("\"services6BaseUrl\":\"").append(services6).append("\"").append(",");
json.append("\"wfnews\":\"").append(wfnewsUri).append("\"").append(",");
json.append("\"drivebcBaseUrl\":\"").append(driveBc).append("\"");
json.append("},");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ wfone.email.sync.send.frequency=#{wfone.email.sync.send.frequency}
wfone.email.sync.error.subject=#{wfone.email.sync.error.subject}
wfone.email.sync.subject=#{wfone.email.sync.subject}
wfone.default.application.environment=#{wfone.default.application.environment}
wfnews-agol-query.url=https://services6.arcgis.com/ubm4tcTYICKBpist/ArcGIS/rest/services/BCWS_ActiveFires_PublicView/FeatureServer/0/query?where=FIRE_STATUS+%3C%3E+'OUT'
wfnews-agol-query.url=https://services6.dev.bcwildfireservices.com/ubm4tcTYICKBpist/ArcGIS/rest/services/BCWS_ActiveFires_PublicView/FeatureServer/0/query?where=FIRE_STATUS+%3C%3E+'OUT'
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ wfone.datasource.url=#{WFNEWS_DB_URL}
wfone.datasource.username=#{WFNEWS_DB_USERNAME}
wfone.datasource.password=#{WEBADE_OAUTH2_WFNEWS_REST_CLIENT_SECRET}
wfone.datasource.max.connections=#{WFNEWS_DB_MAX_CONNECTIONS}
wfnews-agol-query.url=https://services6.arcgis.com/ubm4tcTYICKBpist/ArcGIS/rest/services/BCWS_ActiveFires_PublicView/FeatureServer/0/query?where=FIRE_STATUS+%3C%3E+'OUT'
wfnews-agol-query.url=https://services6.dev.bcwildfireservices.com/ubm4tcTYICKBpist/ArcGIS/rest/services/BCWS_ActiveFires_PublicView/FeatureServer/0/query?where=FIRE_STATUS+%3C%3E+'OUT'
Loading