File tree 2 files changed +7
-22
lines changed
examples/map-3d/src/map-3d
2 files changed +7
-22
lines changed Original file line number Diff line number Diff line change @@ -10,25 +10,18 @@ declare module '@vis.gl/react-google-maps' {
10
10
11
11
// add the <gmp-map-3d> custom-element to the JSX.IntrinsicElements
12
12
// interface, so it can be used in jsx
13
- declare global {
13
+ declare module 'react' {
14
14
// eslint-disable-next-line @typescript-eslint/no-namespace
15
15
namespace JSX {
16
16
interface IntrinsicElements {
17
17
[ 'gmp-map-3d' ] : CustomElement <
18
18
google . maps . maps3d . Map3DElement ,
19
- {
20
- [ key in GmpMap3DAttributeNames ] ?: string ;
21
- }
19
+ google . maps . maps3d . Map3DElement
22
20
> ;
23
21
}
24
22
}
25
23
}
26
24
27
- type GmpMap3DAttributeNames = keyof Omit <
28
- google . maps . maps3d . Map3DElementOptions ,
29
- 'bounds'
30
- > ;
31
-
32
25
// a helper type for CustomElement definitions
33
26
type CustomElement < TElem , TAttr > = Partial <
34
27
TAttr &
Original file line number Diff line number Diff line change @@ -61,24 +61,16 @@ export const Map3D = forwardRef(
61
61
google . maps . maps3d . Map3DElement | null
62
62
> ( forwardedRef , ( ) => map3DElement , [ map3DElement ] ) ;
63
63
64
- const centerString = useMemo ( ( ) => {
65
- const lat = center ?. lat ?? 0.0 ;
66
- const lng = center ?. lng ?? 0.0 ;
67
- const altitude = center ?. altitude ?? 0.0 ;
68
-
69
- return [ lat , lng , altitude ] . join ( ',' ) ;
70
- } , [ center ?. lat , center ?. lng , center ?. altitude ] ) ;
71
-
72
64
if ( ! customElementsReady ) return null ;
73
65
74
66
return (
75
67
< gmp-map-3d
76
68
ref = { map3dRef }
77
- center = { centerString }
78
- range = { String ( props . range ) }
79
- heading = { String ( props . heading ) }
80
- tilt = { String ( props . tilt ) }
81
- roll = { String ( props . roll ) } > </ gmp-map-3d >
69
+ center = { center }
70
+ range = { props . range }
71
+ heading = { props . heading }
72
+ tilt = { props . tilt }
73
+ roll = { props . roll } > </ gmp-map-3d >
82
74
) ;
83
75
}
84
76
) ;
You can’t perform that action at this time.
0 commit comments