Commit c984e4dba60a7793cd3e5bc9d8471927bfa4f837

Authored by Administrator
1 parent 5691a577

virtual page fix

src/app/app.module.ts
... ... @@ -36,6 +36,7 @@ import { RoadComponent } from './data/road/road.component';
36 36 import { RoadServiceComponent } from './data/road-service/road-service.component';
37 37 import { SettlementAddressLinkComponent } from './data/settlement-address-link/settlement-address-link.component';
38 38 import { MapComponent } from './data/map/map.component';
  39 +import { MapItemsComponent } from './data/map-items/map-items-component';
39 40  
40 41 // Services
41 42 import { BusStopCreateService } from '../services/bus-stop-create.service';
... ... @@ -79,6 +80,7 @@ const httpInterceptorProviders: Type<any>[] = [
79 80 RendererComponent,
80 81 MapEditorComponent,
81 82 MapRendererComponent,
  83 + MapItemsComponent,
82 84 RoadWidthComponent,
83 85 RoadToCategoryComponent,
84 86 FlowIntensityComponent,
... ...
src/app/data/bus-stop/bus-stop.component.html
  1 +<map-items [position]="position" ></map-items>
1 2 <div class="grid_containert" *ngIf="showGrid">
2 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 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 36 public settlements: SettlementSelectList[];
37 37 public roads: RoadSelectList[];
38 38 public boolean: BooleanSelectList[];
  39 + public position: string;
39 40  
40 41 constructor(
41 42 protected service: BusStopService,
... ... @@ -44,6 +45,7 @@ export class BusStopComponent extends StatementBase {
44 45 protected loadingService: TdLoadingService,
45 46 ) {
46 47 super();
  48 + this.position = '51.513015907156756,-0.10334014892578126';
47 49 }
48 50  
49 51 protected createColumnDefs(): any[] {
... ... @@ -201,4 +203,9 @@ export class BusStopComponent extends StatementBase {
201 203 this.bootstrapGrid();
202 204 });
203 205 }
  206 +
  207 + protected onCellFocused($event: any): void {
  208 + console.log($event);
  209 + }
  210 +
204 211 }
... ...
src/app/data/map-items/map-items-component.ts 0 → 100644
  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 38 \ No newline at end of file
... ...
src/app/data/map-items/map-items.scss 0 → 100644
  1 +.map-items{
  2 + height: 50%;
  3 + position: relative;
  4 +}
  5 +
  6 +#mapItemsId{
  7 + height: 100%;
  8 + width: 100%;
  9 +}
0 10 \ No newline at end of file
... ...