Skip to content

Commit

Permalink
resolve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Xintong Xia committed Jun 11, 2019
1 parent 0657501 commit 8161b7c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
1 change: 1 addition & 0 deletions examples/controls/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export default class App extends Component {
mapStyle="mapbox://styles/mapbox/dark-v9"
onViewportChange={this._updateViewport}
mapboxApiAccessToken={TOKEN}
style={{overflow: 'hidden'}}
>
{CITIES.map(this._renderCityMarker)}

Expand Down
24 changes: 16 additions & 8 deletions src/components/static-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ const CONTAINER_STYLE = {
overflow: 'hidden'
};

const OVERLAY_CONTAINER_STYLE = {
...CONTAINER_STYLE,
overflow: 'visible'
};

const propTypes = Object.assign({}, Mapbox.propTypes, {
/** The dimensions of the map **/
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
Expand Down Expand Up @@ -275,10 +280,7 @@ export default class StaticMap extends PureComponent<StaticMapProps, State> {
createElement('div', {
key: 'map-overlays',
className: 'overlays',
style: {
...CONTAINER_STYLE,
overflow: 'visible'
},
style: OVERLAY_CONTAINER_STYLE,
children: this.props.children
})
);
Expand All @@ -287,10 +289,16 @@ export default class StaticMap extends PureComponent<StaticMapProps, State> {

render() {
const {className, width, height, style, visibilityConstraints} = this.props;
const mapContainerStyle = Object.assign({position: 'relative'}, style, {
width,
height
});
const mapContainerStyle = Object.assign(
{
position: 'relative'
},
style,
{
width,
height
}
);

const visible =
this.props.visible &&
Expand Down

0 comments on commit 8161b7c

Please sign in to comment.