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'
@@ -17,7 +17,7 @@ import {
17
17
Select ,
18
18
} from 'ol/interaction'
19
19
import { focus as events_condifition_focus } from 'ol/events/condition'
20
- import { defaults as control_defaults } from 'ol/control'
20
+ import { defaults as control_defaults , FullScreen , Rotate } from 'ol/control'
21
21
import { transform , fromLonLat , transformExtent } from 'ol/proj'
22
22
import { createEmpty , extend , getCenter , containsCoordinate } from 'ol/extent'
23
23
import { FeatureCollection } from 'geojson'
@@ -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
@@ -304,10 +307,13 @@ export class GttClient {
304
307
this . toolbar . setPosition ( 'bottom-left' as position )
305
308
this . map . addControl ( this . toolbar )
306
309
this . setView ( )
307
- this . setGeolocation ( this . map )
308
310
this . setGeocoding ( this . map )
311
+ this . setGeolocation ( this . map )
309
312
this . parseHistory ( )
310
313
314
+ this . map . addControl ( new FullScreen ( ) )
315
+ this . map . addControl ( new Rotate ( ) )
316
+
311
317
// Control button
312
318
const maximizeCtrl = new Button ( {
313
319
html : '<i class="material-icons" >zoom_out_map</i>' ,
@@ -529,13 +535,14 @@ export class GttClient {
529
535
// Control Select
530
536
const select = new Select ( {
531
537
layers : [ this . vector ] ,
538
+ style : null ,
532
539
multi : false
533
540
} )
534
541
this . map . addInteraction ( select )
535
542
536
543
// On selected => show/hide popup
537
- select . getFeatures ( ) . on ( [ 'add' ] , evt => {
538
- const feature = evt . target
544
+ select . getFeatures ( ) . on ( [ 'add' ] , ( evt : any ) => {
545
+ const feature = evt . element
539
546
540
547
const content : Array < string > = [ ]
541
548
content . push ( `<b>${ feature . get ( 'subject' ) } </b><br/>` )
0 commit comments