Skip to content
Merged
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
5 changes: 0 additions & 5 deletions client/config.js

This file was deleted.

4 changes: 2 additions & 2 deletions client/src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const App = props => {
const getSettings = async () => {
const body = (await Fetch.fetchSettings())
setSettings(body)
setZoom(body.startZoom)
setZoom(body.map.startZoom)
}

useEffect(() => {
Expand All @@ -36,7 +36,7 @@ const App = props => {
<ApolloProvider client={client}>
{settings &&
<MapContainer
center={[settings.startLat, settings.startLon]}
center={[settings.map.startLat, settings.map.startLon]}
zoom={zoom}
whenCreated={setMap}
zoomControl={false} >
Expand Down
26 changes: 13 additions & 13 deletions client/src/components/MapTiles.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ const MapTiles = ({ map, settings }) => {
})
const [position, setPosition] = useState({})
const [selected, setSelected] = useState({
Gyms: false,
Raids: false,
Pokestops: false,
Quests: false,
Invasions: false,
Spawnpoints: false,
Pokemon: false,
IngressPortals: false,
ScanCells: false,
S2Cells: false,
Weather: false,
ScanAreas: false,
Devices: true
Gyms: settings.map.filters.gyms,
Raids: settings.map.filters.raids,
Pokestops: settings.map.filters.pokestops,
Quests: settings.map.filters.quests,
Invasions: settings.map.filters.invasions,
Spawnpoints: settings.map.filters.spawnpoints,
Pokemon: settings.map.filters.pokemon,
IngressPortals: settings.map.filters.portals,
ScanCells: settings.map.filters.scanCells,
S2Cells: settings.map.filters.submissionCells,
Weather: settings.map.filters.weather,
ScanAreas: settings.map.filters.scanAreas,
Devices: settings.map.filters.devices
})

const onMove = useCallback(() => {
Expand Down
2 changes: 1 addition & 1 deletion client/src/services/data/settings.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default async function () {
try {
const response = await fetch(`/api/v1/data/settings`)
const response = await fetch(`/settings`)
if (!response.ok) {
throw new Error(`${response.status} (${response.statusText})`)
}
Expand Down
314 changes: 163 additions & 151 deletions server/src/configs/config.example.json
Original file line number Diff line number Diff line change
@@ -1,157 +1,169 @@
{
"interface": "0.0.0.0",
"port": 8080,
"title": "MapJS",
"headerTitle": "MapJS - NodeJS Map Replacement",
"locale": "en",
"style": "dark",
"sessionSecret": "98ki^e72~!@#(85o3kXLI*#c9wu5l!Z",
"homepage": {
"enabled": false,
"title": "Welcome to MapJS",
"descriptionLine1": "The best place to find Pokemon, Raids, Quests, and more!",
"descriptionLine2": "Please login or join our Discord for more info...",
"discordInvite": "https://discord.gg/yourInvite"
},
"map": {
"startLat": 0,
"startLon": 0,
"startZoom": 12,
"minZoom": 10,
"maxZoom": 18
},
"areas": {
"test": { "lat": 4.01, "lon": 117.01, "zoom": 15 }
"interface": "0.0.0.0",
"port": 8080,
"title": "MapJS",
"headerTitle": "MapJS - NodeJS Map Replacement",
"locale": "en",
"style": "dark",
"sessionSecret": "98ki^e72~!@#(85o3kXLI*#c9wu5l!Z",
"homepage": {
"enabled": false,
"title": "Welcome to MapJS",
"descriptionLine1": "The best place to find Pokemon, Raids, Quests, and more!",
"descriptionLine2": "Please login or join our Discord for more info...",
"discordInvite": "https://discord.gg/yourInvite"
},
"map": {
"startLat": 0,
"startLon": 0,
"startZoom": 12,
"minZoom": 10,
"maxZoom": 18
},
"areas": {
"test": {
"lat": 4.01,
"lon": 117.01,
"zoom": 15
}
},
"header": {
"left": [
{
"name": "Stats",
"url": "https://stats.example.com",
"icon": "fas fa-chart-bar"
}
],
"right": [
{
"name": "Discord",
"url": "https://discord.com",
"icon": "fab fa-discord"
}
]
},
"db": {
"scanner": {
"host": "127.0.0.1",
"port": 3306,
"username": "user",
"password": "pass123!",
"database": "rdmdb",
"charset": "utf8mb4",
"sessionTable": "sessions"
},
"header": {
"left": [
{ "name": "Stats", "url": "https://stats.example.com", "icon": "fas fa-chart-bar" }
],
"right": [
{ "name": "Discord", "url": "https://discord.com", "icon": "fab fa-discord" }
]
"manualdb": {
"host": "127.0.0.1",
"port": 3306,
"username": "user",
"password": "pass123!",
"database": "manualdb",
"charset": "utf8mb4"
}
},
"discord": {
"enabled": false,
"logChannelId": "",
"status": "Map Status: Online",
"botToken": "",
"clientId": "",
"clientSecret": "",
"redirectUri": "http://localhost:8080/api/discord/callback",
"allowedGuilds": [],
"blockedGuilds": [],
"allowedUsers": [],
"perms": {
"map": {
"enabled": true,
"roles": []
},
"pokemon": {
"enabled": true,
"roles": []
},
"raids": {
"enabled": true,
"roles": []
},
"gyms": {
"enabled": true,
"roles": []
},
"pokestops": {
"enabled": true,
"roles": []
},
"quests": {
"enabled": true,
"roles": []
},
"lures": {
"enabled": true,
"roles": []
},
"invasions": {
"enabled": true,
"roles": []
},
"spawnpoints": {
"enabled": true,
"roles": []
},
"iv": {
"enabled": true,
"roles": []
},
"pvp": {
"enabled": true,
"roles": []
},
"s2cells": {
"enabled": true,
"roles": []
},
"submissionCells": {
"enabled": true,
"roles": []
},
"nests": {
"enabled": true,
"roles": []
},
"portals": {
"enabled": true,
"roles": []
},
"scanAreas": {
"enabled": true,
"roles": []
},
"weather": {
"enabled": true,
"roles": []
},
"devices": {
"enabled": true,
"roles": []
}
}
},
"tileservers": {
"Alidade Smooth Dark": "https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/{z}/{x}/{y}{r}.png; &copy; <a href='https://stadiamaps.com/'>Stadia Maps</a>, &copy; <a href='https://openmaptiles.org/'>OpenMapTiles</a> &copy; <a href='http://openstreetmap.org'>OpenStreetMap</a> contributors",
"Thunder Forest": "https://{s}.tile.thunderforest.com/transport-dark/{z}/{x}/{y}.png;&copy; <a href='http://www.thunderforest.com/'>Thunderforest</a>, &copy; <a href='https://www.openstreetmap.org/copyright'>OpenStreetMap</a> contributors"
},
"icons": {
"Default": {
"path": "https://mygod.github.io/pokicons/v2"
},
"db": {
"scanner": {
"host": "127.0.0.1",
"port": 3306,
"username": "user",
"password": "pass123!",
"database": "rdmdb",
"charset": "utf8mb4",
"sessionTable": "sessions"
},
"manualdb": {
"host": "127.0.0.1",
"port": 3306,
"username": "user",
"password": "pass123!",
"database": "manualdb",
"charset": "utf8mb4"
}
"Local Example": {
"path": "/img/pokemon"
},
"discord": {
"enabled": false,
"logChannelId": "",
"status": "Map Status: Online",
"botToken": "",
"clientId": "",
"clientSecret": "",
"redirectUri": "http://localhost:8080/api/discord/callback",
"allowedGuilds": [],
"blockedGuilds": [],
"allowedUsers": [],
"perms": {
"map": {
"enabled": true,
"roles": []
},
"pokemon": {
"enabled": true,
"roles": []
},
"raids": {
"enabled": true,
"roles": []
},
"gyms": {
"enabled": true,
"roles": []
},
"pokestops": {
"enabled": true,
"roles": []
},
"quests": {
"enabled": true,
"roles": []
},
"lures": {
"enabled": true,
"roles": []
},
"invasions": {
"enabled": true,
"roles": []
},
"spawnpoints": {
"enabled": true,
"roles": []
},
"iv": {
"enabled": true,
"roles": []
},
"pvp": {
"enabled": true,
"roles": []
},
"s2cells": {
"enabled": true,
"roles": []
},
"submissionCells": {
"enabled": true,
"roles": []
},
"nests": {
"enabled": true,
"roles": []
},
"portals": {
"enabled": true,
"roles": []
},
"scanAreas": {
"enabled": true,
"roles": []
},
"weather": {
"enabled": true,
"roles": []
},
"devices": {
"enabled": true,
"roles": []
}
}
"Home": {
"path": "https://raw.githubusercontent.com/Mygod/PkmnHomeIcons/icons/icons"
},
"tileservers": {
"Alidade Smooth Dark": "https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/{z}/{x}/{y}{r}.png; &copy; <a href='https://stadiamaps.com/'>Stadia Maps</a>, &copy; <a href='https://openmaptiles.org/'>OpenMapTiles</a> &copy; <a href='http://openstreetmap.org'>OpenStreetMap</a> contributors",
"Thunder Forest": "https://{s}.tile.thunderforest.com/transport-dark/{z}/{x}/{y}.png;&copy; <a href='http://www.thunderforest.com/'>Thunderforest</a>, &copy; <a href='https://www.openstreetmap.org/copyright'>OpenStreetMap</a> contributors"
},
"icons": {
"Default": {
"path": "https://mygod.github.io/pokicons/v2"
},
"Local Example": {
"path": "/img/pokemon"
},
"Home": {
"path": "https://raw.githubusercontent.com/Mygod/PkmnHomeIcons/icons/icons"
},
"Shuffle": {
"path": "https://raw.githubusercontent.com/Mygod/pokedave_shuffle_icons_-ICONS-/master"
}
"Shuffle": {
"path": "https://raw.githubusercontent.com/Mygod/pokedave_shuffle_icons_-ICONS-/master"
}
}
}
}
4 changes: 4 additions & 0 deletions server/src/configs/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -273,5 +273,9 @@
"ultraRare": [],
"regional": [],
"event": []
},
"devOptions": {
"enabled": true,
"graphiql": true
}
}
Loading