Use latest snapshot
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good

This commit is contained in:
Willem Dantuma 2021-07-27 09:31:14 +02:00
parent 122c49d516
commit 76c431b9c2

View File

@ -35,8 +35,6 @@ import { TemporalItemLayer } from '../models/item.layer'
export class MapEffects {
private _geojsonFormat: GeoJSON;
private _wktFormat: WKT;
public _overrideSelectedItemLayer: boolean = false;
public _overrideOverlayLayers: boolean = false;
private toPointFeature(updateEvent:commonActions.DeviceUpdateEvent): Feature {
var f = this._wktFormat.readFeature(updateEvent.attributes["geometry"],{
@ -141,7 +139,7 @@ export class MapEffects {
let actions =[];
actions.push(new commonActions.SetMenuVisible(false));
let extent = createEmpty();
if (!action.query.bboxFilter && !this._overrideSelectedItemLayer) {
if (!action.query.bboxFilter) {
if (extent) {
for (let f of action.features) {
extend(extent, (f as Feature).getGeometry().getExtent());
@ -211,7 +209,12 @@ export class MapEffects {
selectItemSuccess$: Observable<Action> = this.actions$.pipe(
ofType(mapActions.SELECTITEMSUCCESS),
switchMap((action:mapActions.SelectItemSuccess) => {
if(!this._overrideSelectedItemLayer) {
let overrideSelectedItemLayer = false;
if(this.route$ && this.route$.snapshot && this.route$.snapshot.data && this.route$.snapshot.data["fm-map-map"]) {
let params = this.route$.snapshot.data["fm-map-map"];
overrideSelectedItemLayer = params["overrideSelectedItemlayer"] ? params["overrideSelectedItemlayer"] : false;
}
if(!overrideSelectedItemLayer) {
return this.itemService$.getFeature(action.item.code, "EPSG:3857").pipe(
map((feature: any) => {
let f = this._geojsonFormat.readFeature(feature);
@ -393,13 +396,8 @@ export class MapEffects {
}
}));
constructor(private actions$: Actions, private store$: Store<mapReducers.State>, private folderService$: FolderService, private itemService$: ItemService,private featureIconService$:FeatureIconService,private itemTypeService$:ItemTypeService, private route: ActivatedRoute) {
constructor(private actions$: Actions, private store$: Store<mapReducers.State>, private folderService$: FolderService, private itemService$: ItemService,private featureIconService$:FeatureIconService,private itemTypeService$:ItemTypeService, private route$: ActivatedRoute) {
this._geojsonFormat = new GeoJSON();
this._wktFormat = new WKT();
if(route && route.snapshot && route.snapshot.data && route.snapshot.data["fm-map-map"]) {
let params = route.snapshot.data["fm-map-map"];
this._overrideSelectedItemLayer = params["overrideSelectedItemlayer"] ? params["overrideSelectedItemlayer"] : false;
this._overrideOverlayLayers = params["overrideOverlayLayers"] ? params["overrideOverlayLayers"] : false;
}
}
}