Commit f94ff581 authored by Sebastian's avatar Sebastian

attribution in der map (siehe style.css:.ol-attribution)

parent aac57eb1
......@@ -17,12 +17,14 @@ import { CategoryComponent } from './portal/category/category.component';
import { CreateEntryComponent } from './portal/create-entry/create-entry.component';
import { HelpComponent } from './portal/help/help.component';
import { ErrorComponent } from './error';
import { AutosuggestComponent } from './widget/autosuggest';
import { VersionInfoComponent } from './home/version-info/version-info.component';
const routes: Routes = [
{ path: 'autosuggest', component: AutosuggestComponent },
{ path: 'home', component: HomeComponent },
{ path: 'login', component: AuthComponent },
{ path: 'auth', component: AuthComponent },
{ path: 'help', component: HelpComponent },
{ path: 'error', component: ErrorComponent },
......
......@@ -15,7 +15,7 @@ import { BliDimension } from '../models/BliDimension';
import { OsmNodeFactory } from '../models/OsmNodeFactory';
import { OsmNodeService } from '../services/osm-node.service';
import { BliComponent } from '../portal/bli/bli.component';
import { NominatimService } from '../services/nominatim.service';
import { NominatimService } from '../services/nominatim.service'
import { AuthService } from '../services/auth.service';
import OlMap from 'ol/Map';
import OlView from 'ol/View';
......
......@@ -3,6 +3,7 @@ import { Router } from '@angular/router';
import OlMap from 'ol/map';
import OlXYZ from 'ol/source/xyz';
import OlOSM from 'ol/source/osm';
import OlVectorSource from 'ol/source/Vector'
import OlTileLayer from 'ol/layer/tile';
import OlView from 'ol/view';
......@@ -20,11 +21,14 @@ import OlPoint from 'ol/geom/Point';
import OlLineString from 'ol/geom/LineString';
import { LogService } from './log.service';
import { OsmNode } from '../models/OsmNode';
import { defaults as OlDefaultControls } from 'ol/control.js';
import { defaults as defaultControls } from 'ol/control.js';
import { Attribution as OlAttribution } from 'ol/control.js';
import { OlMapBrowserEvent } from 'ol/events';
import { Rectangle } from '../models/Rectangle';
import { OsmNodeService } from './osm-node.service';
//OlTransforms.transformExtent(extent,'EPSG:3857','EPSG:4326');
@Injectable({
providedIn: 'root'
})
......@@ -43,10 +47,9 @@ export class MapService {
icons: Array<OlFeature>;
layers: Array<any>;
text:string;
attribution: OlAttribution;
nodeSets:Map<String,Array<OsmNode>>;
removedNodeSets:Map<String,Array<OsmNode>>;
constructor(
private logger:LogService,
private osmNodeService: OsmNodeService,
......@@ -78,12 +81,8 @@ export class MapService {
source: new OlVectorSource({features: this.connections})
});
this.source = new OlXYZ({
this.source = new OlOSM({
url: 'http://tile.osm.org/{z}/{x}/{y}.png'
//url:'https://stamen-tiles.a.ssl.fastly.net/{z}/{x}/{y}.png'
//url: 'http://tile.stamen.com/terrain/{z}/{x}/{y}.png'
//url:'https://maps.wikimedia.org/osm-intl/${z}/${x}/${y}.png'
//url: 'http://tile.thunderforest.com/landscape/${z}/${x}/${y}.png'
});
this.mapLayer = new OlTileLayer({
......@@ -441,9 +440,9 @@ export class MapService {
//;
//feature.set('style', this.createStyle('assets/img/map-marker.png', undefined));
//feature.set('style', this.createLineStyle());
}
}
showLine(lhs: OsmNode, rhs:OsmNode){
let feature = this.createLine(lhs,rhs);
this.connections.push(feature);
......@@ -454,15 +453,22 @@ export class MapService {
this.map.addLayer(this.connectionLayer);
}
initMap(){
this.layers.push(this.mapLayer);
this.layers.push(this.iconLayer);
this.layers.push(this.connectionLayer);
this.attribution = new OlAttribution({
collapsible: false,
className: "ol-attribution",
collapsed:false
});
this.map = new OlMap({
target: 'map',
layers: this.layers,
view: this.view,
controls:null
controls: new defaultControls({attribution: false}).extend([this.attribution])
});
let handler = this.clickHandler;
......
<p>
autosuggest works!
</p>
<div class="widget-wrap widget-big">
Test 123
<ng-template #rt let-r="result" let-t="term">
<ngb-highlight [result]="r.name" [term]="t"></ngb-highlight>
</ng-template>
<label for="typeahead-basic">Search for a state:</label>
<input id="typeahead-basic" type="text" class="form-control" [(ngModel)]="model" [ngbTypeahead]="search"/>
</div>
\ No newline at end of file
import { Component, OnInit } from '@angular/core';
import {Component, OnInit} from '@angular/core';
import {Observable} from 'rxjs';
import {debounceTime, distinctUntilChanged, map} from 'rxjs/operators';
import { GeoportalApiService } from '../../services/geoportal-api.service';
@Component({
selector: 'app-autosuggest',
templateUrl: './autosuggest.component.html',
styleUrls: ['./autosuggest.component.css']
})
export class AutosuggestComponent implements OnInit {
public model: any;
states = {
"Hof Sonnenberg":"Wuppertal",
"Erdbeerhof Faßbeck":"Wuppertal",
"Hof Judt":"Kreis Mettmann",
"Hof zur Hellen":"Kreis Mettmann",
"Hof Schäfer":"Wuppertal"
};
constructor() { }
constructor(private apiService: GeoportalApiService) {
}
ngOnInit() {
}
search = (text$: Observable<string>) =>
{
text$.pipe
(
debounceTime(200),
distinctUntilChanged(),
map(term => term.length < 2 ? []
: Object.keys(this.states).filter(v => v.toLowerCase().indexOf(term.toLowerCase()) > -1).slice(0, 10)),
)
}
}
export * from './autosuggest.component';
......@@ -211,6 +211,12 @@ app-bli.bli-app div div.bli-icons div.list-group div.list-group-item div.bliicon
display:none;
}
.ol-attribution{
bottom:3.9em !important;
position:fixed;
right:1em;
}
/* Checkbox toggle*/
/* The switch - the box around the slider */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment