diff --git a/examples/zoom-to-bounds/src/map-style.js b/examples/zoom-to-bounds/src/map-style.js index 9cbf56d..3c57310 100644 --- a/examples/zoom-to-bounds/src/map-style.js +++ b/examples/zoom-to-bounds/src/map-style.js @@ -9,8 +9,7 @@ const mapStyle = { mapStyle.sources['sf-neighborhoods'] = { type: 'geojson', - data: - 'https://raw.githubusercontent.com/uber/react-map-gl/master/examples/.data/feature-example-sf.json' + data: 'https://raw.githubusercontent.com/uber/react-map-gl/master/examples/.data/feature-example-sf.json' }; mapStyle.layers.push( diff --git a/src/components/popup.js b/src/components/popup.js index cf87ec5..38e8019 100644 --- a/src/components/popup.js +++ b/src/components/popup.js @@ -174,9 +174,10 @@ function Popup(props) { ); // If eventManager does not exist (using with static map), listen to React event - const onReactClick = useCallback(e => !context.eventManager && onClick(e, thisRef), [ - context.eventManager - ]); + const onReactClick = useCallback( + e => !context.eventManager && onClick(e, thisRef), + [context.eventManager] + ); return (
this.width}); - Object.defineProperty(container, 'clientWidth', {get: () => this.width}); + Object.defineProperty(container, 'offsetWidth', { + configurable: true, + get: () => this.width + }); + Object.defineProperty(container, 'clientWidth', { + configurable: true, + get: () => this.width + }); Object.defineProperty(container, 'offsetHeight', { + configurable: true, get: () => this.height }); Object.defineProperty(container, 'clientHeight', { + configurable: true, get: () => this.height }); @@ -401,8 +409,14 @@ export default class Goong { } _getViewState(props) { - const {longitude, latitude, zoom, pitch = 0, bearing = 0, altitude = 1.5} = - props.viewState || props; + const { + longitude, + latitude, + zoom, + pitch = 0, + bearing = 0, + altitude = 1.5 + } = props.viewState || props; return {longitude, latitude, zoom, pitch, bearing, altitude}; }