A Google Maps-like UI for Kerbal Space Program (KSP) celestial bodies.
config/dev.exs
to set up the database connection appropriately.mix deps.get
.make develop
.Note that image tiles are not included in this repository:
query params
body
loc
center
zoom
overlays
kerbal-maps
.DATABASE_URL
- something like postgres://username:password@host:port/database
ERLANG_COOKIE
- can be anything, as far as I knowSECRET_KEY_BASE
- get by running mix phx.gen.secret
TILE_CDN_URL
- base URL to where the map tiles are stored, up to but not including the body name, with no trailing slashheroku login
heroku git:remote -a kerbal-maps
heroku container:login
heroku container:push web
heroku container:release web
The map tiles are extracted using the [Sigma-Cartographer]() mod for KSP.
When Sigma-Cartographer loads (when KSP is started), it looks for a file
somewhere in the GameData
directory tree with the extension .cfg
and
containing the tag @SigmaCartographer
. It uses the configuration in this file
to determine what tiles to render and how to render them.
The file should contain one or more sections that look like this.
Maps
{
body = Kerbin
biomeMap = false
colorMap = false
slopeMap = false
satelliteBiome = true
satelliteMap = true
satelliteSlope = true
oceanFloor = true
width = 512
tile = 256
exportFolder = 0
leaflet = false
}
body
is the name of one of the bodies of the Kerbin system, in proper case.
Note:
Jool
is not allowed, as it has no surface, and therefore no map.
tile
should always be 256
.
exportFolder
is the zoom level. Its value should be between 0
and 7
inclusive.
Higher zoom levels are not disallowed, but at level 7 there's already visible rendering artifacts.
width
is correlated to the zoom level. Its value should be 512 * 2^(zoom level)
.
The Ruby script in script/gentiles.rb
can generate the configuration file for you.
The rendered tiles are written to GameData/Sigma/Cartographer/PluginData/(body)/(exportFolder)
.
They require some rearranging and renaming before they can be uploaded to the CDN.
The Ruby script in script/mvtiles.rb
will do that.
Note that on my computer (2.9 GHz Intel Core i7 with 16 GB of memory) rendering a full set of tiles (all three styles, zoom levels 0-7) for a single body takes in excess of twelve hours. Plan accordingly.
mix deps.get
cd assets && npm install
mix phx.server
Now you can visit localhost:4000
from your browser.
Unit tests were written with ESpec.
Execute the specs by running mix espec
.
See the open issues on Github.
Made possible in part by:
Copyright (c) 2018-2019 Craig S. Cottingham, except where stated otherwise.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.