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

Fixes broken style when using MapboxDirections and MapboxGeocoder #226

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix broken style when using MapboxDirections and MapboxGeocoder
alexshk committed Sep 8, 2019
commit c9209a410e02db850d6097fd69b6fdd558f7e45f
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## 4.0.2
- Adds language parameter to allow turn-by-turn instructions in other [supported languages](https://docs.mapbox.com/api/navigation/#instructions-languages)
- Adds language parameter to allow turn-by-turn instructions in other [supported languages](https://docs.mapbox.com/api/navigation/#instructions-languages)

## 4.0.1
- Update packages to resolve polyline dependency
46 changes: 43 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/controls/geocoder.js
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ export default class Geocoder {

// Template
var el = document.createElement('div');
el.className = 'mapboxgl-ctrl-geocoder';
el.className = 'mapboxgl-ctrl-geocoder mapboxgl-ctrl-geocoder-directions';

Choose a reason for hiding this comment

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

Is there a reason we can't use replace mapboxgl-ctrl-geocoder here with mapboxgl-ctrl-geocoder-directions?

Copy link
Author

Choose a reason for hiding this comment

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

Actually, that was my first thought. But this will break styles for the guys who already using current class name, this why I added additional class

Choose a reason for hiding this comment

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

But does this mean if I'm changing styles for the MapboxGeocoder I'll inadvertently also change the style used by MapboxDirections?

Copy link
Author

Choose a reason for hiding this comment

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

Theoretically, it is possible to break style by adding something in MapboxGeocoder, but I don't think this may happen. For example outline: 2px solid red in MapboxGeocder styles will add a red outline for MapboxDirections because outline isn't overridden in MapboxDirections styles.


var icon = document.createElement('span');
icon.className = 'geocoder-icon geocoder-icon-search';
Loading