generated from interactive-game-maps/template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
map.js
78 lines (67 loc) · 2.78 KB
/
map.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// Step 0:
// Add all feature geoJSON and layer logic to the `index.html`
// In this example this is:
// * `marker/collectibles.js`
// * `marker/information.js`
// * `marker_logic/collectibles.js`
// * `marker_logic/information.js`
// Step 1:
// Initialize the map with basic information
var interactive_map = new InteractiveMap('map', {
// This will limit automatic zooming to this zoom level
max_good_zoom: 6,
// This is the max zoom the map will allow
max_map_zoom: 7,
website_source: 'https://github.com/interactive-game-maps/dead_island_riptide-flooded_jungle',
website_subdir: 'dead_island_riptide-flooded_jungle',
attribution: `
<li><a href="https://steamcommunity.com/sharedfiles/filedetails/?id=2726060159">Images and description</a> used by <a href="https://steamcommunity.com/profiles/76561198831803856">Kova</a></li>
<li><a href="https://www.nexusmods.com/deadisland/images/42/">Map</a> used by <a href="https://www.nexusmods.com/deadisland/users/730424">rataje</a></li>
<li><a href="https://www.nexusmods.com/deadisland/images/43/">Map</a> used by <a href="https://www.nexusmods.com/deadisland/users/730424">rataje</a></li>
`
});
// Step 2:
// Add at least one tile layer
//
// generate them from an image with (don't forget do adjust the zoom levels `-z`):
// https://github.com/commenthol/gdal2tiles-leaflet
// `./gdal2tiles.py -l -p raster -w none -z 3-5 full_map.jpg map_tiles`
interactive_map.addTileLayer('Ingame map', {
minNativeZoom: 2,
maxNativeZoom: 4,
attribution: 'Map from <a href="https://www.nexusmods.com/deadisland/images/42/">rataje</a>'
});
// Step 2.5 (optional):
// Add more tile layer
// interactive_map.addTileLayer('Overview', {
// minNativeZoom: 2,
// maxNativeZoom: 4,
// attribution: 'Map from <a href="https://www.example.com/index.html">$source</a>'
// }, 'overview_tiles/{z}/{x}/{y}.png');
// Step 3:
// Add at least one marker layer
// The order matters - they will appear in this order in the sidebar and layer control
addDiaries(interactive_map);
// Step 3.5 (optional):
// Add more marker layer
addGuidebooks(interactive_map);
// Step 3.5 (optional):
// Add more marker layer
addMonsters(interactive_map);
// Step 3.5 (optional):
// Add more marker layer
addPostcards(interactive_map);
// Step 3.5 (optional):
// Add more marker layer
addRecordings(interactive_map);
// Step 3.5 (optional):
// Add more marker layer
addSecrets(interactive_map);
// Step 4:
// Finalize the map after adding all layers.
interactive_map.finalize();
// Step 5:
// Open `index.html` to view the map.
// You can now add additional layers by clicking the edit button in the lower left
// While editing a layer you can export the geoJSON in the toolbar on the right when you're done
// and add them here to step 3 to display them fixed for all users.