Skip to content

Commit

Permalink
Support map rotation #669 - Show searchresult marker, fix production …
Browse files Browse the repository at this point in the history
…build
  • Loading branch information
HarelM committed Nov 24, 2018
1 parent 443012a commit 6c16ba2
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 7 deletions.
2 changes: 1 addition & 1 deletion IsraelHiking.Web/sources/application/application.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ import { initialState } from "./reducres/initial-state";
import { debounceTime } from "rxjs/operators";
import { classToActionMiddleware } from "./reducres/reducer-action-decorator";

function initializeApplication(injector: Injector) {
export function initializeApplication(injector: Injector) {
return async () => {
console.log("Starting IHM Application Initialization");
let database = new PouchDB("IHM");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<aol-layer-tile >
<aol-source-xyz [url]="getBaseLayerUrl()"
<aol-layer-tile>
<aol-source-xyz [url]="getBaseLayerUrl()"
[minZoom]="getBaseLayerMinZoom()"
[maxZoom]="getBaseLayerMaxZoom()"></aol-source-xyz>
</aol-layer-tile>
Expand All @@ -14,11 +14,24 @@
</aol-layer-tile>

<div *ngFor="let categoriesType of categoriesTypes">
<aol-layer-vector [visible]="isVisible(categoriesType)" [zIndex]="1000">
<aol-layer-vector [visible]="isVisible(categoriesType)" [zIndex]="1000" #cluster>
<aol-source-cluster [distance]="distance">
<aol-source-vector></aol-source-vector>
</aol-source-cluster>
</aol-layer-vector>
<!-- HM TODO: style, dynamic geometry? -->
<aol-layer-vector *ngIf="getSearchResults(categoriesType) != null" [zIndex]="1001">
<aol-source-vector>
<aol-feature>
<aol-geometry-point>
<aol-coordinate [x]="getSearchResults(categoriesType).location.lng"
[y]="getSearchResults(categoriesType).location.lat"
[srid]="'EPSG:4326'">
</aol-coordinate>
</aol-geometry-point>
</aol-feature>
</aol-source-vector>
</aol-layer-vector>
</div>

<cluster-overlay [isOpen]="isClusterOpen" [latlng]="clusterLatlng" [points]="clusterPoints" (closed)="isClusterOpen = false"></cluster-overlay>
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { LatLngAlt, ApplicationState, Overlay } from "../../models/models";
export class LayersViewComponent extends BaseMapComponent implements OnInit, AfterViewInit {


@ViewChildren(LayerVectorComponent)
@ViewChildren("cluster")
public poiLayers: QueryList<LayerVectorComponent>;
public distance = 60;
public categoriesTypes: CategoriesType[];
Expand Down Expand Up @@ -78,6 +78,10 @@ export class LayersViewComponent extends BaseMapComponent implements OnInit, Aft
return this.categoriesLayerFactory.get(categoriesType).isVisible();
}

public getSearchResults(categoriesType: CategoriesType) {
return this.categoriesLayerFactory.get(categoriesType).searchResultsPoi;
}

ngOnInit() {
for (let categoriesTypeIndex = 0; categoriesTypeIndex < this.categoriesTypes.length; categoriesTypeIndex++) {
let categoriesType = this.categoriesTypes[categoriesTypeIndex];
Expand All @@ -89,8 +93,10 @@ export class LayersViewComponent extends BaseMapComponent implements OnInit, Aft
feature.setProperties({ icon: p.icon, iconColor: p.iconColor, name: p.title });
return feature;
});
this.poiLayers.toArray()[index].instance.getSource().getSource().clear();
this.poiLayers.toArray()[index].instance.getSource().getSource().addFeatures(features);
if (index < this.poiLayers.toArray().length) {
this.poiLayers.toArray()[index].instance.getSource().getSource().clear();
this.poiLayers.toArray()[index].instance.getSource().getSource().addFeatures(features);
}
});
}
}
Expand Down

0 comments on commit 6c16ba2

Please sign in to comment.