File tree Expand file tree Collapse file tree 5 files changed +25
-10
lines changed Expand file tree Collapse file tree 5 files changed +25
-10
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import Route from '@ember/routing/route';
2
2
import moment from 'moment' ;
3
3
import { set } from '@ember/object' ;
4
4
import { inject as service } from '@ember/service' ;
5
+ import ENV from 'open-event-frontend/config/environment' ;
5
6
6
7
export default Route . extend ( {
7
8
headData : service ( ) ,
@@ -65,7 +66,9 @@ export default Route.extend({
65
66
tickets : [ ]
66
67
} ) ,
67
68
68
- attendees : [ ]
69
+ attendees : [ ] ,
70
+
71
+ mapConfig : ENV . APP . mapConfig
69
72
} ;
70
73
} ,
71
74
afterModel ( model ) {
Original file line number Diff line number Diff line change 167
167
width : 100% ;
168
168
}
169
169
170
- .event-map > .g-map > .g-map-canvas {
170
+ .event-map > .g-map > .g-map-canvas ,
171
+ .event-map > iframe .g-map {
171
172
height : 300px ;
172
173
}
Original file line number Diff line number Diff line change 1
1
{{ #if event.isMapShown }}
2
2
<div class =" eight wide column event-map" >
3
3
<h1 >{{ t ' Getting Here' }} </h1 >
4
- {{ #g-map markersFitMode =' live' lat =37.744 lng =-122.4367 address =event.locationName zoom =2 class =' google-maps' as |context |}}
5
- {{ #g-map-address-marker context address =event.locationName as |markerContext |}}
6
- {{ #g-map-infowindow markerContext }}
7
- {{ event.locationName }}
8
- {{ /g-map-infowindow }}
9
- {{ /g-map-address-marker }}
10
- {{ /g-map }}
4
+ {{ #if (eq mapConfig.display ' embed' ) }}
5
+ <iframe class =" g-map" src =" https://maps.google.com/maps?q={{ event.locationName }} &t=&z=15&ie=UTF8&iwloc=&output=embed" frameborder =" 0" scrolling =" no" ></iframe >
6
+ {{ else }}
7
+ {{ #g-map markersFitMode =' live' lat =37.744 lng =-122.4367 address =event.locationName zoom =2 class =' google-maps' as |context |}}
8
+ {{ #g-map-address-marker context address =event.locationName as |markerContext |}}
9
+ {{ #g-map-infowindow markerContext }}
10
+ {{ event.locationName }}
11
+ {{ /g-map-infowindow }}
12
+ {{ /g-map-address-marker }}
13
+ {{ /g-map }}
14
+ {{ /if }}
11
15
</div >
12
16
{{ /if }}
13
17
<div class =" {{ if event.isMapShown ' eight' ' sixteen' }} wide column address" >
Original file line number Diff line number Diff line change 58
58
<div class =" ui hidden divider" ></div >
59
59
{{ /if }}
60
60
<div class =" location" id =" getting-here" >
61
- {{ public/event-map event =model.event }}
61
+ {{ public/event-map event =model.event mapConfig = model.mapConfig }}
62
62
</div >
63
63
<div class =" ui hidden divider" ></div >
64
64
{{ #if model.event.copyright }}
Original file line number Diff line number Diff line change @@ -115,6 +115,13 @@ module.exports = function(environment) {
115
115
protocol : 'https'
116
116
} ;
117
117
118
+ ENV . APP . mapConfig = { } ;
119
+
120
+ // Use embed iframe map using address if MAP_DISPLAY is set or GOOGLE_API_KEY is not available or invalid
121
+ if ( process . env . MAP_DISPLAY === 'embed' || ! process . env . GOOGLE_API_KEY || ! process . env . GOOGLE_API_KEY . startsWith ( 'AIza' ) ) {
122
+ ENV . APP . mapConfig . display = 'embed' ;
123
+ }
124
+
118
125
ENV . sentry . hostname = getSentryServer ( ENV . sentry . dsn , false ) ;
119
126
ENV . sentry . server = getSentryServer ( ENV . sentry . dsn , true ) ;
120
127
if ( process . env . CSPPermissive ) {
You can’t perform that action at this time.
0 commit comments