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

Update index.jsx #371

Merged
merged 7 commits into from
Feb 7, 2023
Merged

Update index.jsx #371

merged 7 commits into from
Feb 7, 2023

Conversation

lingdeyiyicifang
Copy link
Contributor

make road label hideable, display road label in default.

@vercel
Copy link

vercel bot commented Feb 2, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
running-page ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Feb 4, 2023 at 3:39PM (UTC)

@@ -16,6 +16,10 @@ import RunMarker from './RunMaker';
import RunMapButtons from './RunMapButtons';
import styles from './style.module.scss';

//change 'dispaly' to 'hide' if you want to hide the road label;
const RoadLabelDisplay = 'display';
Copy link
Owner

Choose a reason for hiding this comment

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

make it to bool

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed to 'true' and 'false'

Copy link
Owner

Choose a reason for hiding this comment

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

not that way, you are still using string.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry, not string this time

Comment on lines 20 to 21
const RoadLabelDisplay = true;
const layerList=['road-label', 'waterway-label', 'natural-line-label', 'natural-point-label', 'water-line-label', 'water-point-label', 'poi-label', 'airport-label', 'settlement-subdivision-label', 'settlement-label', 'state-label', 'country-label'];
Copy link
Owner

Choose a reason for hiding this comment

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

move this to config file like we did maybe better

@@ -34,6 +38,13 @@ const RunMap = ({
const map = ref.getMap();
if (map && IS_CHINESE) {
map.addControl(new MapboxLanguage({ defaultLanguage: 'zh-Hans' }));
if (RoadLabelDisplay == false) {
Copy link
Owner

Choose a reason for hiding this comment

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

if (!RoadLabelDisplay)

Comment on lines 44 to 45
for(let layerId of layerList){
map.removeLayer(layerId);
Copy link
Owner

Choose a reason for hiding this comment

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

can we use layerList.forEach((layerId) => {map.removeLayer(layerId)})

Copy link
Contributor Author

Choose a reason for hiding this comment

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

all done 😁

Comment on lines 41 to 42
map.on('load', () => {
MAP_LAYER_LIST.forEach((layerId) => {map.removeLayer(layerId)})
Copy link
Owner

Choose a reason for hiding this comment

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

add two spaces for this lines

Copy link
Contributor Author

Choose a reason for hiding this comment

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

make it looks better and it works fine, but i don't it's right or not

Copy link
Owner

@yihong0618 yihong0618 left a comment

Choose a reason for hiding this comment

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

LGTM can you test in your local env?

@lingdeyiyicifang
Copy link
Contributor Author

LGTM can you test in your local env?

i tested both locally and they both worked fine, now i run the pulled version in vercel for two days it seems ok too

@yihong0618
Copy link
Owner

OK will merge tonight or tomorrow after test

@yihong0618
Copy link
Owner

@lingdeyiyicifang thanks a lot

@yihong0618 yihong0618 merged commit e559a95 into yihong0618:master Feb 7, 2023
jiantian99 pushed a commit to jiantian99/running_page that referenced this pull request Jan 16, 2025
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