Loading a URL with lat/lng/zoom specified does not work (#414)

This commit is contained in:
Nat Hillard 2021-07-27 20:51:35 -04:00 committed by GitHub
commit 3238e09792
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 27168 additions and 58 deletions

27198
client/package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -51,6 +51,7 @@ export interface IDetailViewInterface {
};
const J40Map = ({location}: IJ40Interface) => {
// Hash portion of URL is of the form #zoom/lat/lng
const [zoom, lat, lng] = location.hash.slice(1).split('/');
const [viewport, setViewport] = useState<ViewportProps>({
latitude: lat && parseFloat(lat) || constants.DEFAULT_CENTER[0],

View file

@ -0,0 +1,20 @@
import * as React from 'react';
import J40Map from './J40Map';
import MapLegend from '../components/mapLegend';
interface IMapWrapperProps {
location: Location
}
const MapWrapper = ({location}: IMapWrapperProps) => {
return (
<section>
<h2>Explore the Tool</h2>
<J40Map location={location}/>
<MapLegend />
</section>
);
};
export default MapWrapper;

View file

@ -1,9 +1,8 @@
import React from 'react';
import Layout from '../components/layout';
import J40Map from '../components/J40Map';
import MapWrapper from '../components/mapWrapper';
import HowYouCanHelp from '../components/HowYouCanHelp';
import DownloadPacket from '../components/downloadPacket';
import MapLegend from '../components/mapLegend';
import * as styles from './cejst.module.scss';
interface IMapPageProps {
@ -52,9 +51,7 @@ const CEJSTPage = ({location}: IMapPageProps) => {
<DownloadPacket />
</div>
</section>
<h2>Explore the Tool</h2>
<J40Map location={location}/>
<MapLegend />
<MapWrapper location={location} />
<HowYouCanHelp />
</main>
</Layout>