-
Notifications
You must be signed in to change notification settings - Fork 816
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
Add MarkerIcon type #1836
Add MarkerIcon type #1836
Conversation
I suggest changing |
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.
Thanks, here are a few improvements
@@ -82,6 +82,15 @@ export interface MarkerLabel { | |||
text: string; | |||
} | |||
|
|||
export interface MarkerIcon { | |||
anchor?: any | Point; |
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 are all of these typed any | Something
?
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.
That's because interface props without ?
causes compile error.
For example, Size
interface checks every prop exists even if I just want to use width & height
export interface Size {
height: number;
width: number;
equals(other: Size): boolean;
toString(): string;
}
I wanted to add question mark on every props of Size
, but I just picked other solution.
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.
because Size is a class, not a literal interface. Google Maps API doesn't just support {width: 100, height: 200}
. You're supposed to use their provided class with constructor. https://developers.google.com/maps/documentation/javascript/reference/coordinates#Size
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.
Got it, I was using it in a wrong way
|
You've got a keen eye :) |
Codecov Report
@@ Coverage Diff @@
## master #1836 +/- ##
=======================================
Coverage 47.97% 47.97%
=======================================
Files 47 47
Lines 1999 1999
Branches 177 177
=======================================
Hits 959 959
Misses 1036 1036
Partials 4 4
Continue to review full report at Codecov.
|
to fix #1622