Skip to content

Commit

Permalink
partial addition for next compliant orcamap
Browse files Browse the repository at this point in the history
  • Loading branch information
parthsarthiprasad committed Mar 23, 2021
1 parent d898a53 commit 0f130d5
Show file tree
Hide file tree
Showing 16 changed files with 161 additions and 21 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
.env.test.local
.env.production.local
.env
.next

npm-debug.log*
yarn-debug.log*
Expand Down
2 changes: 2 additions & 0 deletions next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
2 changes: 2 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
const withImages = require('next-images')
module.exports = withImages()
120 changes: 110 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"google-spreadsheet": "^3.1.15",
"mapbox-gl": "^1.13.0",
"next": "^10.0.9",
"next-images": "^1.7.0",
"ol": "^6.5.0",
"rbush": "^3.0.1",
"react": "^17.0.1",
Expand Down
4 changes: 3 additions & 1 deletion src/components/MapContainer/Layers/VectorLayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import OLVectorLayer from 'ol/layer/Vector'
import { vector } from '../Source'
import GeoJSON from 'ol/format/GeoJSON'
import { get } from 'ol/proj'
import hydropin from './hydropin.png'
import hydropin from '../../../../public/hydropin.png'

// import hydropin from `%PUBLIC_URL%/hydropin.png`

// note: both the VectorLayer styleOptions object
// and the 'source' from line 33 will need to be hoisted
Expand Down
Binary file removed src/components/MapContainer/Layers/hydropin.png
Binary file not shown.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/components/MapContainer/Map/Map.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useRef, useState, useEffect } from 'react'
import './Map.css'
import './Map.module.css'
import MapContext from './MapContext'
import * as ol from 'ol'

Expand Down
Binary file removed src/components/MapContainer/orcapin.png
Binary file not shown.
2 changes: 1 addition & 1 deletion src/config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const envKey = process.env['REACT_APP_GOOGLE_SHEETS_KEY'] || ''
const envKey = process.env['NEXT_PUBLIC_GOOGLE_SHEETS_KEY'] || ''

export default {
apiKey: envKey,
Expand Down
7 changes: 0 additions & 7 deletions src/logo.svg

This file was deleted.

File renamed without changes.
23 changes: 23 additions & 0 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// import App from 'next/app'

function MyApp({ Component, pageProps }) {
return (
<Component {...pageProps} />
)
// return <Component {...pageProps} />
}

// Only uncomment this method if you have blocking data requirements for
// every single page in your application. This disables the ability to
// perform automatic static optimization, causing every page in your app to
// be server-side rendered.
//
// MyApp.getInitialProps = async (appContext) => {
// // calls page's `getInitialProps` and fills `appProps.pageProps`
// const appProps = await App.getInitialProps(appContext);
//
// return { ...appProps }
// }

export default MyApp

13 changes: 13 additions & 0 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from 'react'
import MapContainer from '../components/MapContainer/MapContainer'

const App: React.FC = () => {
return (
<div className="App">
<h1 style={{ textAlign: 'center' }}> (test OL) Orca Map</h1>
<MapContainer />
</div>
)
}

export default App
5 changes: 4 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx"
"jsx": "preserve"
},
"include": [
"src"
],
"exclude": [
"node_modules"
]
}

0 comments on commit 0f130d5

Please sign in to comment.