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

[FEAT] Added Map to "View Location" on Trekking Page #232

Merged
merged 7 commits into from
Nov 1, 2024

Conversation

IkkiOcean
Copy link
Contributor

Overview

This PR introduces a Map component to the trekking page of the Uttarakhand website. The modal allows users to view the location of trekking destinations on a Mapbox map, enhancing user experience by providing an interactive geographical context.

Changes Made

  • Added MapModal Component: Created a new MapModal.js component that displays a Mapbox map centered on the specified location of the trekking site.
  • Map Modal CSS: Implemented CSS styles in MapModal.module.css to ensure the map occupies the full modal space and maintains responsiveness.
  • Updated TrekCard Component: Integrated the MapModal in the TrekCard component, enabling users to open the modal and view the location associated with each trek.
  • Map Configuration: Configured Mapbox with appropriate access token and map settings, including zoom level and location markers.

Implementation Details

  • The modal opens when the "VIEW LOCATION" button is clicked within trekking page
  • The map is centered on the location of start of trek , ensuring accurate representation.
  • The modal includes a close button to exit the map view easily.

Screenshots

map.mp4

Related Issues

Additional Notes

  • Make sure to set the environment variable NEXT_PUBLIC_MAPBOX_TOKEN with your Mapbox access token for the map to function correctly.
  • This enhancement aims to improve user interaction and accessibility to trekking locations in Uttarakhand.

Copy link

vercel bot commented Oct 28, 2024

@IkkiOcean is attempting to deploy a commit to the ajaynegi45's projects Team on Vercel.

A member of the Team first needs to authorize it.

@IkkiOcean
Copy link
Contributor Author

IkkiOcean commented Oct 28, 2024

@ajaynegi45

  • My Issue was about adding map to the view location button on trekking page. I have added coordinates of starting of trek to the map so that it helps the viewers.

  • If there are any other things which you want me to add to the website, do tell me as I can raise new issues for them.

happy to contribute :)

Copy link

vercel bot commented Oct 29, 2024

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

Name Status Preview Comments Updated (UTC)
uttarakhand-culture ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 1, 2024 4:03am

Copy link
Owner

@ajaynegi45 ajaynegi45 left a comment

Choose a reason for hiding this comment

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

Hi @IkkiOcean,

Thank you for your prompt work on this issue. I appreciate your dedication to the project.

I have reviewed your work, and I need some changes.

  • How to generate NEXT_PUBLIC_MAPBOX_TOKEN
  • Add googlemap and applemap button above close button. So that when user click on it, It will open and show fastest route from there location.

Once again, thank you for your contribution! ❤️

@IkkiOcean
Copy link
Contributor Author

Hi @IkkiOcean,

Thank you for your prompt work on this issue. I appreciate your dedication to the project.

I have reviewed your work, and I need some changes.

  • How to generate NEXT_PUBLIC_MAPBOX_TOKEN
  • Add googlemap and applemap button above close button. So that when user click on it, It will open and show fastest route from there location.

Once again, thank you for your contribution! ❤️

okay. I will make the changes right away in this same pr

@IkkiOcean
Copy link
Contributor Author

IkkiOcean commented Oct 29, 2024

@ajaynegi45

maops.mp4

How to make Mapbox token:

To generate a Mapbox token, follow these steps:

  1. Sign Up / Log In:

    • Go to Mapbox and sign up for an account or log in if you already have one.
  2. Navigate to Tokens:

  3. Create a New Token:

    • Click on Create a token.
    • You can customize the token permissions, such as restricting access to specific Mapbox APIs or setting a domain restriction to limit where the token can be used.
  4. Name the Token:

    • Give your token a meaningful name, especially if you plan to use multiple tokens for different applications or environments.
  5. Generate the Token:

    • After configuring, click Create token. Your token will appear on the page.
  6. Copy and Use the Token:

    • Copy the token and add it to your environment variables in your project, such as in a .env file:
      NEXT_PUBLIC_MAPBOX_TOKEN=your_generated_token_here
  7. Restart the Development Server:

    • If you added the token to .env, restart your server to load the new environment variable.

Your Mapbox token should now be active and ready to use in your application.

@ajaynegi45
Copy link
Owner

@ajaynegi45

maops.mp4
How to make Mapbox token:

To generate a Mapbox token, follow these steps:

  1. Sign Up / Log In:

    • Go to Mapbox and sign up for an account or log in if you already have one.
  2. Navigate to Tokens:

  3. Create a New Token:

    • Click on Create a token.
    • You can customize the token permissions, such as restricting access to specific Mapbox APIs or setting a domain restriction to limit where the token can be used.
  4. Name the Token:

    • Give your token a meaningful name, especially if you plan to use multiple tokens for different applications or environments.
  5. Generate the Token:

    • After configuring, click Create token. Your token will appear on the page.
  6. Copy and Use the Token:

    • Copy the token and add it to your environment variables in your project, such as in a .env file:
      NEXT_PUBLIC_MAPBOX_TOKEN=your_generated_token_here
  7. Restart the Development Server:

    • If you added the token to .env, restart your server to load the new environment variable.

Your Mapbox token should now be active and ready to use in your application.

In mapbox it is asking for credit card

@ajaynegi45
Copy link
Owner

@ajaynegi45

maops.mp4
How to make Mapbox token:

