Skip to content

Commit

Permalink
Merge pull request #1201 from NYCPlanning/develop
Browse files Browse the repository at this point in the history
Merging feature enhancements to master for prod release
  • Loading branch information
TylerMatteo authored May 23, 2024
2 parents f7135f1 + 82c2274 commit d38d5dd
Show file tree
Hide file tree
Showing 50 changed files with 1,307 additions and 125 deletions.
31 changes: 31 additions & 0 deletions app/components/default-modal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import Component from '@ember/component';

const TOTAL_SLIDES = 7;

export default Component.extend({
tagName: '',
open: true,
slideNumber: Math.floor(Math.random() * TOTAL_SLIDES) + 1, // start on a random slide

actions: {
toggleModal() {
this.toggleProperty('open');
},
nextSlide() {
if (this.slideNumber < TOTAL_SLIDES) {
this.set('slideNumber', this.slideNumber + 1);
} else {
// comment out the line below to disable infinite looping
this.set('slideNumber', 1);
}
},
prevSlide() {
if (this.slideNumber > 1) {
this.set('slideNumber', this.slideNumber - 1);
} else {
// comment out the line below to disable infinite looping
this.set('slideNumber', TOTAL_SLIDES);
}
},
},
});
53 changes: 52 additions & 1 deletion app/components/layer-record-views/tax-lot.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import carto from 'labs-zola/utils/carto';
import config from 'labs-zola/config/environment';
import { inject as service } from '@ember/service';
import { action } from '@ember/object';
import bblDemux from 'labs-zola/utils/bbl-demux';
import LayerRecordComponent from './-base';

const { specialDistrictCrosswalk } = config;
Expand Down Expand Up @@ -310,6 +313,38 @@ const landuseLookup = {
};

export default class TaxLotRecordComponent extends LayerRecordComponent {
@service router;

@service mainMap;

@action
linkToLotComparison() {
this.router.transitionTo(
'map-feature.lot-comparison',
this.model.borocode,
this.model.block,
this.model.lot,
0,
0,
0
);
}

@action
removeLotFromComparison(otherModelId) {
this.set('mainMap.comparisonSelected', null);
const { boro, block, lot } = bblDemux(otherModelId);
this.router.transitionTo(
'map-feature.lot-comparison',
boro,
block,
lot,
0,
0,
0
);
}

get bldgclassname() {
return bldgclassLookup[this.model.bldgclass];
}
Expand All @@ -325,6 +360,13 @@ export default class TaxLotRecordComponent extends LayerRecordComponent {
return `${boroLookup[cdborocode]} Community District ${cd}`;
}

get boroSlashCd() {
const borocd = this.model.cd;
const cdborocode = `${borocd}`.substring(0, 1);
const cd = parseInt(`${borocd}`.substring(1, 3), 10).toString();
return `${boroLookup[cdborocode].replace(' ', '-').toLowerCase()}/${cd}`;
}

get cdURLSegment() {
const borocd = this.model.cd;
const borocode = this.model.borocode; // eslint-disable-line prefer-destructuring
Expand All @@ -333,6 +375,13 @@ export default class TaxLotRecordComponent extends LayerRecordComponent {
return `${cleanBorough}/${cd}`;
}

get googleMapsURL() {
const encodedAddress = encodeURIComponent(
`${this.model.address}, ${this.model.zipcode}`
);
return `https://www.google.com/maps/search/?api=1&query=${encodedAddress}`;
}

get landusename() {
return landuseLookup[this.model.landuse];
}
Expand Down Expand Up @@ -441,7 +490,9 @@ export default class TaxLotRecordComponent extends LayerRecordComponent {
}

get digitalTaxMapLink() {
return `https://propertyinformationportal.nyc.gov/parcels/${this.model.condono ? 'condo' : 'parcel'}/${this.model.bbl}`;
return `https://propertyinformationportal.nyc.gov/parcels/${
this.model.condono ? 'condo' : 'parcel'
}/${this.model.bbl}`;
}

get zoningMapLink() {
Expand Down
11 changes: 10 additions & 1 deletion app/components/main-header.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
import Component from '@ember/component';
import { inject as service } from '@ember/service';
import { computed } from '@ember/object';
import { tracked } from '@glimmer/tracking';

export default class MainHeaderComponent extends Component {
@service('print') printSvc;

@service() media;

bookmarks;
@tracked bookmarks;

@tracked savedLayerSets;

@computed('bookmarks.length', 'savedLayerSets.length')
get totalBookmarks() {
return this.bookmarks.length + this.savedLayerSets.length;
}
}
38 changes: 35 additions & 3 deletions app/components/main-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ import { alias } from '@ember/object/computed';
import bblDemux from '../utils/bbl-demux';
import drawnFeatureLayers from '../layers/drawn-feature';
import selectedLayers from '../layers/selected-lot';
import comparisonSelectedLayers from '../layers/comparison-selected-lot';

const selectedFillLayer = selectedLayers.fill;
const selectedLineLayer = selectedLayers.line;

const comparisonSelectedFillLayer = comparisonSelectedLayers.fill;
const comparisonSelectedLineLayer = comparisonSelectedLayers.line;

// Custom Control
const MeasurementText = function () {};

Expand Down Expand Up @@ -54,7 +58,7 @@ export default class MainMap extends Component {

highlightedLayerId = null;

widowResize() {
windowResize() {
return new Promise((resolve) => {
setTimeout(() => {
const resizeEvent = window.document.createEvent('UIEvents');
Expand Down Expand Up @@ -114,6 +118,15 @@ export default class MainMap extends Component {
};
}

@computed('mainMap.comparisonSelected')
get comparisonSelectedLotSource() {
const comparisonSelected = this.get('mainMap.comparisonSelected');
return {
type: 'geojson',
data: comparisonSelected.get('geometry'),
};
}

@computed('mainMap.drawMode')
get interactivity() {
const drawMode = this.get('mainMap.drawMode');
Expand All @@ -124,6 +137,10 @@ export default class MainMap extends Component {

selectedLineLayer = selectedLineLayer;

comparisonSelectedFillLayer = comparisonSelectedFillLayer;

comparisonSelectedLineLayer = comparisonSelectedLineLayer;

@action
handleMapLoad(map) {
window.map = map;
Expand Down Expand Up @@ -211,7 +228,22 @@ export default class MainMap extends Component {
if (bbl && !ceqr_num) {
// eslint-disable-line
const { boro, block, lot } = bblDemux(bbl);
this.router.transitionTo('map-feature.lot', boro, block, lot);
if (this.router.currentRoute.name === 'map-feature.lot-comparison') {
if (!this.mainMap.comparisonSelected) {
this.mainMap.set('comparisonSelected', this.mainMap.selected);
}
this.router.transitionTo(
'map-feature.lot-comparison',
this.router.currentRoute.params.boro,
this.router.currentRoute.params.block,
this.router.currentRoute.params.lot,
boro,
block,
lot
);
} else {
this.router.transitionTo('map-feature.lot', boro, block, lot);
}
}

if (ulurpno) {
Expand Down Expand Up @@ -273,6 +305,6 @@ export default class MainMap extends Component {

this.set('printSvc.enabled', true);

await this.widowResize();
await this.windowResize();
}
}
Loading

0 comments on commit d38d5dd

Please sign in to comment.