|
1 | 1 | import 'ol/ol.css'
|
2 | 2 | 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' |
4 | 4 | import 'ol-ext/filter/Base'
|
5 |
| -import { Geometry, Point } from 'ol/geom' |
| 5 | +import { Geometry, GeometryCollection, Point } from 'ol/geom' |
6 | 6 | import { GeoJSON, WKT } from 'ol/format'
|
7 | 7 | import { Layer, Tile, Image } from 'ol/layer'
|
8 | 8 | import VectorLayer from 'ol/layer/Vector'
|
@@ -41,6 +41,9 @@ import { FeatureLike } from 'ol/Feature'
|
41 | 41 | import TileSource from 'ol/source/Tile'
|
42 | 42 | import ImageSource from 'ol/source/Image'
|
43 | 43 | 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' |
44 | 47 |
|
45 | 48 | interface GttClientOption {
|
46 | 49 | target: HTMLDivElement | null
|
@@ -562,13 +565,14 @@ export class GttClient {
|
562 | 565 | // Control Select
|
563 | 566 | const select = new Select({
|
564 | 567 | layers: [this.vector],
|
| 568 | + style: null, |
565 | 569 | multi: false
|
566 | 570 | })
|
567 | 571 | this.map.addInteraction(select)
|
568 | 572 |
|
569 | 573 | // On selected => show/hide popup
|
570 |
| - select.getFeatures().on(['add'], evt => { |
571 |
| - const feature = evt.target |
| 574 | + select.getFeatures().on(['add'], (evt: any) => { |
| 575 | + const feature = evt.element |
572 | 576 |
|
573 | 577 | const content: Array<string> = []
|
574 | 578 | content.push(`<b>${feature.get('subject')}</b><br/>`)
|
|
0 commit comments