Skip to content
This repository was archived by the owner on May 7, 2025. It is now read-only.

Commit ef12247

Browse files
author
Daniel B
authored
dev -> master (#55)
* fix reset app bug (#52) * updates registerServiceWorker, confirms sw-build and sw-template look good, updates package.json to run customized build (#54) * Geolocate callback & reliable fonts (#56) * Send the users location to ga on successful locate Use a more reliable ttf font file * geolocate callback * travis * weird formatting * no longer need to trigger * Revert "updates registerServiceWorker, confirms sw-build and sw-template look good, updates package.json to run customized build (#54)" This reverts commit 3a1158f.
1 parent 11d27f4 commit ef12247

File tree

3 files changed

+13
-43
lines changed

3 files changed

+13
-43
lines changed

src/_variables.scss

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,7 @@ $teal: #84cbdd;
66
$purple: #935195;
77

88
@font-face {font-family: 'Gobold Bold Italic';
9-
src: url('https://db.onlinewebfonts.com/t/dbd939c1aa46674fe3c9bedb1a7d2730.eot'); /* IE9*/
10-
src: url('https://db.onlinewebfonts.com/t/dbd939c1aa46674fe3c9bedb1a7d2730.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
11-
url('https://db.onlinewebfonts.com/t/dbd939c1aa46674fe3c9bedb1a7d2730.woff2') format('woff2'), /* chrome firefox */
12-
url('https://db.onlinewebfonts.com/t/dbd939c1aa46674fe3c9bedb1a7d2730.woff') format('woff'), /* chrome firefox */
13-
url('https://db.onlinewebfonts.com/t/dbd939c1aa46674fe3c9bedb1a7d2730.ttf') format('truetype'), /* chrome firefox opera Safari, Android, iOS 4.2+*/
14-
url('https://db.onlinewebfonts.com/t/dbd939c1aa46674fe3c9bedb1a7d2730.svg#Gobold Bold Italic') format('svg'); /* iOS 4.1- */
9+
src: url('https://static1.squarespace.com/static/56ec9968746fb97c330f612b/t/5a946ee0e2c483a55b393661/1519677152858/Gobold+Bold+Italic.ttf') format('truetype'); /* chrome firefox opera Safari, Android, iOS 4.2+*/
1510
}
1611

1712
$font-gobold-bold: 'Gobold Bold Italic';

src/components/Main/Main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const styles = theme => ({
6363
},
6464
navLogo: {
6565
cursor: 'pointer',
66-
fontFamily: 'Gobold Bold Italic',
66+
fontFamily: 'Gobold Bold Italic, Open Sans, sans-serif;',
6767
color: '#fff'
6868
}
6969
});

src/components/Map/Map.js

Lines changed: 11 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ import {
1515
} from "../../redux/actions";
1616
import {
1717
FIND_MY_LOCATION_ERROR,
18-
FIND_MY_LOCATION_OUT_OF_BOUNDS,
19-
FIND_MY_LOCATION_SELECT,
2018
FIND_MY_LOCATION_SUCCESS,
2119
LAYER_BAR_RETAIL_SERVICE,
2220
LAYER_BAR_RETAIL_SERVICE_LABEL,
@@ -82,15 +80,13 @@ class Map extends Component {
8280
map.addControl(this.geoLocate);
8381
map.addControl(this.bearingControl);
8482

85-
// Replace GeolocateControl's _updateCamera function
86-
// see: https://github.com/mapbox/mapbox-gl-js/issues/6789
87-
// this.geoLocate._updateCamera = this.handleGeolocation;
83+
// Fired on each Geolocation API position update which returned as success.
84+
this.geoLocate.on('geolocate', this.handleGeolocationSuccess);
8885

8986
// Catch GeolocateControl errors
9087
this.geoLocate.on("error", this.handleGeolocationError);
9188

92-
map.on("load", () => {
93-
});
89+
map.on("load", () => {});
9490

9591
map.on("click", e => {
9692
this.handleMapClick(e);
@@ -180,42 +176,21 @@ class Map extends Component {
180176
* // TODO Don't track user location if out of bounds. Consider going back to custom implementation
181177
* @param position
182178
*/
183-
handleGeolocation = position => {
179+
handleGeolocationSuccess = position => {
180+
184181
// get geolocation
185182
const location = new mapboxgl.LngLat(
186183
position.coords.longitude,
187184
position.coords.latitude
188185
);
189-
const bounds = this.map.getMaxBounds();
186+
190187
// "Long,Lat"
191188
let formattedLocation = [location.lng, location.lat].join(",");
192-
// Report "select" action to google analytics
193-
findMyLocation({type: FIND_MY_LOCATION_SELECT, payload: null});
194-
195-
if (bounds) {
196-
// if geolocation is within maxBounds
197-
if (
198-
location.lng >= bounds.getWest() &&
199-
location.lng <= bounds.getEast() &&
200-
location.lat >= bounds.getSouth() &&
201-
location.lat <= bounds.getNorth()
202-
) {
203-
// Report "success" action to google analytics
204-
findMyLocation({
205-
type: FIND_MY_LOCATION_SUCCESS,
206-
payload: formattedLocation
207-
});
208-
// Zoom into user's location
209-
this.map.fitBounds(location.toBounds(position.coords.accuracy));
210-
} else {
211-
// Report "out of bounds" action to google analytics
212-
findMyLocation({
213-
type: FIND_MY_LOCATION_OUT_OF_BOUNDS,
214-
payload: formattedLocation
215-
});
216-
// TODO display a helpful message about being outside of bounds
217-
}
218-
}
189+
190+
findMyLocation({
191+
type: FIND_MY_LOCATION_SUCCESS,
192+
payload: formattedLocation
193+
});
219194
};
220195

221196
/**

0 commit comments

Comments
 (0)