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

Configuração inicial #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
50 changes: 49 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,49 @@
# Mapa
# Mapa

### Documentações

- [leaflet](https://leafletjs.com/)
- [React leaflet](https://react-leaflet.js.org/)

## Instalando pacotes

```bash
$ npm install || npm i
```

## Iniciando a aplicação

```bash
$ npm run dev
```

## Exemplo componente Mapa

```js
<MapContainer className="map-container" center={[0, 0]} zoom={12}>
<TileLayer
attribution='&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
/>
</MapContainer>
```

## Exemplo componente Marcador

```js
<MapContainer>
<TileLayer />
<Marker position={[0, 0]}></Marker>
</MapContainer>
```

## Exemplo componente Popup

```js
<MapContainer>
<TileLayer />
<Marker>
<Popup>Texto</Popup>
</Marker>
</MapContainer>
```
28 changes: 28 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'

export default tseslint.config(
{ ignores: ['dist'] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
},
)
13 changes: 13 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Mapa</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
54 changes: 54 additions & 0 deletions mock/db.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"gps": [
{
"id": 1,
"Inf": "Aeroporto de Macapá",
"Loc": [0.050292132425339454, -51.06709242023383]
},
{
"id": 2,
"Inf": "Fortaleza De São José de Macapá",
"Loc": [0.031105562504088052, -51.049215388510994]
},
{
"id": 3,
"Inf": "34º Batalhão de Infantaria de Selva",
"Loc": [0.037190132958705276, -51.08640868836398]
},
{
"id": 4,
"Inf": "Cemitério São José de Macapá",
"Loc": [0.032733493290116246, -51.07474843052968]
},
{
"id": 5,
"Inf": "Universidade Federal do Amapá (UNIFAP)",
"Loc": [-0.005410965103446542, -51.082855317577824]
},
{
"id": 6,
"Inf": "Embrapa Amapá",
"Loc": [-0.01214761560736622, -51.08270221188751]
},
{
"id": 7,
"Inf": "Praça Samaúma",
"Loc": [0.009621647220539493, -51.059882671860514]
},
{
"id": 8,
"Inf": "Praça Chico Noé",
"Loc": [0.04997188021467543, -51.0532054307359]
},
{
"id": 9,
"Inf": "Clube Militar Toca da Onça",
"Loc": [0.03489508643101618, -51.09104677357554]
},
{
"id": 10,
"Inf": "Marco Zero do Equador",
"Loc": [0.0010336345638769823, -51.07810392369548]
}
]
}
Loading