From 542cea4d90779fe7a30582d7345bdd75662a2b5a Mon Sep 17 00:00:00 2001 From: Adrian Lara Date: Wed, 14 Oct 2020 09:43:52 -0400 Subject: [PATCH] Inventory map page tweaks - fix axis order - show extra_data to help with analysis --- src/app/map/map.component.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/app/map/map.component.ts b/src/app/map/map.component.ts index 3ada372..95e8c8d 100644 --- a/src/app/map/map.component.ts +++ b/src/app/map/map.component.ts @@ -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); @@ -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); @@ -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) + }); + } }) } }