More type fixes
This commit is contained in:
parent
5d21d66589
commit
1c1315a580
@ -273,7 +273,7 @@ export class DoQuery implements Action {
|
||||
export class SetStyle implements Action {
|
||||
readonly type = SETSTYLE;
|
||||
|
||||
constructor(public itemType:string,public style: Style | (Feature<Geometry>)) { }
|
||||
constructor(public itemType:string,public style: Style | ((feature:Feature<Geometry>) => Style )) { }
|
||||
}
|
||||
|
||||
export class ShowLayerSwitcher implements Action {
|
||||
|
@ -1,10 +1,11 @@
|
||||
import { Component, Host, Input, Output, EventEmitter, OnInit, OnChanges, SimpleChanges, forwardRef, Inject, InjectionToken } from '@angular/core';
|
||||
import { Component, Host, Input, Output, EventEmitter, OnInit, OnChanges, SimpleChanges, forwardRef, Inject, InjectionToken } from '@angular/core';
|
||||
import { LayerVectorComponent, SourceVectorComponent, MapComponent } from 'ngx-openlayers';
|
||||
import { ItemService,ItemTypeService,IItem, IItemType } from '@farmmaps/common';
|
||||
|
||||
import { Feature } from 'ol';
|
||||
import { Point,Geometry } from 'ol/geom';
|
||||
import { MapBrowserEvent } from 'ol';
|
||||
import { Types } from 'ol/MapBrowserEventType';
|
||||
import * as style from 'ol/style';
|
||||
import * as color from 'ol/color';
|
||||
import * as loadingstrategy from 'ol/loadingstrategy';
|
||||
@ -87,7 +88,7 @@ export class ItemVectorSourceComponent extends SourceVectorComponent implements
|
||||
return this.getSelectedStyle(feature);
|
||||
},
|
||||
hitTolerance: 10,
|
||||
condition: (e: MapBrowserEvent) => {
|
||||
condition: (e: MapBrowserEvent<UIEvent>) => {
|
||||
return e.type == 'pointermove';
|
||||
},
|
||||
layers: [this.layer.instance as Layer<Source>]
|
||||
|
@ -1,6 +1,8 @@
|
||||
import { Component, OnDestroy, OnInit, Input, OnChanges, SimpleChanges } from '@angular/core';
|
||||
import { LayerVectorComponent, MapComponent } from 'ngx-openlayers';
|
||||
import { RenderType } from 'ol/layer/Vector';
|
||||
import RenderType from 'ol/layer/Vector';
|
||||
import { Vector as VectorSource } from 'ol/source';
|
||||
import { Geometry } from 'ol/geom';
|
||||
|
||||
@Component({
|
||||
selector: 'fm-map-aol-layer-vector-image',
|
||||
@ -12,7 +14,7 @@ export class LayerVectorImageComponent extends LayerVectorComponent implements O
|
||||
//public source: Vector;
|
||||
|
||||
@Input()
|
||||
renderMode: RenderType | string = "image";
|
||||
renderMode: RenderType<VectorSource<Geometry>> | string = "image";
|
||||
|
||||
constructor(map: MapComponent) {
|
||||
super(map);
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Component, Input, OnInit,ViewChild } from '@angular/core';
|
||||
import { Feature} from 'ol';
|
||||
import { Geometry } from 'ol/geom';
|
||||
import { Geometry,Polygon,MultiPolygon } from 'ol/geom';
|
||||
import * as extent from 'ol/extent';
|
||||
import * as render from 'ol/render';
|
||||
import * as style from 'ol/style';
|
||||
@ -28,7 +28,7 @@ export class GeometryThumbnailComponent implements OnInit {
|
||||
stroke: new style.Stroke({ color: 'black',width:1.5 })
|
||||
});
|
||||
|
||||
let geom = geometry.clone(),
|
||||
let geom = geometry.clone() as Polygon,
|
||||
line = geom.getCoordinates()[0],
|
||||
e = extent.boundingExtent( line );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user