-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Enhancement] Geocoder interaction improvements #1214
Conversation
heshan0131
commented
Aug 3, 2020
•
edited
Loading
edited
- Refactor Geocoder to directly use mapbox client, and customize input dropdown components
- Simplify geocoder component style
- Move geocoder to top right
- Add flyto animation on result
Signed-off-by: Shan He <heshan0131@gmail.com>
Signed-off-by: Shan He <heshan0131@gmail.com>
Signed-off-by: Shan He <heshan0131@gmail.com>
Signed-off-by: Shan He <heshan0131@gmail.com>
Signed-off-by: Shan He <heshan0131@gmail.com>
Signed-off-by: Shan He <heshan0131@gmail.com>
Signed-off-by: Shan He <heshan0131@gmail.com>
Signed-off-by: Shan He <heshan0131@gmail.com>
@b2kdaman FYI |
@heshan0131 gotta update tests |
{!props.isExport && props.currentSample ? <SampleMapPanel {...props} /> : null} | ||
<MapControl {...props} /> | ||
<MapControl {...props} top={0} /> |
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.
One of them seems unnecessary
margin-top: ${props => (props.placement === 'bottom' ? '4px' : 'auto')}; | ||
margin-bottom: ${props => (props.placement === 'top' ? '4px' : 'auto')}; | ||
margin-top: ${props => | ||
props.placement === 'bottom' ? `${props.theme.dropdownWapperMargin}px` : 'auto'}; |
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.
${props.theme.dropdownWapperMargin}px
'px' should be part of dropdownWapperMargin
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.
actually, most of the sizes in kepler theme don't have a specified unit
src/components/geocoder-panel.js
Outdated
import Geocoder from './geocoder/geocoder'; | ||
import {GEOCODER_DATASET_NAME, GEOCODER_LAYER_ID} from 'constants/default-settings'; | ||
|
||
const GEO_OFFSET = 0.05; |
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.
Move to geocoder/constants ?
outline: none; | ||
} | ||
} | ||
top: ${props => props.theme.geocoderTop}px; |
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.
Same with 'px'
Can you imagine if you will have to move from px to em someday?
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.
it's easy to do math without px
, e.g. XXmargin = props.theme.geocoderTop + props.theme.sidepanelPadding
}); | ||
this.removeGeocoderDataset(); | ||
GeocoderPanel.defaultProps = { | ||
transitionDuration: 3000 |
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.
Isn't it too long?
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.
Probably should be calculated in future update. For example if I'm zoomed to Texas and first I look for Dallas an then Austin it would be annoying to wait 3 seconds for such transition.
text, | ||
bbox | ||
} = geoItem; | ||
this.removeGeocoderDataset(); |
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.
I thought we were trying to get away from it and I spent my time working on the solution to avoid creating new datasets/layers outside the mapbox. But I guess that's fine.
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.
this PR only applies cosmetic changes, e.g. pass actions instead of dispatch. your work on changing the rendering methods still applies
src/components/geocoder-panel.js
Outdated
keepExistingConfig: true | ||
}, | ||
config: { | ||
KeplerGlSchema.parseSavedConfig({ |
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.
can this be stored as a constant outside the class?
Signed-off-by: Shan He <heshan0131@gmail.com>
Signed-off-by: Shan He <heshan0131@gmail.com>