Skip to content

Commit afcbe4d

Browse files
committed
Fixes issue popup not showing
Signed-off-by: Daniel Kastl <[email protected]>
1 parent 767a949 commit afcbe4d

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/components/gtt-client.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import 'ol/ol.css'
22
import 'ol-ext/dist/ol-ext.min.css'
3-
import { Map, Feature, View, Geolocation } from 'ol'
3+
import { Map, Feature, View, Geolocation, Collection } from 'ol'
44
import 'ol-ext/filter/Base'
5-
import { Geometry, Point } from 'ol/geom'
5+
import { Geometry, GeometryCollection, Point } from 'ol/geom'
66
import { GeoJSON, WKT } from 'ol/format'
77
import { Layer, Tile, Image } from 'ol/layer'
88
import VectorLayer from 'ol/layer/Vector'
@@ -41,6 +41,9 @@ import { FeatureLike } from 'ol/Feature'
4141
import TileSource from 'ol/source/Tile'
4242
import ImageSource from 'ol/source/Image'
4343
import { Options as ImageWMSOptions } from 'ol/source/ImageWMS'
44+
import JSONFeature from 'ol/format/JSONFeature'
45+
import BaseEvent from 'ol/events/Event'
46+
import { CollectionEvent } from 'ol/Collection'
4447

4548
interface GttClientOption {
4649
target: HTMLDivElement | null
@@ -519,13 +522,14 @@ export class GttClient {
519522
// Control Select
520523
const select = new Select({
521524
layers: [this.vector],
525+
style: null,
522526
multi: false
523527
})
524528
this.map.addInteraction(select)
525529

526530
// On selected => show/hide popup
527-
select.getFeatures().on(['add'], evt => {
528-
const feature = evt.target
531+
select.getFeatures().on(['add'], (evt: any) => {
532+
const feature = evt.element
529533

530534
const content: Array<string> = []
531535
content.push(`<b>${feature.get('subject')}</b><br/>`)

0 commit comments

Comments
 (0)