Skip to content

Commit

Permalink
Inventory map page tweaks
Browse files Browse the repository at this point in the history
- fix axis order
- show extra_data to help with analysis
  • Loading branch information
Adrian Lara committed Oct 14, 2020
1 parent 84bd0d3 commit 542cea4
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/app/map/map.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ export class MapComponent implements OnInit {
values[0].forEach(property => {
if (property.footprint) {
const footprintCoords = property.footprint.coordinates[0].map(coords => {
return new Microsoft.Maps.Location(...coords)
return new Microsoft.Maps.Location(...coords.reverse())
})
const polygon = new Microsoft.Maps.Polygon(footprintCoords);
const infobox = new Microsoft.Maps.Infobox(footprintCoords[0], {
title: 'Property Information',
description: property.ubid,
description: JSON.stringify(property.extra_data),
visible: false
});
infobox.setMap(this.map);
Expand All @@ -80,12 +80,12 @@ export class MapComponent implements OnInit {
values[1].forEach(taxlot => {
if (taxlot.footprint) {
const footprintCoords = taxlot.footprint.coordinates[0].map(coords => {
return new Microsoft.Maps.Location(...coords)
return new Microsoft.Maps.Location(...coords.reverse())
})
const polygon = new Microsoft.Maps.Polygon(footprintCoords, this.styles.polygonOptions);
const infobox = new Microsoft.Maps.Infobox(footprintCoords[0], {
title: 'Tax Lot Information',
description: taxlot.ulid,
description: JSON.stringify(taxlot.extra_data),
visible: false
});
infobox.setMap(this.map);
Expand All @@ -106,10 +106,12 @@ export class MapComponent implements OnInit {
this.map.layers.insert(propertyLayer);
this.map.layers.insert(taxlotLayer);

// allFootprints used because can't find attribute of map or layers to get shapes
this.map.setView({
bounds: new Microsoft.Maps.LocationRect.fromShapes(allFootprints)
})
if (allFootprints.length) {
// allFootprints used because can't find attribute of map or layers to get shapes
this.map.setView({
bounds: new Microsoft.Maps.LocationRect.fromShapes(allFootprints)
});
}
})
}
}

0 comments on commit 542cea4

Please sign in to comment.