Browse Source

UI: Propagate key filters for entities hierarchy subscriptions. Fix Maps bounds.

pull/3068/head
Igor Kulikov 6 years ago
parent
commit
628892b35b
  1. 1
      ui-ngx/src/app/modules/home/components/widget/lib/entities-hierarchy-widget.component.ts
  2. 8
      ui-ngx/src/app/modules/home/components/widget/lib/maps/leaflet-map.ts

1
ui-ngx/src/app/modules/home/components/widget/lib/entities-hierarchy-widget.component.ts

@ -418,6 +418,7 @@ export class EntitiesHierarchyWidgetComponent extends PageComponent implements O
const childrenDatasource = { const childrenDatasource = {
dataKeys: datasource.dataKeys, dataKeys: datasource.dataKeys,
type: DatasourceType.entity, type: DatasourceType.entity,
filterId: datasource.filterId,
entityFilter entityFilter
} as HierarchyNodeDatasource; } as HierarchyNodeDatasource;
const subscriptionOptions: WidgetSubscriptionOptions = { const subscriptionOptions: WidgetSubscriptionOptions = {

8
ui-ngx/src/app/modules/home/components/widget/lib/maps/leaflet-map.ts

@ -219,8 +219,12 @@ export default abstract class LeafletMap {
} }
} else { } else {
this.map.once('zoomend', () => { this.map.once('zoomend', () => {
if (!this.options.defaultZoomLevel && this.map.getZoom() > this.options.minZoomLevel) { let minZoom = this.options.minZoomLevel;
this.map.setZoom(this.options.minZoomLevel, { animate: false }); if (this.options.defaultZoomLevel) {
minZoom = Math.min(minZoom, this.options.defaultZoomLevel);
}
if (this.map.getZoom() > minZoom) {
this.map.setZoom(minZoom, { animate: false });
} }
}); });
if (this.options.useDefaultCenterPosition) { if (this.options.useDefaultCenterPosition) {

Loading…
Cancel
Save