) => {
// this.tethys = res;
// const bottomPane: HTMLElement = this.map.createPane("bottom");
// bottomPane.style.zIndex = "550";
// const topPane: HTMLElement = this.map.createPane("top");
// topPane.style.zIndex = "650";
// for (let index = 0; index < this.tethys.length; index++) {
// this.addPolygon(index);
// }
// },
// (error: string) => this.errorHandler(error),
// );
// this.subscriptions.push(newSubs);
}
private errorHandler(err: string): void {
this.error = err;
// this.loading = false;
}
private addPolygon(i: number) {
const southWest = new LatLng(this.tethys[i].south, this.tethys[i].west);
const northEast = new LatLng(this.tethys[i].north, this.tethys[i].east);
const bounds = new LatLngBounds(southWest, northEast);
const bW = this.tethys[i].east - this.tethys[i].west;
new Rectangle(bounds, {
color: /GEOFAST/g.test(this.tethys[i].title) ? "red" : "green",
fill: bW > 0.3 ? false : true,
weight: bW > 0.3 || bW < 0.03 ? 3 : 1,
pane: bW > 0.2 ? "bottom" : "top",
}).addTo(this.map).bindPopup(`DOI: ${this.tethys[i].doi}
${this.tethys[i].title}
publ.: ${this.tethys[i].creator}
und ${this.tethys[i].contributor}
`);
}
// private addBaseMap(layerOptions?: LayerOptions): void {
private addBaseMap(): void {
if (this.map) {
const map = this.map.setView([47.7, 13.5], 7);
const southWest = new LatLng(46.5, 9.9),
northEast = new LatLng(48.9, 16.9),
bounds = new LatLngBounds(southWest, northEast);
// zoom the map to that bounding box
map.fitBounds(bounds);
// let tiles = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
// maxZoom: 18,
// minZoom: 3,
// attribution: '© OpenStreetMap'
// });
// tiles.addTo(this.map);
const layerOptions = {
label: DEFAULT_BASE_LAYER_NAME,
visible: true,
// layer: tileLayer.wms("https://ows.terrestris.de/osm-gray/service", {
// format: "image/png",
// attribution: DEFAULT_BASE_LAYER_ATTRIBUTION,
// layers: "OSM-WMS",
// }),
// tileLayer.provider("BasemapAT.grau")
layer: tileLayer("https://maps{s}.wien.gv.at/basemap/bmapgrau/normal/google3857/{z}/{y}/{x}.png", {
subdomains: ["", "1", "2", "3", "4"],
attribution: DEFAULT_BASE_LAYER_ATTRIBUTION,
bounds: [
[46.35877, 8.782379],
[49.037872, 17.189532],
],
detectRetina: false,
}),
// layer: new TileLayer(DEFAULT_BASE_LAYER_URL, {
// attribution: DEFAULT_BASE_LAYER_ATTRIBUTION
// })
};
layerOptions.layer.addTo(this.map);
}
}
private generateUUID(): string {
function s4() {
return Math.floor((1 + Math.random()) * 0x10000)
.toString(16)
.substring(1);
}
return s4() + s4() + "-" + s4() + "-" + s4() + "-" + s4() + "-" + s4() + s4() + s4();
}
}