Openlayers added

This commit is contained in:
HuskyTeufel
2022-01-14 11:19:28 +01:00
parent 92e0bdd863
commit 00ec5f75a5
11 changed files with 662 additions and 10 deletions

View File

@@ -0,0 +1,4 @@
#beschreibung {
height: 400px;
width: 100%;
}

View File

@@ -0,0 +1,2 @@
<p>wegbeschreibung works!</p>
<div id="beschreibung" ></div>

View File

@@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { WegbeschreibungComponent } from './wegbeschreibung.component';
describe('WegbeschreibungComponent', () => {
let component: WegbeschreibungComponent;
let fixture: ComponentFixture<WegbeschreibungComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ WegbeschreibungComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(WegbeschreibungComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@@ -0,0 +1,45 @@
import { AfterViewInit,Component, OnInit } from '@angular/core';
import Map from 'ol/Map';
import View from 'ol/View';
import VectorLayer from 'ol/layer/Vector';
import Style from 'ol/style/Style';
import Icon from 'ol/style/Icon';
import OSM from 'ol/source/OSM';
import * as olProj from 'ol/proj';
import TileLayer from 'ol/layer/Tile';
@Component({
selector: 'app-wegbeschreibung',
templateUrl: './wegbeschreibung.component.html',
styleUrls: ['./wegbeschreibung.component.css']
})
export class WegbeschreibungComponent implements OnInit {
Map!: Map;
constructor() { }
ngOnInit(): void {
this.Map = new Map({
target: 'beschreibung',
layers: [
new TileLayer ({
source: new OSM()
})
],
view: new View({
center: olProj.fromLonLat([7.0785,51.4614]),
zoom: 5
})
});
}
}