GithubHelp home page GithubHelp logo

colbyfayock / gatsby-starter-leaflet Goto Github PK

View Code? Open in Web Editor NEW
115.0 9.0 59.0 3.91 MB

πŸƒ A Gatsby starter with Leafet to quickly build React apps with a map!

Home Page: https://gatsby-starter-leaflet.netlify.com

License: MIT License

JavaScript 71.84% SCSS 28.16%
gatsby leaflet gatsby-site react gatsby-starter gatsby-starters leaflet-map react-leaflet gatsby-cli hacktoberfest

gatsby-starter-leaflet's Introduction

πŸƒ Gatsby Leaflet Starter

All Contributors

Jumpstart your next Gatsby mapping project with Leaflet!

⚑ Quick Deploy

Deploy to Netlify Deploy with Vercel Now

🧰 What This Includes

πŸš€ Getting Started

Requirements

Quick Start

Run the following in your favorite terminal:

gatsby new my-map-app https://github.com/colbyfayock/gatsby-starter-leaflet

Starting from Scratch

yarn global add gatsby-cli
  • Inside the directory of your choice, scaffold a new Gatsby site:
gatsby new my-map-app https://github.com/colbyfayock/gatsby-starter-leaflet

For example, if I want my installation in ~/Code/new-gatsby-site, I would navigate to ~/Code and run:

gatsby new new-gatsby-site https://github.com/colbyfayock/gatsby-starter-leaflet
  • Navigate to your new directory and run:
yarn develop
  • You should now be running a new Gatsby site locally! πŸŽ‰

πŸ—Ί Resources to Learn About Mapping

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Colby Fayock

πŸ’» πŸ“–

Fukuda Naoto

πŸ’»

Digvijay Singh Rathore

πŸ’»

This project follows the all-contributors specification. Contributions of any kind welcome!

gatsby-starter-leaflet's People

Contributors

allcontributors[bot] avatar colbyfayock avatar dependabot[bot] avatar depfu[bot] avatar dsinghrathore avatar fuku710 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gatsby-starter-leaflet's Issues

Update Readme.md

Hello,
There are a few grammatical errors in the Readme.md that I'd like to work on. Please assign this to me.

Could not resolve eslint dependency

Hi there,
Thank you very much for maintaining this repo. I tried to build it on my GNU/Linux Debian 10 system. I have node v10.23.0 and yard 1.22.10 version. I received the following error after running the Quick Start instruction gatsby new my-map-app https://github.com/colbyfayock/gatsby-starter-leaflet. Looks like an eslint dependency issue.

info Creating new site from git: https://github.com/colbyfayock/gatsby-starter-leaflet.git

Cloning into 'my-map-app'...
remote: Enumerating objects: 89, done.
remote: Counting objects: 100% (89/89), done.
remote: Compressing objects: 100% (74/74), done.
remote: Total 89 (delta 1), reused 52 (delta 1), pack-reused 0
success Created starter directory layout
info Installing packages...

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/eslint
npm ERR!   dev eslint@"^7.20.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@"^6.5.1" from [email protected]
npm ERR! node_modules/eslint-config-zurgbot
npm ERR!   dev eslint-config-zurgbot@"^0.1.0" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /home/user/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:

 ERROR 

Command failed with exit code 1: npm install



  Error: Command failed with exit code 1: npm install
  
  - error.js:56 makeError
    [lib]/[gatsby-cli]/[execa]/lib/error.js:56:11
  
  - index.js:114 handlePromise
    [lib]/[gatsby-cli]/[execa]/index.js:114:26
  
  - next_tick.js:68 process._tickCallback
    internal/process/next_tick.js:68:7

Then, I headed for the Starting from Scratch approach. I ran the instruction yarn global add gatsby-cli. After that I also checked the Gatsby version: Gatsby CLI version: 2.19.1. After running the instruction gatsby new my-map-app https://github.com/colbyfayock/gatsby-starter-leaflet I ended up with the same error as in the Quick Start approach. Sadly, I am not able to move forward to run yarn develop.

Is anyone familiar with this issue and does not mind to point me in the right direction?

Cheers,
Stefan

