google-map-react / old-examples

Examples for google-map-react component.
http://google-map-react.github.io/google-map-react/map/main/
357 stars 314 forks source link

Question: When to use translate3d #29

Closed valoricDe closed 7 years ago

valoricDe commented 7 years ago

In one example using the ClusterMarker if seen:

    <Motion
        defaultStyle={defaultMotionStyle}
        style={motionStyle}
    >
        {
            ({scale}) => (
                <div
                    className={styles.marker}
                    style={{
                        transform: `translate3D(0,0,0) scale(${scale}, ${scale})`,
                    }}
                >
                    <div
                        className={styles.text}
                    >
                        {data}
                    </div>
                </div>
            )
        }
    </Motion>

Why is translate3D(0,0,0) used there? When I statically want to relative reposition the pin is translate superior to top, left, position: relative?

istarkov commented 7 years ago

https://davidwalsh.name/translate3d

valoricDe commented 7 years ago

Thanks for the link.