Skip to content

Commit

Permalink
chore: add Esri JS
Browse files Browse the repository at this point in the history
Closes #2
  • Loading branch information
stdavis committed Apr 15, 2022
1 parent 4f9279e commit 8726d95
Show file tree
Hide file tree
Showing 7 changed files with 434 additions and 52 deletions.
406 changes: 406 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@arcgis/core": "^4.23.7",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.0.1",
"@testing-library/user-event": "^13.5.0",
Expand Down
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<title>WFRC RTP Projects</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
42 changes: 6 additions & 36 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -1,38 +1,8 @@
.App {
text-align: center;
}

.App-logo {
height: 40vmin;
pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
}
}

.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}

.App-link {
color: #61dafb;
}
@import "https://js.arcgis.com/4.23/@arcgis/core/assets/esri/themes/light/main.css";

@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
html, body, #root, #mapDiv {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
26 changes: 12 additions & 14 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
import Map from '@arcgis/core/Map';
import MapView from '@arcgis/core/views/MapView';
import React from 'react';
import './App.css';
import logo from './logo.svg';
import config from './services/config';

function App() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.js</code> and save to reload.
</p>
<a className="App-link" href="https://reactjs.org" target="_blank" rel="noopener noreferrer">
Learn React
</a>
</header>
</div>
);
React.useEffect(() => {
const map = new Map({
basemap: 'streets-vector',
});
new MapView({ map, container: 'mapDiv', ...config.DEFAULT_EXTENT });
}, []);

return <div id="mapDiv"></div>;
}

export default App;
1 change: 0 additions & 1 deletion src/logo.svg

This file was deleted.

8 changes: 8 additions & 0 deletions src/services/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const config = {
DEFAULT_EXTENT: {
center: [-111.9, 40.75],
zoom: 11,
},
};

export default config;

0 comments on commit 8726d95

Please sign in to comment.