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
@@ -306,10 +309,13 @@ export class GttClient {
306
309
this . toolbar . setPosition ( 'bottom-left' as position )
307
310
this . map . addControl ( this . toolbar )
308
311
this . setView ( )
309
- this . setGeolocation ( this . map )
310
312
this . setGeocoding ( this . map )
313
+ this . setGeolocation ( this . map )
311
314
this . parseHistory ( )
312
315
316
+ this . map . addControl ( new FullScreen ( ) )
317
+ this . map . addControl ( new Rotate ( ) )
318
+
313
319
// Control button
314
320
const maximizeCtrl = new Button ( {
315
321
html : '<i class="material-icons" >zoom_out_map</i>' ,
@@ -519,13 +525,14 @@ export class GttClient {
519
525
// Control Select
520
526
const select = new Select ( {
521
527
layers : [ this . vector ] ,
528
+ style : null ,
522
529
multi : false
523
530
} )
524
531
this . map . addInteraction ( select )
525
532
526
533
// On selected => show/hide popup
527
- select . getFeatures ( ) . on ( [ 'add' ] , evt => {
528
- const feature = evt . target
534
+ select . getFeatures ( ) . on ( [ 'add' ] , ( evt : any ) => {
535
+ const feature = evt . element
529
536
530
537
const content : Array < string > = [ ]
531
538
content . push ( `<b>${ feature . get ( 'subject' ) } </b><br/>` )
0 commit comments