-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Maps] add View Control displaying coordinates at mouse position #28023
Conversation
@cchaos Could I please get some design help. I need help moving the ViewControl to the bottom of the page and am not sure if my CSS classes are named according to guidelines. |
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.
Some random small stuff i saw on this one.
x-pack/plugins/gis/public/_main.scss
Outdated
@@ -34,21 +34,24 @@ map-listing, .gisListingPage { | |||
flex-grow: 1; | |||
} | |||
|
|||
.LayerControl { | |||
.widgetOverlay { |
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.
If you can, prefix your css with your app.... I'd recommend .mapWidgetOverlay
or .gisWidgetOverlay
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 will you gis even though the app is called map because gis is more unique and this is not user facing
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.
@nreese Are you going to change these soon? I'm almost ready to submit my pr for you
x-pack/plugins/gis/public/_main.scss
Outdated
padding-bottom: 8px; | ||
border-color: transparent; | ||
|
||
&.euiPanel--shadow { | ||
@include euiBottomShadowLarge; | ||
} | ||
|
||
.LayerControl--header { | ||
.WidgetControl--header { | ||
padding: 16px 16px 8px; |
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.
Use eui sizes
@@ -64,7 +64,6 @@ export class MBMapContainer extends React.Component { | |||
const initialZoom = this.props.mapState.zoom; | |||
const initialCenter = this.props.mapState.center; | |||
this._mbMap = await createMbMapInstance(this.refs.mapContainer, initialZoom, initialCenter); | |||
window._mbMap = this._mbMap; |
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.
Not sure why _mbMap
was ever exposed on window but this should not be so I removed it
💔 Build Failed |
PR4U nreese#28 |
💔 Build Failed |
💔 Build Failed |
💚 Build Succeeded |
Pinging @elastic/kibana-gis |
💔 Build Failed |
flaky x-pack tests X-Pack SAML API Integration Tests.x-pack/test/saml_api_integration/apis/security/saml_login·js jenkins, test this |
💚 Build Succeeded |
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.
tested. nice eye for detail, e.g. readout goes blank when mouse leaves the map.
…stic#28023) * put mouse position in store * widget overview component * Fixing layout of overlay (#28) * move layer_control and layer_toc under widget_overview folder * clear mouse coordinates when mouse leaves map * change how settig map view works to avoid state timing bug * debounce moveend event
Summary
This PR creates a new
ViewControl
that displays the coordinates of the mouse. The PR also moves theSet View
button from theLayerControl
into theViewControl
.The PR cleans up the director structor of public/components by moving layer_control, layer_toc, and set_view under widget_overlay folder since that is where they are used and public/components is getting rather messy.
Setting state so often via SET_MOUSE_COORDINATES highlighted an existing timing issue that results in map panning and zooming unexpectedly snapping back to its previous location. The bug was that the store extent state was only updated when
moveend
was triggered. The problem was caused if state was changed beforemoveend
could fire. The original implementation of_syncMbMapWithMapState
would update map center and zoom with the stale values from the store instead of current values from mapbox. This PR fixes that bug as well since it made it happen all the time.Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.For maintainers