Skip to content

Commit

Permalink
map api key is hidden
Browse files Browse the repository at this point in the history
  • Loading branch information
MrNoIce committed Jul 31, 2019
1 parent c9d76f7 commit 168cfd8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
Expand Down
10 changes: 6 additions & 4 deletions src/components/map/map.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import React, { Component } from "react";
import ReactMapGL, { NavigationControl, GeolocateControl } from "react-map-gl";
// import ".env"
import "mapbox-gl/dist/mapbox-gl.css";
const TOKEN =
"pk.eyJ1IjoiamFrZXNjb3R0MSIsImEiOiJjanlyZGhkMXcwMTQxM2ptdjBjbDU1bGllIn0.k1hr4yy2-s0IysSwf4z8Kg";

const API_KEY = process.env.REACT_APP_API_KEY

const navStyle = {
position: "absolute",
top: 50,
Expand Down Expand Up @@ -33,7 +35,7 @@ class Map extends Component {
}
_onClickMap(evt) {
console.log(evt.lngLat);

}

render() {
Expand All @@ -46,7 +48,7 @@ class Map extends Component {
height: "100vh",
width: "100vw"
}}
mapboxApiAccessToken={TOKEN}
mapboxApiAccessToken={API_KEY}
onViewportChange={viewport => this.setState({ viewport })}
onClick={this._onClickMap}
>
Expand Down

0 comments on commit 168cfd8

Please sign in to comment.