Leaflet.KSP is a Lealfet plugin for displaying celestial bodies from Kerbal Space Program.
The plugin powers the community based Kerbal Maps website.
Incorporating Leaflet.KSP into your own site or web based mod is easy:
map = new L.KSP.Map('yourDivId', {
// define options
layers: [ L.KSP.CelestialBody.KERBIN ], // default: kerbin
zoom: L.KSP.CelestialBody.KERBIN.defaultLayer.options.maxZoom
center: [ -0.1027, -74.5754 ], // Kerbal Space Center
bodyControl: true, // show body control. default: false
layerControl: true, // show layer control. default: false
scaleControl: true // show scale control. default: false
});
Leaflet build system is powered by the Node.js platform and Jake, JSHint and UglifyJS libraries, which install easily and work well across all major platforms. Here are the steps to install it:
-
Run the following commands in the command line:
npm install -g jake npm install jshint npm install uglify-js
-
Now that you have everything installed, run
jake
inside the Leaflet.KSP directory. This will check Leaflet source files for JavaScript errors and inconsistencies, and then combine and minify it to the dist folder.
- Author: Joel Pedraza saik0 Google+ Kerbal Forums
- Contributor: Trigger Au [Kerbal Forums] (http://forum.kerbalspaceprogram.com/member.php/59550)
Leaflet.KSP is free software, and may be used and/or distributed under the Simplified BSD License
Copyright (c) 2013, Joel Pedraza All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.