-
Notifications
You must be signed in to change notification settings - Fork 945
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
Listingpage static map #869
Conversation
6c31d07
to
0f75296
Compare
src/components/Map/StaticMap.js
Outdated
|
||
// Extract color from string. Given value should be either with '#' (e.g. #FFFFFF') or without it. | ||
const formatColorFromString = color => { | ||
if (typeof color !== 'string' && /^#[0-9A-F]{6}$/i.test(color)) { |
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.
What should the type be here if not string?
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.
Should it be typeof color === 'string'
? Same thing also below.
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.
Great work @Gnito! This must be one of the most impressive PRs I've seen in FTW 👏
// The resize event is flooded when the browser is resized. We'll | ||
// use a small timeout to throttle changing the viewport since it | ||
// will trigger rerendering. | ||
const THROTTLE_WAIT_MS = 200; |
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.
👍
0f75296
to
fae2cc6
Compare
NOTE 1: fuzzy location needs some extra work otherwise every page refresh is going to change the static map URL.
NOTE 2: map marker is moved to public/static/icons folder to be available for Google's static map API (works in production - localhost shows an error on top right corner of the generated map since the googleapis.com can't fetch the image from localhost.)