mapbox / mapbox/mapbox-gl-js

Make sure calls to `map.getProjection()` allows for conformal projection comparisons

Open
#11,490 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

api :memo:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

From @SnailBones in https://github.com/mapbox/mapbox-gl-js/pull/11460

>In the case w[here](https://mapbox.slack.com/archives/C0S9M8WUS/p1644354374673329?thread_ts=1644347492.436719&cid=C0S9M8WUS) we fallback to a stylesheet projection, the projection will be returned in the same format it appears in the stylesheet. i.e. center and parallels can be absent.
>
>This allows us to avoid storing another projection value (map._runtimeProjection or map._implicitProjection).
>
>The potential downside I see in this is that it could impose a challenge for users when attempting to check if two projections are the same. And as Ansis mentions here this could be a breaking change.
>
>One other option to avoid that would be adding a transform.standardizeProjection(projectionSpec) function and standardize the projection here before returning.

Refer https://github.com/mapbox/mapbox-gl-js/pull/11460#discussion_r802076835

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with calls to map.getProjection() and the projection behavior discussed in pull request #11460. Review the linked pull-request discussion to determine how stylesheet projections with absent center and parallels should compare, and whether standardization belongs in transform.standardizeProjection(projectionSpec). Done means projection comparisons are unambiguous without introducing an additional stored projection value.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.