To generate a Mapbox token, follow these steps:

  1. Sign Up / Log In:

    • Go to Mapbox and sign up for an account or log in if you already have one.
  2. Navigate to Tokens:

  3. Create a New Token:

    • Click on Create a token.
    • You can customize the token permissions, such as restricting access to specific Mapbox APIs or setting a domain restriction to limit where the token can be used.
  4. Name the Token:

    • Give your token a meaningful name, especially if you plan to use multiple tokens for different applications or environments.
  5. Generate the Token:

    • After configuring, click Create token. Your token will appear on the page.
  6. Copy and Use the Token:

    • Copy the token and add it to your environment variables in your project, such as in a .env file:
      NEXT_PUBLIC_MAPBOX_TOKEN=your_generated_token_here
  7. Restart the Development Server:

    • If you added the token to .env, restart your server to load the new environment variable.

Your Mapbox token should now be active and ready to use in your application.

Create button like close.

@IkkiOcean
Copy link
Contributor Author

IkkiOcean commented Oct 30, 2024

@ajaynegi45 yeah most of map services require that for verification. I can send you mine but please keep it hidden as it might exceed the free quota if launched public.
ans wht do you mean by close button. its already there

@ajaynegi45
Copy link
Owner

@ajaynegi45 yeah most of map services require that for verification. I can send you mine but please keep it hidden as it might exceed the free quota if launched public. ans wht do you mean by close button. its already there

Share it on LinkedIn

@ajaynegi45
Copy link
Owner

@ajaynegi45 yeah most of map services require that for verification. I can send you mine but please keep it hidden as it might exceed the free quota if launched public. ans wht do you mean by close button. its already there

Means UI part like close button

@IkkiOcean
Copy link
Contributor Author

@ajaynegi45 yeah most of map services require that for verification. I can send you mine but please keep it hidden as it might exceed the free quota if launched public. ans wht do you mean by close button. its already there

Share it on LinkedIn

sure. accept my request there.

@ajaynegi45
Copy link
Owner

@ajaynegi45 yeah most of map services require that for verification. I can send you mine but please keep it hidden as it might exceed the free quota if launched public. ans wht do you mean by close button. its already there

Something Like this with logo of each map
Screenshot 2024-10-30 at 1 59 33 PM

@IkkiOcean
Copy link
Contributor Author

@ajaynegi45 yeah most of map services require that for verification. I can send you mine but please keep it hidden as it might exceed the free quota if launched public. ans wht do you mean by close button. its already there

Something Like this with logo of each map Screenshot 2024-10-30 at 1 59 33 PM

oh okay

@ajaynegi45
Copy link
Owner

@ajaynegi45 yeah most of map services require that for verification. I can send you mine but please keep it hidden as it might exceed the free quota if launched public. ans wht do you mean by close button. its already there

Something Like this with logo of each map Screenshot 2024-10-30 at 1 59 33 PM

oh okay

Logo like this
Screenshot 2024-10-30 at 2 01 00 PM

@IkkiOcean
Copy link
Contributor Author

IkkiOcean commented Oct 30, 2024

Screenshot 2024-10-30 at 2 25 39 PM @ajaynegi45 done

accept my LinkedIn request, as I cant message you rn.

@ajaynegi45
Copy link
Owner

Screenshot 2024-10-30 at 2 25 39 PM @ajaynegi45 done
accept my LinkedIn request, as I cant message you rn.

Accepted

Copy link
Owner

@ajaynegi45 ajaynegi45 left a comment

Choose a reason for hiding this comment

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

Hi @IkkiOcean,

Thank you for your prompt work on this issue. I appreciate your dedication to the project.

I have reviewed your work, and I need some changes.

Once again, thank you for your contribution! ❤️

@IkkiOcean
Copy link
Contributor Author

@ajaynegi45 made it mobile responsive please check and merge. I am going to raise a new issue for adding more content so please mention the list of new content you want.

WhatsApp.Video.2024-10-31.at.05.43.43.mp4

@ajaynegi45 ajaynegi45 added enhancement New feature or request status: ready for dev You can asked for this issue to be assigned (if not already assigned) labels Nov 1, 2024
@ajaynegi45 ajaynegi45 added hacktoberfest hacktoberfest gssoc GirlScript Summer Of Code hacktoberfest-accepted hacktoberfest level3 GirlScript Summer Of Code - 35 points gssoc-ext GirlScript Summer Of Code labels Nov 1, 2024
@ajaynegi45 ajaynegi45 merged commit fcdaa59 into ajaynegi45:main Nov 1, 2024
3 of 4 checks passed
@ajaynegi45
Copy link
Owner

@ajaynegi45 made it mobile responsive please check and merge. I am going to raise a new issue for adding more content so please mention the list of new content you want.

WhatsApp.Video.2024-10-31.at.05.43.43.mp4

I think the located location are not correct in map

@IkkiOcean
Copy link
Contributor Author

@ajaynegi45 made it mobile responsive please check and merge. I am going to raise a new issue for adding more content so please mention the list of new content you want.
WhatsApp.Video.2024-10-31.at.05.43.43.mp4

I think the located location are not correct in map

they are starting location of the trek gathered from google

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request gssoc GirlScript Summer Of Code gssoc-ext GirlScript Summer Of Code hacktoberfest hacktoberfest hacktoberfest-accepted hacktoberfest level3 GirlScript Summer Of Code - 35 points status: ready for dev You can asked for this issue to be assigned (if not already assigned)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement "View Location" Modal with Map on Trekking Page
2 participants