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

fix: switch out SGID-based UTA data for UTA's portal #357

Merged
merged 6 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"firebaserc",
"GOED",
"hostingchannels",
"lightrail",
"lyrs",
"prebuild",
"QUALTRICS",
"seiyria",
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [2.5.15-0](https://github.com/agrc/locate/compare/v2.5.14...v2.5.15-0) (2024-08-19)


### Bug Fixes

* switch out SGID-based UTA data for UTA's portal ([813be19](https://github.com/agrc/locate/commit/813be19e00ab2df351f30a5cb6ba6105cabf2a28))

## [2.5.14](https://github.com/agrc/locate/compare/v2.5.13...v2.5.14) (2024-07-15)


Expand Down
8 changes: 4 additions & 4 deletions lib/app/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,17 @@ define([
};

// lightrail rail (hidden)
var hiddenCheckbox = query('.layer input[value="16"]')[0];
var hiddenCheckbox = query('.layer input[value="lightrail rail (hidden)"]')[0];
// Commuter Rail
var lrCheckbox = query('.layer input[value="15"]')[0];
var lrCheckbox = query('.layer input[value="Commuter Rail"]')[0];
on(lrCheckbox, 'change', lang.partial(syncCheckbox, hiddenCheckbox));

// commuter rail (hidden)
hiddenCheckbox = query('.layer input[value="22"]')[0];
hiddenCheckbox = query('.layer input[value="commuter rail (hidden)"]')[0];
on(lrCheckbox, 'change', lang.partial(syncCheckbox, hiddenCheckbox));

// commuter rail stations (hidden)
hiddenCheckbox = query('.layer input[value="21"]')[0];
hiddenCheckbox = query('.layer input[value="commuter rail stations (hidden)"]')[0];
on(lrCheckbox, 'change', lang.partial(syncCheckbox, hiddenCheckbox));

// same thing for airports layers
Expand Down
28 changes: 24 additions & 4 deletions lib/app/Layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,14 @@ define([
// For dynamic layers could be multiple ids
// separated by a comma e.g. 2, 3, 4
// For feature layers this is always a single value
// This property is mutually exclusive with url
layerId: null,

// url: String
// The url to the feature service
// This property is mutually exclusive with layerId
url: null,

// onByDefault: Boolean (optional)
onByDefault: false,

Expand All @@ -92,6 +98,17 @@ define([
// cachedServiceUrl to the cached map service
cachedServiceUrl: null,

checkBoxValue: null,


postMixInProperties: function () {
// enforce mutual exclusivity for layerId and url
if (this.layerId && this.url) {
throw new Error('layerId and url are mutually exclusive');
}

this.checkboxValue = this.layerId || this.name;
},

postCreate: function () {
// summary:
Expand Down Expand Up @@ -144,7 +161,7 @@ define([
onRouterToggleLayers(lyrs) {
console.log('app/Layer:onRouterToggleLayers', arguments);

var vis = lyrs.indexOf(this.layerId) !== -1;
var vis = lyrs.indexOf(this.checkboxValue) !== -1;
this.checkbox.checked = vis;
this.toggleLayer(vis);
},
Expand Down Expand Up @@ -184,7 +201,7 @@ define([
this.markerHeight || config.markerSymbolHeight
);
markerSymbol.setOffset(0, config.markerSymbolHeight / 2);
this.layer = new FeatureLayer(config.urls.mapService + '/' + this.layerId, {
this.layer = new FeatureLayer(this.getUrl(), {
outFields: ['*']
});
this.layer.setRenderer(new SimpleRenderer(markerSymbol));
Expand All @@ -205,7 +222,7 @@ define([
break;
case 'polygon':
if (!this.layer) {
this.layer = new FeatureLayer(config.urls.mapService + '/' + this.layerId, {
this.layer = new FeatureLayer(this.getUrl(), {
outFields: ['*'],
opacity: this.defaultOpacity || 0.5
});
Expand Down Expand Up @@ -252,7 +269,7 @@ define([
);
lineSymbol.setColor(new Color(this.color));
lineSymbol.setWidth(6);
this.layer = new FeatureLayer(config.urls.mapService + '/' + this.layerId, {
this.layer = new FeatureLayer(this.getUrl(), {
outFields: ['*']
});
this.layer.setRenderer(new SimpleRenderer(lineSymbol));
Expand Down Expand Up @@ -280,6 +297,9 @@ define([
break;
}
topic.publish(config.topics.router.updateLayer);
},
getUrl: function () {
return this.url || config.urls.mapService + '/' + this.layerId;
}
});
});
19 changes: 11 additions & 8 deletions lib/app/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ define([
apiKey = 'AGRC-FE1B257E901672';
quadWord = 'wedding-tactic-enrico-yes';
} else {
// localhost
// local development
domain = 'https://mapserv.dev.utah.gov/';
}
var baseUrl = domain + 'arcgis/rest/services/BBEcon/';

Expand Down Expand Up @@ -233,37 +234,39 @@ define([
defaultOpacity: 1,
color: '#E09525'
}, {
// if you change name make sure to change the code in
// app/App:postCreate as well
name: 'Commuter Rail',
type: 'feature',
layerId: '15',
url: 'https://maps.rideuta.com/server/rest/services/Hosted/TRAX_Light_Rail_Stations/FeatureServer/0',
marker: 'lightrail.svg'
}, {
// this is hidden and linked to Commuter rail above
// if you change the layerId make sure to change the code in
// if you change name make sure to change the code in
// app/App:postCreate as well
name: 'lightrail rail (hidden)',
type: 'line',
layerId: '16',
url: 'https://maps.rideuta.com/server/rest/services/Hosted/UTA_TRAX_Light_Rail_Routes/FeatureServer/0',
defaultOpacity: 1,
hidden: true,
color: '#AD6F29'
}, {
// this is hidden and linked to Commuter rail above
// if you change the layerId make sure to change the code in
// if you change name make sure to change the code in
// app/App:postCreate as well
name: 'commuter rail (hidden)',
type: 'line',
layerId: '22',
url: 'https://maps.rideuta.com/server/rest/services/Hosted/UTA_FrontRunner_Commuter_Rail_Centerline/FeatureServer/0',
defaultOpacity: 1,
hidden: true,
color: '#AD6F29'
}, {
// this is hidden and linked to Commuter rail above
// if you change the layerId make sure to change the code in
// if you change name make sure to change the code in
// app/App:postCreate as well
name: 'commuter rail stations (hidden)',
type: 'feature',
layerId: '21',
url: 'https://maps.rideuta.com/server/rest/services/Hosted/FrontRunnerStations/FeatureServer/0',
marker: 'lightrail.svg',
hidden: true
}, {
Expand Down
2 changes: 1 addition & 1 deletion lib/app/templates/Layer.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<li class='checkbox'>
<input type="checkbox" id='${id}_chbx'
data-dojo-attach-point='checkbox' value='${layerId}'>
data-dojo-attach-point='checkbox' value='${checkboxValue}'>
<label for='${id}_chbx' data-dojo-attach-point='label'>
${name}
<div data-dojo-attach-point='tooltip' data-toggle="tooltip" class='hidden'>
Expand Down
Binary file modified maps/Maps.aprx
Binary file not shown.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "locate",
"version": "2.5.14",
"version": "2.5.15-0",
"homepage": "https://github.com/agrc/locate",
"repository": {
"type": "git",
Expand Down
4 changes: 0 additions & 4 deletions scripts/locate_pallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ def build(self, target):
self.add_crate(('ZoomLocations', self.sgid, self.location))

self.add_crates(['AirportLocations',
'CommuterRailRoutes_UTA',
'CommuterRailStations_UTA',
'LightRailStations_UTA',
'LightRail_UTA',
'Railroads',
'Roads'],
{'source_workspace': self.sgid,
Expand Down