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

[POI MAPS] Add options for images #210

Conversation

KevinFabre-ods
Copy link
Contributor

@KevinFabre-ods KevinFabre-ods commented Dec 7, 2023

Summary

The goal for this PR is to support adding images to Maps for HDI displays

(Internal for Opendatasoft only) Associated Shortcut ticket: sc-44585.
Can be tested with https://github.com/opendatasoft/platform/pull/11458

Changes

Update the prop images to use addImage options
This allow use to add images where their dimensions do not represent their final size in the map.

For example, In the platform, for Retina displays (pixelRatio: 2), marker images with icons are given to the map as 48x48 images, but they appear as 24x24 in the map.

On HDI displays

Before (blur images) After
Screenshot 2023-12-07 at 10 31 41 Screenshot 2023-12-07 at 10 30 32

Review checklist

  • Description is complete
  • Commits respect the Conventional Commits Specification
  • 2 reviewers (1 if trivial)
  • Tests coverage has improved
  • Code is ready for a release on NPM

@KevinFabre-ods KevinFabre-ods force-pushed the feature/sc-44585/studio-poi-maps-add-icons-to-markers--front-side branch 3 times, most recently from 0530bd4 to 1f85bba Compare December 7, 2023 09:25
@KevinFabre-ods KevinFabre-ods changed the title [POI MAPS] Add pixel ratio option for images [POI MAPS] Add options for images Dec 7, 2023
@KevinFabre-ods KevinFabre-ods force-pushed the feature/sc-44585/studio-poi-maps-add-icons-to-markers--front-side branch from 1f85bba to ee6f780 Compare December 8, 2023 08:57
@KevinFabre-ods KevinFabre-ods marked this pull request as ready for review December 8, 2023 13:03
@etienneburdet
Copy link
Contributor

LGTM!
Quite a few image APIs (Jawg, thunderfortes, mapbox…) are adding a @2x parameters in their API as well. We can add that in our endpoint so that we don't have to ask explicitely for 48px icons.

@KevinFabre-ods KevinFabre-ods merged commit 5a2c299 into main Dec 12, 2023
7 checks passed
@KevinFabre-ods KevinFabre-ods deleted the feature/sc-44585/studio-poi-maps-add-icons-to-markers--front-side branch December 12, 2023 09:50
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