Skip to content

Commit 370ea10

Browse files
committed
Merge remote-tracking branch 'origin/main' into ftr/update-dependencies
2 parents 04905d3 + 16e7539 commit 370ea10

File tree

2 files changed

+56
-11
lines changed

2 files changed

+56
-11
lines changed

src/components/gtt-client.ts

Lines changed: 13 additions & 6 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'
@@ -17,7 +17,7 @@ import {
1717
Select,
1818
} from 'ol/interaction'
1919
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'
2121
import { transform, fromLonLat, transformExtent } from 'ol/proj'
2222
import { createEmpty, extend, getCenter, containsCoordinate } from 'ol/extent'
2323
import { FeatureCollection } from 'geojson'
@@ -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
@@ -306,10 +309,13 @@ export class GttClient {
306309
this.toolbar.setPosition('bottom-left' as position)
307310
this.map.addControl(this.toolbar)
308311
this.setView()
309-
this.setGeolocation(this.map)
310312
this.setGeocoding(this.map)
313+
this.setGeolocation(this.map)
311314
this.parseHistory()
312315

316+
this.map.addControl (new FullScreen())
317+
this.map.addControl (new Rotate())
318+
313319
// Control button
314320
const maximizeCtrl = new Button({
315321
html: '<i class="material-icons" >zoom_out_map</i>',
@@ -519,13 +525,14 @@ export class GttClient {
519525
// Control Select
520526
const select = new Select({
521527
layers: [this.vector],
528+
style: null,
522529
multi: false
523530
})
524531
this.map.addInteraction(select)
525532

526533
// 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
529536

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

src/stylesheets/app.scss

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,53 @@
33
*/
44
.ol-map {
55
width: 100%;
6-
height: 300px;
6+
height: 400px;
77
border: 1px solid #E4E4E4;
88
}
99
#issue-form .ol-map {
10-
width: 92%;
11-
margin: 1em auto;
10+
width: 100%;
11+
margin-bottom: 1em;
12+
}
13+
14+
$breakpoint-tablet: 899px;
15+
@media (max-width: $breakpoint-tablet) {
16+
.ol-map {
17+
height: 340px;
18+
}
1219
}
1320

1421
.ol-control button {
15-
background-color: rgba(40, 40, 40, 0.8);
22+
background-color: rgba(52, 73, 94, 0.8);
23+
height: 32px;
24+
width: 32px;
1625
}
1726
.ol-control button:hover {
18-
background-color: rgba(40, 40, 40, 1);
27+
background-color: rgba(52, 73, 94, 1);
28+
}
29+
30+
.ol-zoom button.ol-zoom-in,
31+
.ol-zoom button.ol-zoom-out,
32+
.ol-full-screen button.ol-full-screen-true,
33+
.ol-full-screen button.ol-full-screen-false,
34+
.ol-rotate button.ol-rotate-reset,
35+
.ol-bar .ol-button button {
36+
font-size: 1.6em;
37+
}
38+
39+
div.ol-full-screen {
40+
right: 3.0em;
41+
}
42+
43+
div.ol-rotate {
44+
right: 5.5em;
45+
}
46+
47+
div.ol-full-screen {
48+
right: 3.0em;
49+
}
50+
51+
.ol-control.ol-bar.ol-top.ol-left, .ol-control.ol-bar.ol-top.ol-right {
52+
top: 5.2em;
1953
}
2054

2155
.tabular .ol-layerswitcher label {
@@ -43,6 +77,10 @@ i[id^='icon_settings_tracker_'] {
4377
text-align: center;
4478
}
4579

80+
.ol-control.ol-layerswitcher-popup {
81+
top: 0.5em;
82+
}
83+
4684
.ol-control button .material-icons {
4785
font-size: inherit;
4886
}

0 commit comments

Comments
 (0)