Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: set configurable pass react 18 render twice, and format lint #2

Merged
merged 1 commit into from
Dec 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions examples/zoom-to-bounds/src/map-style.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
7 changes: 4 additions & 3 deletions src/components/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<div
Expand Down
22 changes: 18 additions & 4 deletions src/goong/goong.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,12 +317,20 @@ export default class Goong {
// This eliminates the timing issue between calling resize() and DOM update
/* eslint-disable accessor-pairs */
const {container} = props;
Object.defineProperty(container, 'offsetWidth', {get: () => 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
});

Expand Down Expand Up @@ -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};
}

Expand Down