Skip to content
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

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft

Conversation

IBanda
Copy link

@IBanda IBanda commented Jul 20, 2021

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;

  • left === 0
  • center === -50%
  • right === -100%

and the following for the Y axis;

  • top === 0
  • center === -50%
  • bottom === -100%

For example

<GoogleMapReact>
<Marker markerPosition="left center"/>
</GoogleMapReact>

center: '-50%',
bottom: '-100%',
};
const isNotProduction = process.env.NODE_ENV !== 'production';
Copy link
Member

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? :)

Copy link
Author

@IBanda IBanda Jul 21, 2021

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

Copy link
Author

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

Copy link
Member

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)

Copy link
Author

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

@@ -320,10 +331,36 @@ export default class GoogleMapMarkers extends Component {
...latLng,
};

const markerPosition = child.props.markerPosition || 'center center';
Copy link
Member

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

Copy link
Author

@IBanda IBanda Jul 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

marker positioning

Just for clarity, is that the same thing referenced in the docs? 👆

Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants