Add feature to the featureInfoBox so that geometry is available there as well

This commit is contained in:
Pieter Vander Vennet 2020-07-22 01:07:32 +02:00
parent 1373bd106e
commit 8268c0d054
7 changed files with 39 additions and 18 deletions

View file

@ -15,14 +15,14 @@ export class SimpleAddUI extends UIElement {
private _addButtons: UIElement[];
private _lastClickLocation: UIEventSource<{ lat: number; lon: number }>;
private _changes: Changes;
private _selectedElement: UIEventSource<any>;
private _selectedElement: UIEventSource<{feature: any}>;
private _dataIsLoading: UIEventSource<boolean>;
private _userDetails: UIEventSource<UserDetails>;
constructor(zoomlevel: UIEventSource<{ zoom: number }>,
lastClickLocation: UIEventSource<{ lat: number, lon: number }>,
changes: Changes,
selectedElement: UIEventSource<any>,
selectedElement: UIEventSource<{feature: any}>,
dataIsLoading: UIEventSource<boolean>,
userDetails: UIEventSource<UserDetails>,
addButtons: { name: UIElement; icon: string; tags: Tag[]; layerToAddTo: FilteredLayer }[],
@ -55,7 +55,7 @@ export class SimpleAddUI extends UIElement {
const loc = self._lastClickLocation.data;
let feature = self._changes.createElement(option.tags, loc.lat, loc.lon);
option.layerToAddTo.AddNewElement(feature);
self._selectedElement.setData(feature.properties);
self._selectedElement.setData({feature: feature});
}
}