New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Marker position #1049
base: master
Are you sure you want to change the base?
Marker position #1049
Conversation
src/google_map_markers.js
Outdated
center: '-50%', | ||
bottom: '-100%', | ||
}; | ||
const isNotProduction = process.env.NODE_ENV !== 'production'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are using it to determine whether to console.error when an invalid prop value is provided
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trying to match how proptypes works
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, sounds good! We could call it isProduction
instead, and then do if (!isProduction)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright :) I will make that update
src/google_map_markers.js
Outdated
@@ -320,10 +331,36 @@ export default class GoogleMapMarkers extends Component { | |||
...latLng, | |||
}; | |||
|
|||
const markerPosition = child.props.markerPosition || 'center center'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Default should be google map's default, which is center bottom
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@IBanda We're changing the default position, yes, therefore we have to update the docs
PR to introduce the markerPosition prop to position the marker in regards to
transform:translate(x,y)
.The prop takes a string composed of the X axis value and Y axis value separated by a single white space
The prop can take following values for the X axis;
and the following for the Y axis;
For example