Use OSM-settings to keep track of the chosen license; change tree marker to circle (fix #24)

This commit is contained in:
Pieter Vander Vennet 2020-07-01 17:38:48 +02:00
parent b2704d0ab8
commit b1775d8184
15 changed files with 83 additions and 57 deletions

View file

@ -24,7 +24,7 @@ export class FilteredLayer {
private readonly _map: Basemap;
private readonly _maxAllowedOverlap: number;
private readonly _style: (properties) => any;
private readonly _style: (properties) => { color: string, icon: any };
private readonly _storage: ElementStorage;
@ -170,9 +170,12 @@ export class FilteredLayer {
const style = self._style(feature.properties);
let marker;
if (style.icon === undefined) {
marker = L.marker(latLng);
marker = L.circle(latLng, {
radius: 50,
color: style.color
});
} else {
marker = L.marker(latLng, {
icon: style.icon
});

View file

@ -12,9 +12,11 @@ export class OsmImageUploadHandler {
private _changeHandler: Changes;
private _userdetails: UIEventSource<UserDetails>;
private _slideShow: SlideShow;
private _preferedLicense: UIEventSource<string>;
constructor(tags: UIEventSource<any>,
userdetails: UIEventSource<UserDetails>,
preferedLicense: UIEventSource<string>,
changeHandler: Changes,
slideShow : SlideShow
) {
@ -25,6 +27,7 @@ export class OsmImageUploadHandler {
this._tags = tags;
this._changeHandler = changeHandler;
this._userdetails = userdetails;
this._preferedLicense = preferedLicense;
}
private generateOptions(license: string) {
@ -65,6 +68,7 @@ export class OsmImageUploadHandler {
const self = this;
return new ImageUploadFlow(
this._userdetails,
this._preferedLicense,
function (license) {
return self.generateOptions(license)
}

View file

@ -40,7 +40,6 @@ export class Overpass {
$.getJSON(query,
function (json, status) {
console.log("status:", status)
if (status !== "success") {
console.log("Query failed")
onFail(status);