Commit c984e4dba60a7793cd3e5bc9d8471927bfa4f837
1 parent
5691a577
virtual page fix
Showing
5 changed files
with
56 additions
and
0 deletions
Show diff stats
src/app/app.module.ts
@@ -36,6 +36,7 @@ import { RoadComponent } from './data/road/road.component'; | @@ -36,6 +36,7 @@ import { RoadComponent } from './data/road/road.component'; | ||
36 | import { RoadServiceComponent } from './data/road-service/road-service.component'; | 36 | import { RoadServiceComponent } from './data/road-service/road-service.component'; |
37 | import { SettlementAddressLinkComponent } from './data/settlement-address-link/settlement-address-link.component'; | 37 | import { SettlementAddressLinkComponent } from './data/settlement-address-link/settlement-address-link.component'; |
38 | import { MapComponent } from './data/map/map.component'; | 38 | import { MapComponent } from './data/map/map.component'; |
39 | +import { MapItemsComponent } from './data/map-items/map-items-component'; | ||
39 | 40 | ||
40 | // Services | 41 | // Services |
41 | import { BusStopCreateService } from '../services/bus-stop-create.service'; | 42 | import { BusStopCreateService } from '../services/bus-stop-create.service'; |
@@ -79,6 +80,7 @@ const httpInterceptorProviders: Type<any>[] = [ | @@ -79,6 +80,7 @@ const httpInterceptorProviders: Type<any>[] = [ | ||
79 | RendererComponent, | 80 | RendererComponent, |
80 | MapEditorComponent, | 81 | MapEditorComponent, |
81 | MapRendererComponent, | 82 | MapRendererComponent, |
83 | + MapItemsComponent, | ||
82 | RoadWidthComponent, | 84 | RoadWidthComponent, |
83 | RoadToCategoryComponent, | 85 | RoadToCategoryComponent, |
84 | FlowIntensityComponent, | 86 | FlowIntensityComponent, |
src/app/data/bus-stop/bus-stop.component.html
1 | +<map-items [position]="position" ></map-items> | ||
1 | <div class="grid_containert" *ngIf="showGrid"> | 2 | <div class="grid_containert" *ngIf="showGrid"> |
2 | <ag-grid-ng2 #agGrid style="width: 100%; height: 100%;" class="ag-blue" [gridOptions]="gridOptions" [columnDefs]="columnDefs" [rowData]="rowData" enableColResize enableSorting enableFilter groupHeaders suppressRowClickSelection toolPanelSuppressGroups | 3 | <ag-grid-ng2 #agGrid style="width: 100%; height: 100%;" class="ag-blue" [gridOptions]="gridOptions" [columnDefs]="columnDefs" [rowData]="rowData" enableColResize enableSorting enableFilter groupHeaders suppressRowClickSelection toolPanelSuppressGroups |
3 | toolPanelSuppressValues debug rowHeight="22" rowSelection="multiple" (cellClicked)="onCellClicked($event)" (cellDoubleClicked)="onCellDoubleClicked($event)" (cellContextMenu)="onCellContextMenu($event)" (cellValueChanged)="onCellValueChanged($event)" | 4 | toolPanelSuppressValues debug rowHeight="22" rowSelection="multiple" (cellClicked)="onCellClicked($event)" (cellDoubleClicked)="onCellDoubleClicked($event)" (cellContextMenu)="onCellContextMenu($event)" (cellValueChanged)="onCellValueChanged($event)" |
src/app/data/bus-stop/bus-stop.component.ts
@@ -36,6 +36,7 @@ export class BusStopComponent extends StatementBase { | @@ -36,6 +36,7 @@ export class BusStopComponent extends StatementBase { | ||
36 | public settlements: SettlementSelectList[]; | 36 | public settlements: SettlementSelectList[]; |
37 | public roads: RoadSelectList[]; | 37 | public roads: RoadSelectList[]; |
38 | public boolean: BooleanSelectList[]; | 38 | public boolean: BooleanSelectList[]; |
39 | + public position: string; | ||
39 | 40 | ||
40 | constructor( | 41 | constructor( |
41 | protected service: BusStopService, | 42 | protected service: BusStopService, |
@@ -44,6 +45,7 @@ export class BusStopComponent extends StatementBase { | @@ -44,6 +45,7 @@ export class BusStopComponent extends StatementBase { | ||
44 | protected loadingService: TdLoadingService, | 45 | protected loadingService: TdLoadingService, |
45 | ) { | 46 | ) { |
46 | super(); | 47 | super(); |
48 | + this.position = '51.513015907156756,-0.10334014892578126'; | ||
47 | } | 49 | } |
48 | 50 | ||
49 | protected createColumnDefs(): any[] { | 51 | protected createColumnDefs(): any[] { |
@@ -201,4 +203,9 @@ export class BusStopComponent extends StatementBase { | @@ -201,4 +203,9 @@ export class BusStopComponent extends StatementBase { | ||
201 | this.bootstrapGrid(); | 203 | this.bootstrapGrid(); |
202 | }); | 204 | }); |
203 | } | 205 | } |
206 | + | ||
207 | + protected onCellFocused($event: any): void { | ||
208 | + console.log($event); | ||
209 | + } | ||
210 | + | ||
204 | } | 211 | } |
1 | +import { Component, Input, Output, OnInit } from '@angular/core'; | ||
2 | +import * as L from 'leaflet'; | ||
3 | +@Component({ | ||
4 | + selector: 'map-items', | ||
5 | + template:` | ||
6 | + <div class="map-items"> | ||
7 | + <div id="mapItemsId"></div> | ||
8 | + </div>`, | ||
9 | + styleUrls: ['map-items.scss'] | ||
10 | +}) | ||
11 | + | ||
12 | +export class MapItemsComponent{ | ||
13 | + @Input() position: string; | ||
14 | + public map: L.Map; | ||
15 | + public icon: L.Icon; | ||
16 | + constructor() { | ||
17 | + this.icon = L.icon({ | ||
18 | + iconUrl: '/assets/icons/marker-icon.png', | ||
19 | + iconSize: [25, 41], // size of the icon | ||
20 | + popupAnchor: [-3, -76], // point from which the popup should open relative to the iconAnchor | ||
21 | + }); | ||
22 | + this.map = L.map('mapItemsId').setView([51.505, -0.09], 13); | ||
23 | + L.tileLayer('https://a.tile.openstreetmap.org/{z}/{x}/{y}.png', { | ||
24 | + maxZoom: 18, | ||
25 | + }).addTo(this.map); | ||
26 | + if(this.position != null){ | ||
27 | + let options = { | ||
28 | + draggable:true, | ||
29 | + icon: this.icon, | ||
30 | + }; | ||
31 | + let latLng = this.position.split(','); | ||
32 | + let marker = L.marker(new L.LatLng(parseInt(latLng[0]),parseInt(latLng[1])),options); | ||
33 | + this.map.addLayer(marker); | ||
34 | + | ||
35 | + } | ||
36 | + } | ||
37 | +} | ||
0 | \ No newline at end of file | 38 | \ No newline at end of file |