-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add menu bar buttons #4
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,30 @@ | ||
// import React from 'react'; | ||
import React from 'react' | ||
import ReactMapboxGL from 'react-mapbox-gl' | ||
import { ZoomControl } from 'react-mapbox-gl' | ||
|
||
const Map = ReactMapboxGL({ | ||
const ReactMap = ReactMapboxGL({ | ||
// accessToken: | ||
accessToken: | ||
'pk.eyJ1Ijoic3RvcmNrcGhvdG9zIiwiYSI6ImNrODNvYmc0czAxazMzbW1yZDdyeWZoNjAifQ.PiAIkQrVS4a5c7dBgcElhQ', | ||
}) | ||
|
||
class Map extends React.Component { | ||
render() { | ||
return ( | ||
<div> | ||
<ZoomControl /> | ||
<ReactMap | ||
style="mapbox://styles/mapbox/light-v9" | ||
containerStyle={{ | ||
height: '100vh', | ||
width: '100vw', | ||
}} | ||
zoom={[6.5]} | ||
center={[-123.35, 48.41]} | ||
/> | ||
</div> | ||
) | ||
} | ||
} | ||
|
||
export default Map |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import React from 'react' | ||
|
||
class Taskbar extends React.Component { | ||
clearMarkers() { | ||
console.log('clearing markers') | ||
} | ||
addRaw() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here make it a arrow function. |
||
console.log('Adding raw observations') | ||
} | ||
pull() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. make it a arrow function. |
||
console.log('Pulling from google sheets') | ||
} | ||
refresh() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. make it a arrow function. |
||
console.log('Refreshing markers') | ||
} | ||
openSheet() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. make it a arrow function. |
||
console.log('Opening google sheeet') | ||
} | ||
render() { | ||
return ( | ||
<div className="menubar"> | ||
<button onClick={this.clearMarkers}>Clear new markers</button> | ||
<br /> | ||
<button onClick={this.addRaw}>Add raw observations</button> | ||
<br /> | ||
<button onClick={this.pull}>Pull from Google sheets</button> | ||
<br /> | ||
<button onClick={this.refresh}>Refresh Markers</button> | ||
<br /> | ||
<button onClick={this.openSheet}>Open Google sheets</button> | ||
</div> | ||
) | ||
} | ||
} | ||
|
||
export default Taskbar |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make this an arrow function as with onClick the "this" property changes this code doesn't throws any error for now but we will definitely be using the this property in these functions.