mirror of
https://github.com/google-map-react/google-map-react.git
synced 2025-12-08 18:26:32 +00:00
Update 'positioning a marker' docs (#599)
Better way to position a marker
This commit is contained in:
parent
78256b1d5e
commit
03cd34dc79
8
API.md
8
API.md
@ -238,13 +238,11 @@ Initially any map object has its top left corner at lat lng coordinates. It's up
|
||||
Example (centering the marker):
|
||||
|
||||
```javascript
|
||||
const MARKER_SIZE = 40;
|
||||
const greatPlaceStyle = {
|
||||
position: 'absolute',
|
||||
width: MARKER_SIZE,
|
||||
height: MARKER_SIZE,
|
||||
left: -MARKER_SIZE / 2,
|
||||
top: -MARKER_SIZE / 2
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user