From c984e4dba60a7793cd3e5bc9d8471927bfa4f837 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Wed, 22 Feb 2017 19:02:24 +0200 Subject: [PATCH] virtual page fix --- src/app/app.module.ts | 2 ++ src/app/data/bus-stop/bus-stop.component.html | 1 + src/app/data/bus-stop/bus-stop.component.ts | 7 +++++++ src/app/data/map-items/map-items-component.ts | 37 +++++++++++++++++++++++++++++++++++++ src/app/data/map-items/map-items.scss | 9 +++++++++ 5 files changed, 56 insertions(+), 0 deletions(-) create mode 100644 src/app/data/map-items/map-items-component.ts create mode 100644 src/app/data/map-items/map-items.scss diff --git a/src/app/app.module.ts b/src/app/app.module.ts index e5dec2e..3697a6d 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -36,6 +36,7 @@ import { RoadComponent } from './data/road/road.component'; import { RoadServiceComponent } from './data/road-service/road-service.component'; import { SettlementAddressLinkComponent } from './data/settlement-address-link/settlement-address-link.component'; import { MapComponent } from './data/map/map.component'; +import { MapItemsComponent } from './data/map-items/map-items-component'; // Services import { BusStopCreateService } from '../services/bus-stop-create.service'; @@ -79,6 +80,7 @@ const httpInterceptorProviders: Type[] = [ RendererComponent, MapEditorComponent, MapRendererComponent, + MapItemsComponent, RoadWidthComponent, RoadToCategoryComponent, FlowIntensityComponent, diff --git a/src/app/data/bus-stop/bus-stop.component.html b/src/app/data/bus-stop/bus-stop.component.html index 7db449a..9058582 100644 --- a/src/app/data/bus-stop/bus-stop.component.html +++ b/src/app/data/bus-stop/bus-stop.component.html @@ -1,3 +1,4 @@ +
+
+
`, + styleUrls: ['map-items.scss'] +}) + +export class MapItemsComponent{ + @Input() position: string; + public map: L.Map; + public icon: L.Icon; + constructor() { + 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, + icon: this.icon, + }; + let latLng = this.position.split(','); + let marker = L.marker(new L.LatLng(parseInt(latLng[0]),parseInt(latLng[1])),options); + this.map.addLayer(marker); + + } + } +} \ No newline at end of file diff --git a/src/app/data/map-items/map-items.scss b/src/app/data/map-items/map-items.scss new file mode 100644 index 0000000..5c5678f --- /dev/null +++ b/src/app/data/map-items/map-items.scss @@ -0,0 +1,9 @@ +.map-items{ + height: 50%; + position: relative; +} + +#mapItemsId{ + height: 100%; + width: 100%; +} \ No newline at end of file -- libgit2 0.21.4