Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Marker position#1049

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
IBanda wants to merge5 commits intogoogle-map-react:master
base:master
Choose a base branch
Loading
fromIBanda:marker-position

Conversation

IBanda
Copy link

PR to introduce the markerPosition prop to position the marker in regards totransform: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';

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

@IBandaIBandaJul 21, 2021
edited
Loading

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

itsmichaeldiego reacted with thumbs up emoji
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

itsmichaeldiego reacted with thumbs up emoji

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 itisProduction instead, and then doif (!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

@itsmichaeldiegoitsmichaeldiegoJul 22, 2021
edited
Loading

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

@IBandaIBandaJul 22, 2021
edited
Loading

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? 👆

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 freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@itsmichaeldiegoitsmichaeldiegoitsmichaeldiego approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@IBanda@itsmichaeldiego

[8]ページ先頭

©2009-2025 Movatter.jp