Replace legacy Maps embeddable with MapComponent in APM GeoMap#182753
Replace legacy Maps embeddable with MapComponent in APM GeoMap#182753nickpeihl merged 9 commits intoelastic:mainfrom
Conversation
|
Pinging @elastic/kibana-presentation (Team:Presentation) |
|
Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services) |
|
/ci |
...ity_solution/apm/public/components/app/mobile/service_overview/geo_map/embedded_map.test.tsx
Outdated
Show resolved
Hide resolved
...vability_solution/apm/public/components/app/mobile/service_overview/geo_map/embedded_map.tsx
Outdated
Show resolved
Hide resolved
The MapComponent already provides the basemap to the embeddable so there is no need to await the basemap descriptor
...vability_solution/apm/public/components/app/mobile/service_overview/geo_map/embedded_map.tsx
Outdated
Show resolved
Hide resolved
| </> | ||
| <div | ||
| data-test-subj="serviceOverviewEmbeddedMap" | ||
| style={{ width: '100%', height: '500px', display: 'flex', flex: '1 1 100%', zIndex: 1 }} |
There was a problem hiding this comment.
Using style instead of the emotion css method resolves the issue that also affects the main branch where the height of this div may change to 0 when the filters change.
mobile-apm-before.mp4
mobile-apm-after.mp4
| query: `${PROCESSOR_EVENT}:${ProcessorEvent.span} and ${SPAN_SUBTYPE}:${MobileSpanSubtype.Http} and ${SPAN_TYPE}:${MobileSpanType.External}`, | ||
| }; | ||
|
|
||
| const basemapLayerDescriptor = await maps?.createLayerDescriptors?.createBasemapLayerDescriptor(); |
There was a problem hiding this comment.
It's not necessary to add the basemapLayerDescriptor as the MapComponent already takes care of that.
| @@ -34,137 +29,41 @@ function EmbeddedMapComponent({ | |||
| filters: Filter[]; | |||
| dataView?: DataView; | |||
There was a problem hiding this comment.
The dataView passed into this component is an ad-hoc data view created from the useAdHocApmDataView hook. However, the ad-hoc dataview is created without specifying a timeFieldName. So Maps does not think the source is time aware and will not respond to changes to the time picker. This is a bug that currently exists in main as well.
The useAdHocApmDataView hook is used in multiple places in this plugin so I did not feel comfortable making any changes there.
💚 Build Succeeded
Metrics [docs]Async chunks
Canvas Sharable Runtime
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
Summary
Replaces the Maps embeddable with a new MapComponent in the APM solution.
The Maps plugin now provides an easier to use MapComponent for consumers. The legacy MapEmbeddable factory is also being removed as part of #174960 which requires making changes to consumers.
For maintainers