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

[Enhancement] Geocoder interaction improvements #1214

Merged
merged 12 commits into from
Aug 3, 2020

Conversation

heshan0131
Copy link
Contributor

@heshan0131 heshan0131 commented Aug 3, 2020

  • 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

Screen Shot 2020-08-03 at 12 30 33 AM

macrigiuseppe and others added 8 commits August 2, 2020 21:40
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>
@heshan0131
Copy link
Contributor Author

@b2kdaman FYI

@heshan0131 heshan0131 changed the title Geocoder component style [Enhancement] Geocoder interaction improvements Aug 3, 2020
Signed-off-by: Shan He <heshan0131@gmail.com>
@b2kdaman
Copy link
Contributor

b2kdaman commented Aug 3, 2020

@heshan0131 gotta update tests

{!props.isExport && props.currentSample ? <SampleMapPanel {...props} /> : null}
<MapControl {...props} />
<MapControl {...props} top={0} />
Copy link
Contributor

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'};
Copy link
Contributor

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

Copy link
Collaborator

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

import Geocoder from './geocoder/geocoder';
import {GEOCODER_DATASET_NAME, GEOCODER_LAYER_ID} from 'constants/default-settings';

const GEO_OFFSET = 0.05;
Copy link
Contributor

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;
Copy link
Contributor

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?

Copy link
Contributor Author

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
Copy link
Contributor

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?

Copy link
Contributor

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();
Copy link
Contributor

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.

Copy link
Contributor Author

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

Signed-off-by: Shan He <heshan0131@gmail.com>
keepExistingConfig: true
},
config: {
KeplerGlSchema.parseSavedConfig({
Copy link
Collaborator

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>
@heshan0131 heshan0131 merged commit c273483 into master Aug 3, 2020
@delete-merged-branch delete-merged-branch bot deleted the geocoder-component-style branch August 3, 2020 22:52
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.

3 participants