mapbox / mapbox/mapbox-gl-js

Unify mobile styling for Geolocation control to match Mapbox-GL-Geocoder

Open
#9,670 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs discussion :speech_balloon:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

## Motivation
GL-Geocoder and Geolocation are often used together in the same control group. With the latest update to GL-Geocoder, the form field is now `50px` on mobile for easier input selection, providing an awkward layout next to the geolocation control (they match nicely on web).

Solution: Increasing icon size on mobile for easier touch input, and to keep design consistent across components

## Design Alternatives
Add mobile-first styling so the control is 40-50px on smaller screens, and/or modify GL-Geocoder to match at some middle ground.

Alternatives: Regress and remove mobile styling from gl-geocoder component, do nothing

## Design
Increase `mapboxgl-ctrl-icon` size. Drawbacks: 50px could be too large with many icons.

### Mock-Up
Current web:
![image](https://user-images.githubusercontent.com/58695/81455301-b0025280-9143-11ea-86a5-fa6332ae6085.png)

Current mobile:
![image](https://user-images.githubusercontent.com/58695/81455315-c01a3200-9143-11ea-998e-34c7295e7ce1.png)

Some possible alternatives:
Button size `50px`
![image](https://user-images.githubusercontent.com/58695/81455539-649c7400-9144-11ea-87f6-f43b4727bf5a.png)

`background-size: contain`
![image](https://user-images.githubusercontent.com/58695/81455505-4afb2c80-9144-11ea-9c29-70036235accd.png)

`background-size: 80%`
![image](https://user-images.githubusercontent.com/58695/81455580-7e3dbb80-9144-11ea-933c-2d2021d3badc.png)

### Concepts

### Implementation
Mobile-first css changes for `mapboxgl-ctrl-icon` to increase size

n/a

cc @alianthes @scottsfarley93

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

Search the mobile-first CSS rules for `mapboxgl-ctrl-icon` and compare them with the mobile sizing used by Mapbox GL Geocoder. Adjust the geolocation control sizing for touch input while preserving the web layout, then verify the control alongside the geocoder at mobile and desktop widths.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
frontend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.