Skip to content

Commit 7b48ffa

Browse files
authored
Merge pull request #210 from WatWowMap/readme-patch-1
Update README.md for Docs site
2 parents f54f7b1 + 4b6a7ed commit 7b48ffa

File tree

1 file changed

+16
-345
lines changed

1 file changed

+16
-345
lines changed

README.md

Lines changed: 16 additions & 345 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
[![Documentation Status](https://readthedocs.org/projects/mapjs/badge/?version=latest)](https://mapjs.readthedocs.io/en/latest/?badge=latest)
1+
[![Documentation Status](https://readthedocs.org/projects/mapjs/badge/?version=latest)](https://mapjs.readthedocs.io/en/latest/?badge=latest)
22
![Node.js CI](https://github.com/versx/MapJS/workflows/Node.js%20CI/badge.svg)
33
![Lint](https://github.com/versx/MapJS/workflows/Lint/badge.svg)
44

5+
[![GitHub Release](https://img.shields.io/github/release/WatWowMap/MapJS.svg)](https://github.com/WatWowMap/MapJS/releases/)
6+
[![GitHub Contributors](https://img.shields.io/github/contributors/WatWowMap/MapJS.svg)](https://github.com/WatWowMap/MapJS/graphs/contributors/)
7+
[![Discord](https://img.shields.io/discord/552003258000998401.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/zZ9h9Xa)
8+
59
# MapJS
610

711
NodeJS Map clone replacement for [RealDeviceMap](https://github.com/realdevicemap/realdevicemap)
@@ -38,353 +42,20 @@ NodeJS Map clone replacement for [RealDeviceMap](https://github.com/realdevicema
3842

3943
## Installation
4044

41-
1. Clone repository `git clone https://github.com/versx/MapJS`
42-
1. Install dependencies `npm run update`
43-
1. Copy config `cp src/configs/config.example.json src/configs/config.json`
44-
1. Create a Discord bot at https://discord.com/developers and enter the `botToken`, `clientId`, and `clientSecret` in your `config.json`
45-
1. Fill out config `vi src/configs/config.json`
46-
1. Create/copy a `static/custom/nests.json` file to show nests (geoJSON file format)
47-
1. Create/copy a `static/custom/areas.json` file to show scan areas (geoJSON file format, see below)
48-
1. Run `npm start`
49-
1. Access via http://machineip:port/ login using your Discord account
50-
51-
## Configuration
52-
53-
Your `config.json` file is only required for a few options. Anything you do not include will use the `default.json` as a fallback. When viewing the `default.json` file you will see additional settings that can be applied to your `config.json` in order to modify the values. **Please note** json files can not have code comments (`//`) as such we have provided notes on the configuration settings in the below snippet.
54-
55-
```js
56-
{
57-
// Listening interface IP address
58-
"interface": "0.0.0.0",
59-
// Listening port
60-
"port": 8080,
61-
// Map title shown in navigation bar
62-
"title": "MapJS",
63-
// Web page title (shown in tab)
64-
"headerTitle": "MapJS - NodeJS Map Replacement",
65-
// Localization to use for the map
66-
"locale": "en",
67-
// Theme style (dark/light)
68-
"style": "dark",
69-
// Cookie session secret key, make sure to randomize and NOT use default
70-
// either keyboard mash or a generator https://browserling.com/tools/random-hex
71-
"sessionSecret": "98ki^e72~!@#(85o3kXLI*#c9wu5l!Z",
72-
//set the number of sessions (devices) a user is allowed to be signed in on
73-
"maxSessions": 1,
74-
// API rate limiting
75-
"ratelimit": {
76-
// Amount of cooldown time period if rate limit is reached (minutes)
77-
"time": 60,
78-
// Maximum number of API requests that can be made within a minute
79-
"requests": 100
80-
},
81-
// Map settings
82-
"map": {
83-
// Maximum available Pokemon
84-
"maxPokemonId": 649,
85-
// Map start location latitude
86-
"startLat": 0,
87-
// Map start location longitude
88-
"startLon": 0,
89-
// Map start zoom
90-
"startZoom": 12,
91-
// Map minimum zoom level
92-
"minZoom": 10,
93-
// Map maximum zoom level
94-
"maxZoom": 18,
95-
// Defines the color of 70m paths and Quest/IV Polygons
96-
"devicePathColor": "red",
97-
// Clustering settings
98-
"clusters": {
99-
// Enable pokemon clustering
100-
"pokemon": true,
101-
// Enable gym clustering
102-
"gyms": true,
103-
// Enable pokestop clustering
104-
"pokestops": true,
105-
// Zoom level when clustering starts/stops
106-
"zoomLevel": 13
107-
},
108-
// Default filter settings for new users/cleared cache
109-
"filters": {
110-
// Show gyms
111-
"gyms": true,
112-
// Show raids
113-
"raids": false,
114-
// Show raid timers
115-
"raidTimers": false,
116-
// Show pokestops
117-
"pokestops": false,
118-
// Show quests
119-
"quests": false,
120-
// Show invasions
121-
"invasions": false,
122-
// Show invasion timers
123-
"invasionTimers": false,
124-
// Show spawnpoints
125-
"spawnpoints": false,
126-
// Show Pokemon
127-
"pokemon": false,
128-
// Show nests
129-
"nests": false,
130-
// Show S2 scan cells
131-
"scanCells": false,
132-
// Show S2 submission cells
133-
"submissionCells": false,
134-
// Show weather cells
135-
"weather": false,
136-
// Show scan area polygons
137-
"scanAreas": false,
138-
// Show active devices
139-
"devices": false
140-
},
141-
// Pokemon glow settings
142-
"glow": {
143-
"iv": { "value": 100, "color": "red" }, //min IV for glow
144-
"pvp": { "value": 1, "color": "blue" }, //min PVP for glow
145-
"both": { "color": "purple" } //color if a Pokemon meets IV & PVP requirements
146-
}
147-
},
148-
// Areas list with location and zoom dropdown in navbar
149-
"areas": {
150-
"test": { "lat": 4.01, "lon": 117.01, "zoom": 15 }
151-
},
152-
// Custom navigation headers
153-
"header": {
154-
// Left side navigation headers (leave empty `[]` if not needed)
155-
"left": [
156-
{ "name": "Stats", "url": "https://stats.example.com", "icon": "fas fa-chart-bar" }
157-
],
158-
// Right side navigation headers (leave empty `[]` if not needed)
159-
"right": [
160-
{ "name": "Discord", "url": "https://discord.com/invite/example", "icon": "fab fa-discord" }
161-
]
162-
},
163-
// Available tileservers
164-
"tileservers": {
165-
"Default": "https://{s}.basemaps.cartocdn.com/rastertiles/voyager_labels_under/{z}/{x}/{y}{r}.png;Map tiles by Carto, under CC BY 3.0. Data by <a href='https://www.openstreetmap.org/'>OpenStreetMap</a>, under ODbL.",
166-
"OSM": "https://tile.openstreetmap.org/{z}/{x}/{y}.png;Map data © <a href='https://www.openstreetmap.org'>OpenStreetMap</a> contributors",
167-
"Dark Matter": "https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png;© <a href='https://www.openstreetmap.org/copyright'>OpenStreetMap</a> contributors © <a href='https://carto.com/attributions'>CARTO</a>",
168-
"Alidade Smooth Dark": "https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/{z}/{x}/{y}.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",
169-
"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",
170-
"Satellite": "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x};Tiles &copy; Esri &mdash; Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community"
171-
},
172-
// Database settings
173-
"db": {
174-
// RealDeviceMap scanner database settings
175-
"scanner": {
176-
"host": "127.0.0.1",
177-
"port": 3306,
178-
"username": "user",
179-
"password": "pass123!",
180-
"database": "rdmdb",
181-
"charset": "utf8mb4"
182-
},
183-
// PMSF nest script database settings
184-
"manualdb": {
185-
"host": "127.0.0.1",
186-
"port": 3306,
187-
"username": "user",
188-
"password": "pass123!",
189-
"database": "manualdb",
190-
"charset": "utf8mb4"
191-
}
192-
},
193-
// Discord authentication settings
194-
"discord": {
195-
// Enable discord authentication
196-
"enabled": true,
197-
// Channel ID for logging
198-
"logChannelId": "",
199-
// Status display message for the bot
200-
"status": "Map Status: Online",
201-
// Discord bot token
202-
"botToken": "",
203-
// Discord bot client id
204-
"clientId": "",
205-
// Discord bot client secret
206-
"clientSecret": "",
207-
// Discord bot redirect uri
208-
"redirectUri": "http://localhost:8080/api/discord/callback",
209-
// Required guilds in order to authenticate successfully (i.e. ["9834983749834", "9834983743", etc])
210-
// leave empty `[]` for no guild requirement although not recommended.
211-
"guilds": [],
212-
// Map permissions
213-
"perms": {
214-
// View map permissions
215-
"map": {
216-
// Enable map (probably redundant)
217-
"enabled": true,
218-
// Discord roles required in order to view map (leave empty `[]` for no role requirement)
219-
// (i.e ["803948098", "983409830", etc]
220-
"roles": []
221-
},
222-
// View Pokemon permissions
223-
"pokemon": {
224-
// Enable Pokemon
225-
"enabled": true,
226-
// Discord roles required in order to view Pokemon (leave empty `[]` for no role requirement)
227-
// (i.e ["803948098", "983409830", etc]
228-
"roles": []
229-
},
230-
"raids": {
231-
"enabled": true,
232-
"roles": []
233-
},
234-
"gyms": {
235-
"enabled": true,
236-
"roles": []
237-
},
238-
"pokestops": {
239-
"enabled": true,
240-
"roles": []
241-
},
242-
"quests": {
243-
"enabled": true,
244-
"roles": []
245-
},
246-
"lures": {
247-
"enabled": true,
248-
"roles": []
249-
},
250-
"invasions": {
251-
"enabled": true,
252-
"roles": []
253-
},
254-
"spawnpoints": {
255-
"enabled": true,
256-
"roles": []
257-
},
258-
"iv": {
259-
"enabled": true,
260-
"roles": []
261-
},
262-
"pvp": {
263-
"enabled": true,
264-
"roles": []
265-
},
266-
"s2cells": {
267-
"enabled": true,
268-
"roles": []
269-
},
270-
"submissionCells": {
271-
"enabled": true,
272-
"roles": []
273-
},
274-
"nests": {
275-
"enabled": true,
276-
"roles": []
277-
},
278-
"scanAreas": {
279-
"enabled": true,
280-
"roles": []
281-
},
282-
"weather": {
283-
"enabled": true,
284-
"roles": []
285-
},
286-
"devices": {
287-
"enabled": true,
288-
"roles": []
289-
}
290-
}
291-
},
292-
// Google settings
293-
"google": {
294-
// Google analytics key
295-
"analytics": "",
296-
// Google Ad-Sense key
297-
"adsense": ""
298-
},
299-
// Custom icon repository locations
300-
"icons": {
301-
// Default local icon repository
302-
"Default": {
303-
"path": "/img/pokemon"
304-
},
305-
"POGO": {
306-
"path": "https://mygod.github.io/pokicons/v2"
307-
},
308-
// Remote icon repository
309-
"RemotePokemonExample": {
310-
"path": "https://example.com/pokemon_images",
311-
// For repo without index.json support, since we can't traverse a remote directory easily,
312-
// you'll need to provide a list of available forms, shiny, or gender icons so the map is
313-
// aware of available icons that way invalid icons are not shown.
314-
"pokemonList": ["001_00", "002_00", "002_00_shiny", "003_00", "003_00_female", "003_950"]
315-
// expected format is <xxx pokemon id>(_00|_<form id>|_v<temp evolution id>)[_female][_<xx costume id>][_shiny]
316-
// automatic fallback is in place, so the bare minimum you need to provide is "xxx_00" for each pokemon
317-
// and "000" for new pokemon fallback (000 does not need to appear in pokemonList)
318-
// Reference: Asset icon processing tool: https://github.com/Mygod/pokemon-icon-postprocessor
319-
}
320-
},
321-
// Scouting settings
322-
"scouting": {
323-
// Enable scouting
324-
"enabled": false,
325-
// GoFestController endpoint
326-
"url": "",
327-
// Maximum amount of scouts allowed
328-
"maxScouts": 15
329-
},
330-
// Maximum search results for global search to return
331-
"searchMaxResults": 20,
332-
// These fields let you customize each of the preset filter buttons available in the Pokemon Filter menu.
333-
}
334-
```
335-
336-
## Updating
337-
338-
1. `git pull`
339-
1. Run `npm run update` in root folder
340-
1. Run `npm start`
341-
342-
343-
## Scan Areas (`static/custom/areas.json` file to show scan areas on the map)
344-
345-
#### Convert INI geofence format to GeoJSON format
346-
347-
1. Create `geofences` directory in the root of project folder (with src folder)
348-
1. Copy your `.txt` INI format geofence files to the `geofences` folder
349-
1. Run `npm run convert -- ./geofences/` which will convert your INI geofences to one `areas.json` GeoJSON format file in the root of the project folder
350-
1. Copy `areas.json` to `static/custom/areas.json` to show the scan areas on the map
351-
352-
#### Convert Poracle geofence format to GeoJSON format
353-
354-
1. Copy your geofence.json file from Poracle to the root of the project folder (with src folder)
355-
1. Run `npm run convert-poracle -- geofence.json` which will convert the file to an `areas.json` GeoJSON format file in the root of the project folder
356-
1. Copy `areas.json` to `static/custom/areas.json` to show the scan areas on the map
357-
358-
## PM2 (recommended)
359-
360-
Once everything is setup and running appropriately, you can add this to PM2 ecosystem.config.js file so it is automatically started:
45+
[Quick Install Guide](https://wwm.readthedocs.io/projects/mapjs/en/latest/install/quick-start/)
36146

362-
```js
363-
module.exports = {
364-
apps : [{
365-
name: 'MapJS',
366-
script: 'index.js',
367-
cwd: '/home/username/MapJS/src/',
368-
instances: 1,
369-
autorestart: true,
370-
watch: false,
371-
max_memory_restart: '2G',
372-
out_file: 'NULL'
373-
}]
374-
};
375-
```
47+
## [Documentation](https://wwm.readthedocs.io/projects/mapjs/en/latest/)
37648

377-
## TODO
49+
## Contributors
37850

379-
- Notifications
380-
- Notification sounds
381-
- Bouncing marker options
382-
- Heatmaps
383-
- Possibly change filter selection from a list to a grid
384-
- Only clear layers if filter changed
385-
- Icon spacing
386-
- Search quest by task name
387-
- Filter by Pokemon type for Pokemon/raids/quests?
51+
- [versx](https://github.com/versx)
52+
- [Mygod](https://github.com/Mygod)
53+
- [sketchysocks](https://github.com/sketchysocks)
54+
- [clburlison](https://github.com/clburlison)
55+
- [bschultz](https://github.com/bschultz)
56+
- [PartTimeJS](https://github.com/PartTimeJS)
57+
- [darthbutcher](https://github.com/darthbutcher)
58+
- [sabregreen](https://github.com/sabregreen)
38859

38960
## Credits
39061

0 commit comments

Comments
 (0)