mirror of
https://github.com/DOI-DO/j40-cejst-2.git
synced 2025-08-02 03:14:19 -07:00
Loading a URL with lat/lng/zoom specified does not work (#414)
This commit is contained in:
parent
937770ab3c
commit
3238e09792
4 changed files with 27168 additions and 58 deletions
27198
client/package-lock.json
generated
27198
client/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -51,6 +51,7 @@ export interface IDetailViewInterface {
|
||||||
};
|
};
|
||||||
|
|
||||||
const J40Map = ({location}: IJ40Interface) => {
|
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 [zoom, lat, lng] = location.hash.slice(1).split('/');
|
||||||
const [viewport, setViewport] = useState<ViewportProps>({
|
const [viewport, setViewport] = useState<ViewportProps>({
|
||||||
latitude: lat && parseFloat(lat) || constants.DEFAULT_CENTER[0],
|
latitude: lat && parseFloat(lat) || constants.DEFAULT_CENTER[0],
|
||||||
|
|
20
client/src/components/mapWrapper.tsx
Normal file
20
client/src/components/mapWrapper.tsx
Normal 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;
|
|
@ -1,9 +1,8 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import Layout from '../components/layout';
|
import Layout from '../components/layout';
|
||||||
import J40Map from '../components/J40Map';
|
import MapWrapper from '../components/mapWrapper';
|
||||||
import HowYouCanHelp from '../components/HowYouCanHelp';
|
import HowYouCanHelp from '../components/HowYouCanHelp';
|
||||||
import DownloadPacket from '../components/downloadPacket';
|
import DownloadPacket from '../components/downloadPacket';
|
||||||
import MapLegend from '../components/mapLegend';
|
|
||||||
import * as styles from './cejst.module.scss';
|
import * as styles from './cejst.module.scss';
|
||||||
|
|
||||||
interface IMapPageProps {
|
interface IMapPageProps {
|
||||||
|
@ -52,9 +51,7 @@ const CEJSTPage = ({location}: IMapPageProps) => {
|
||||||
<DownloadPacket />
|
<DownloadPacket />
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<h2>Explore the Tool</h2>
|
<MapWrapper location={location} />
|
||||||
<J40Map location={location}/>
|
|
||||||
<MapLegend />
|
|
||||||
<HowYouCanHelp />
|
<HowYouCanHelp />
|
||||||
</main>
|
</main>
|
||||||
</Layout>
|
</Layout>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue