Skip to content
This repository has been archived by the owner on Oct 12, 2019. It is now read-only.

Commit

Permalink
#96 removed redundant map from addFishingSpot, add calculation to map…
Browse files Browse the repository at this point in the history
… size
  • Loading branch information
tordsta committed Mar 29, 2019
1 parent c70e03f commit 1e9367d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 0 additions & 6 deletions src/components/Forms/components/AddFishingSpot.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {useTranslation} from "react-i18next"
import GeoPointInput from './GeoPointInput'
import TextInput from './TextInput'
import {useStore} from '../../../hooks'
import GoogleMaps from '../../GoogleMapsCustom/GoogleMapsSelectiveMarker'

export const AddFishingSpot = () => {
const [t] = useTranslation("forms")
Expand Down Expand Up @@ -35,11 +34,6 @@ export const AddFishingSpot = () => {
value={label}
/>
</Grid>
{/*TODO: make map responsive, not static size */}
<GoogleMaps
mapHeight={400}
mapWidth={400}
/>
<Grid container direction="column" item justify="center">
<GeoPointInput
dataId="value"
Expand Down
6 changes: 4 additions & 2 deletions src/components/Forms/components/GeoPointInput.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@ const GeoPointInput = ({disabled, dataId, label, onChange, value: {latitude, lon
// when user moves away from the field, update the global state
const handleBlur = () => onChange(dataId, localValue)

//TODO: calculate the size of the map, should be improved to update on window rescale

return (
<>
<GoogleMaps
mapHeight={400}
mapWidth={400}
mapHeight={window.innerHeight*0.5}
mapWidth={window.innerWidth*0.8}
/>
<InputLabel>{label}</InputLabel>
{["latitude", "longitude"].map(degree =>
Expand Down

0 comments on commit 1e9367d

Please sign in to comment.