Skip to content

Commit 16e7539

Browse files
authored
Merge pull request #192 from gtt-project/fix/issue-popup
Fixes issue popup not showing
2 parents f69d791 + afcbe4d commit 16e7539

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
@@ -522,13 +525,14 @@ export class GttClient {
522525
// Control Select
523526
const select = new Select({
524527
layers: [this.vector],
528+
style: null,
525529
multi: false
526530
})
527531
this.map.addInteraction(select)
528532

529533
// On selected => show/hide popup
530-
select.getFeatures().on(['add'], evt => {
531-
const feature = evt.target
534+
select.getFeatures().on(['add'], (evt: any) => {
535+
const feature = evt.element
532536

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

0 commit comments

Comments
 (0)