visgl / visgl/react-google-maps

[Feat] Custom style to MapControl

Open
#776 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.9k
Forks
193
Avg merge
3d 16h
Merged PRs (30d)
13

Description

Target Use Case

I'm trying to make a "full height" MapControl.

Image
Proposal

Ideally I would be able to pass in a custom style to the component, setting {bottom: "0px"}.

I managed with a workaround that seems very fragile:

  const map = useMap();

  useEffect(() => {
    const control = map?.controls[position].getAt(0);
    if (control?.style)
      control.style.bottom = "0px";
  }, [map, position]);

which works because it's the only component I will have in that position, but any other position I'm screwed 😅

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 at the MapControl component and its current control styling and positioning behavior. Determine how a custom style could set values such as bottom without depending on the first control in a position, then verify that styling works when multiple controls share positions.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.