-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement default MapToolbar & Legend
- Loading branch information
Showing
33 changed files
with
485 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import React from 'react'; | ||
|
||
export default function MapContainer({ children }) { | ||
const [mapTools, map] = React.children(children).toArray(); | ||
return React.cloneElement(map, {}, [mapTools, ...map.props.children]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
import MapContainer from './MapContainer'; | ||
import MapToolbar, { BasemapToggle, OverlayToggle } from './MapToolbar'; | ||
import Map from './Map'; | ||
import MapAutoZoom from './MapAutoZoom'; | ||
import Legend, { BasemapToggle, OverlayToggle } from './Legend'; | ||
|
||
export { Map, MapAutoZoom, Legend, BasemapToggle, OverlayToggle }; | ||
export { | ||
MapContainer, | ||
MapToolbar, | ||
Map, | ||
MapAutoZoom, | ||
BasemapToggle, | ||
OverlayToggle | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { Fragment } from 'react'; | ||
|
||
export default Fragment; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,7 @@ | ||
import BasemapToggle from './BasemapToggle'; | ||
import Legend from './Legend'; | ||
import Map from './Map'; | ||
import MapInteraction from './MapInteraction'; | ||
import MapAutoZoom from './MapAutoZoom'; | ||
import MapIdentify from './MapIdentify'; | ||
import OverlayToggle from './OverlayToggle'; | ||
import MapLayers from './MapLayers'; | ||
|
||
export { | ||
BasemapToggle, | ||
Legend, | ||
Map, | ||
MapInteraction, | ||
MapAutoZoom, | ||
MapIdentify, | ||
OverlayToggle | ||
}; | ||
export { Map, MapInteraction, MapAutoZoom, MapIdentify, MapLayers }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import React from 'react'; | ||
import { useComponents } from '@wq/react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
export default function BasemapToggle({ name, active, setActive }) { | ||
const { ListItem, RadioButton } = useComponents(); | ||
return ( | ||
<ListItem | ||
button | ||
dense | ||
disableGutters | ||
onClick={() => setActive(true)} | ||
icon={() => ( | ||
<RadioButton | ||
style={{ marginLeft: 9 }} | ||
color="primary" | ||
checked={active} | ||
/> | ||
)} | ||
> | ||
{name} | ||
</ListItem> | ||
); | ||
} | ||
|
||
BasemapToggle.propTypes = { | ||
name: PropTypes.string, | ||
active: PropTypes.bool, | ||
setActive: PropTypes.func | ||
}; |
Oops, something went wrong.