yarn format fails, cannot commit to my clone of this project

I am following your FCC tutorial (Thanks for that) at https://www.freecodecamp.org/news/how-to-create-a-coronavirus-covid-19-dashboard-map-app-in-react-with-gatsby-and-leaflet/

I was trying to commit after Step1 and hit yarn format error with prettier-eslint that blocks commits to my local repo. (Error: 'basePath' should be an absolute path)

I found this link that describes add $PWD as part of the regex string.
prettier/prettier-eslint-cli#208

I use Mac/Linux so I don't have the issue the link describes about Windows.

Thought you should know about this. Thanks again for the FCC tutorial, can't wait to finish working thru it.

Store a reference to the map element?

This may be more of a question than an issue, but I'm having trouble accessing a reference to the map element for future operations. What is the proper way to get a reference to the Map element within the IndexPage component?

Thank you so much, this starter rocks!

'Center' of map is incorrect (in development mode only?)

First off, thank you so much for this and all your really helpful work! I have noticed a small glitch out of the box: on line 66 of index.js, the call to promiseToFlyTo should result in the map being centered on the marker.
However, the map is centered at a location a bit north of the marker (see screenshot on left).

If it helps, I suspect the map may not realize it's been sized to 50% of the viewport (line 5 of _home.scss). When I change that to 100vh (see screenshot on right) the map basically looks the same except more of it is visible, and in this case, the marker is basically centered.

gatsbyLeafletMapCenter

Create tests using leaflet mock

Create some tests using the Leaflet mock under tests/__mocks__.

Particularly, can start with mocking out a map and testing functionality for promiseToZoomIn available in lib/map.

what would it take to port this to gatsby v3?

Sorry this is not really a bug. As a beginner with Gatsby i have been playing with this starter a lot and find it pretty amazing!

As a next exercise i was wondering whether i'd be able to port this to Gatsby v3.

So far i feel like this is above my game.

What would be the steps to do such a thing?

Leaflet starter appears broken

Hi Colby,
Thanks for the advice earlier
Have now tried to build site using your starter - terminal - mac
Gatsby-cli 4.9.0
gatsby new gatsby-leaflet https://github.com/colbyfayock/gatsby-starter-leaflet.git

get these errors and load fails - Not sure if it is just me but does not appear to be working due to dependancy check potentially for everyone.

Hope this help
cheers Mark

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/gatsby
npm ERR! gatsby@"^3.13.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer gatsby@"^2.0.0" from [email protected]
npm ERR! node_modules/gatsby-plugin-react-leaflet
npm ERR! gatsby-plugin-react-leaflet@"3.0.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /Users/me/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:

ERROR

Command failed with exit code 1: npm install

Error: Command failed with exit code 1: npm install

  • error.js:60 makeError
    [global]/[gatsby-cli]/[execa]/lib/error.js:60:11

  • index.js:118 handlePromise
    [global]/[gatsby-cli]/[execa]/index.js:118:26

  • task_queues:96 processTicksAndRejections
    node:internal/process/task_queues:96:5

  • init-starter.js:135 install
    [global]/[gatsby-cli]/lib/init-starter.js:135:7

  • init-starter.js:202 clone
    [global]/[gatsby-cli]/lib/init-starter.js:202:3

  • init-starter.js:343 initStarter
    [global]/[gatsby-cli]/lib/init-starter.js:343:5

  • create-cli.js:460
    [global]/[gatsby-cli]/lib/create-cli.js:460:9

Live watch mode

thank you for the starter, great! But can you plz tell me where to put watch: true to get live updates for the map, marker?

dependency conflict

not sure what doing wrongβ€”on Big Sur with homebrew installed gatsby, node.js, and yarn

Cloning into 'my-map-app'...
remote: Enumerating objects: 89, done.
remote: Counting objects: 100% (89/89), done.
remote: Compressing objects: 100% (74/74), done.
remote: Total 89 (delta 1), reused 52 (delta 1), pack-reused 0
success Created starter directory layout
info Installing packages...

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!   react@"^17.0.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.4.2" from [email protected]
npm ERR! node_modules/gatsby
npm ERR!   gatsby@"^2.28.2" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.