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

ui-warped-map: downgrade maplibre-gl to v4 #825

Merged
merged 1 commit into from
Jan 15, 2025
Merged

Conversation

emersion
Copy link
Member

maplibre-gl v5 causes multiple issues:

  • The story is broken (JavaScript error trying to set pixelsToGLUnits). Upstream bug report: [Bug] Error with Maplibre 5 and React Map GL (pixelsToGLUnits) visgl/react-map-gl#2460

  • A new TypeScript error pops up, went unnoticed because CI doesn't fail on these:

      (!) [plugin typescript] src/components/DataLoader.tsx (61:43): @rollup/plugin-typescript TS2345: Argument of type 'GeoJSONFeature' is not assignable to parameter of type 'MapGeoJSONFeature'.
        Type 'GeoJSONFeature' is missing the following properties from type '{ layer: (Omit<FillLayerSpecification, "source"> | Omit<LineLayerSpecification, "source"> | Omit<SymbolLayerSpecification, "source"> | ... 5 more ... | Omit<...>) & { ...; }; source: string; sourceLayer?: string | undefined; state: { ...; }; }': layer, source, state
      /home/simon/src/osrd-ui/ui-warped-map/src/components/DataLoader.tsx:61:43
    
      61               .map((f) => simplifyFeature(f, sourceLayer));
    

This commit effectively reverts #797

maplibre-gl v5 causes multiple issues:

- The story is broken (JavaScript error trying to set pixelsToGLUnits).
  Upstream bug report: visgl/react-map-gl#2460
- A new TypeScript error pops up, went unnoticed because CI doesn't
  fail on these:

    (!) [plugin typescript] src/components/DataLoader.tsx (61:43): @rollup/plugin-typescript TS2345: Argument of type 'GeoJSONFeature' is not assignable to parameter of type 'MapGeoJSONFeature'.
      Type 'GeoJSONFeature' is missing the following properties from type '{ layer: (Omit<FillLayerSpecification, "source"> | Omit<LineLayerSpecification, "source"> | Omit<SymbolLayerSpecification, "source"> | ... 5 more ... | Omit<...>) & { ...; }; source: string; sourceLayer?: string | undefined; state: { ...; }; }': layer, source, state
    /home/simon/src/osrd-ui/ui-warped-map/src/components/DataLoader.tsx:61:43

    61               .map((f) => simplifyFeature(f, sourceLayer));

This commit effectively reverts:
#797

Signed-off-by: Simon Ser <contact@emersion.fr>
@emersion emersion requested a review from SharglutDev January 14, 2025 15:08
@emersion emersion requested a review from a team as a code owner January 14, 2025 15:08
@emersion
Copy link
Member Author

Also opened visgl/react-map-gl#2464

@emersion emersion self-assigned this Jan 14, 2025
Copy link
Contributor

@SharglutDev SharglutDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you !

@emersion emersion added this pull request to the merge queue Jan 15, 2025
Merged via the queue into dev with commit 5e28bd8 Jan 15, 2025
6 checks passed
@emersion emersion deleted the emr/maplibre-gl-4 branch January 15, 2025 08:31
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.

2 participants