From 9a7417808c326a0df98bfd2db44d77469e666683 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Fri, 24 Feb 2017 16:08:15 +0200 Subject: [PATCH] virtual page fix --- src/app/data/bus-stop/bus-stop.component.html | 1 + src/app/data/bus-stop/bus-stop.component.ts | 8 ++++---- src/app/data/map-items/map-items.component.ts | 25 +++++++++++++++---------- src/app/data/map-items/map-items.scss | 4 +++- 4 files changed, 23 insertions(+), 15 deletions(-) diff --git a/src/app/data/bus-stop/bus-stop.component.html b/src/app/data/bus-stop/bus-stop.component.html index 9058582..bd999c4 100644 --- a/src/app/data/bus-stop/bus-stop.component.html +++ b/src/app/data/bus-stop/bus-stop.component.html @@ -7,6 +7,7 @@
+
diff --git a/src/app/data/bus-stop/bus-stop.component.ts b/src/app/data/bus-stop/bus-stop.component.ts index b1b1f42..b9da32e 100644 --- a/src/app/data/bus-stop/bus-stop.component.ts +++ b/src/app/data/bus-stop/bus-stop.component.ts @@ -29,14 +29,13 @@ import { routerTransition } from '../../../animations/router.animation'; encapsulation: ViewEncapsulation.None, }) export class BusStopComponent extends StatementBase { - @ViewChild(MapItemsComponent) mapItems: MapItemsComponent + @ViewChild(MapItemsComponent) mapItems: MapItemsComponent; public regions: RegionSelectList[]; public states: StateCommonSelectList[]; public surfaceTypes: SurfaceTypeSelectList[]; public settlements: SettlementSelectList[]; public roads: RoadSelectList[]; public boolean: BooleanSelectList[]; - public position: string; constructor( protected service: BusStopService, @@ -45,9 +44,10 @@ export class BusStopComponent extends StatementBase { protected loadingService: TdLoadingService, ) { super(); - this.position = '51.513015907156756,-0.10334014892578126'; } - + public showOnMap(): void { + this.mapItems.showMap(); + } protected createColumnDefs(): any[] { return [ { diff --git a/src/app/data/map-items/map-items.component.ts b/src/app/data/map-items/map-items.component.ts index 723f1e7..0994bff 100644 --- a/src/app/data/map-items/map-items.component.ts +++ b/src/app/data/map-items/map-items.component.ts @@ -3,7 +3,7 @@ import * as L from 'leaflet'; @Component({ selector: 'map-items', template:` -
+
`, styleUrls: ['map-items.scss'] @@ -14,16 +14,9 @@ export class MapItemsComponent implements OnInit{ public map: L.Map; public icon: L.Icon; public markersGroup: L.FeatureGroup; + public show = false; ngOnInit(){ - this.icon = L.icon({ - iconUrl: '/assets/icons/marker-icon.png', - iconSize: [25, 41], // size of the icon - popupAnchor: [-3, -76], // point from which the popup should open relative to the iconAnchor - }); - this.map = L.map('mapItemsId').setView([51.505, -0.09], 13); - L.tileLayer('https://a.tile.openstreetmap.org/{z}/{x}/{y}.png', { - maxZoom: 18, - }).addTo(this.map); + // if(this.position != null){ // let options = { // draggable:true, @@ -36,6 +29,18 @@ export class MapItemsComponent implements OnInit{ // } } + showMap(){ + this.show = true; + this.icon = L.icon({ + iconUrl: '/assets/icons/marker-icon.png', + iconSize: [25, 41], // size of the icon + popupAnchor: [-3, -76], // point from which the popup should open relative to the iconAnchor + }); + this.map = L.map('mapItemsId').setView([51.505, -0.09], 13); + L.tileLayer('https://a.tile.openstreetmap.org/{z}/{x}/{y}.png', { + maxZoom: 18, + }).addTo(this.map); + } refreshMap(rows): void{ if(this.markersGroup != null){ this.map.removeLayer(this.markersGroup); diff --git a/src/app/data/map-items/map-items.scss b/src/app/data/map-items/map-items.scss index 5c5678f..5c5429c 100644 --- a/src/app/data/map-items/map-items.scss +++ b/src/app/data/map-items/map-items.scss @@ -1,9 +1,11 @@ .map-items{ height: 50%; - position: relative; } #mapItemsId{ height: 100%; width: 100%; +} +.show{ + // height: 50%; } \ No newline at end of file -- libgit2 0.21.4