Browse Source

Add preview

pull/2/head
Diego H 2 years ago
parent
commit
d0bcb5576b
  1. 10
      _includes/custom/custom_head.html
  2. 6
      _pages/data.md
  3. 80
      _pages/preview.md
  4. 6
      data/README.md

10
_includes/custom/custom_head.html

@ -11,4 +11,14 @@
<meta name="msapplication-config" content="https://dieghernan.github.io/celestial_data/assets/icons/browserconfig.xml">
<meta name="theme-color" content="#24292f">
{% if page.leaflet %}
<!-- Load Leaflet -->
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css" />
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script>
<script src='https://cdn.jsdelivr.net/gh/leaflet-extras/leaflet-providers@master/leaflet-providers.min.js' ></script>
<script src='https://cdn.jsdelivr.net/gh/calvinmetcalf/leaflet-ajax@gh-pages/dist/leaflet.ajax.min.js' ></script>
{% endif %}
<!-- end custom head snippets -->

6
_pages/data.md

@ -149,7 +149,7 @@ Deep Space Objects
#### Traditional Chinese DSO names
`dsonames.cn.json` with 6 rows
`dsonames.cn.<data format>` with 6 rows
- **id**: Hipparcos number
- **name**: Chinese name
@ -225,7 +225,7 @@ than HIP/HD
#### Traditional Chinese star names
`starnames.cn.json` with 3056 rows
`starnames.cn.<data format>` with 3056 rows
- **id**: Hipparcos number
- **name**: Chinese name
@ -235,7 +235,7 @@ than HIP/HD
#### Stars
`stars.6.<data format>`, `stars.8.<data format>`, `<data format>.14.json`: the
`stars.6.<data format>`, `stars.8.<data format>`, `stars.14.<data format>`: the
number indicates limit magnitude:
- **id**: Short designator

80
_pages/preview.md

@ -0,0 +1,80 @@
---
title: Preview
permalink: /preview
excerpt: Preview data
leaflet: true
---
Preview selected data sets using [Leaflet](https://leafletjs.com/). Some
data (as `dsos` or `stars`) have a large number of features, so they can take
some time before they are loaded.
## Leaflet preview
<form>
<div class="form-group">
<label for="geojson_file">Select a file</label>
<select id="geojson_file" onChange="update()">
<optgroup label="Polygons">
<option value="mw" selected>Milky Way</option>
<option value="constellations.bounds">Constellations (Bounds)</option>
<option value="constellations.bounds.cn">Chinese Constellations (Bounds)</option>
</optgroup>
<optgroup label="Lines">
<option value="asterisms">Asterisms</option>
<option value="constellations.borders">Constellations (Borders)</option>
<option value="constellations.lines">Constellations (Lines)</option>
<option value="constellations.borders.cn">Chinese Constellations (Borders)</option>
<option value="constellations.lines.cn">Chinese Constellations (Lines)</option>
</optgroup>
<optgroup label="Points (some can take a while)">
<option value="constellations">Constellations</option>
<option value="constellations.cn">Chinese Constellations</option>
<option value="dsos.bright">DSOs Bright</option>
<option value="lg">Local Group</option>
<option value="messier">Messier Objects</option>
<option value="stars.6">Stars (magnitude 6 or less)</option>
</optgroup>
</select>
</div>
</form>
<!-- Create map -->
<div class="embed-responsive embed-responsive-16by9">
<div class="embed-responsive-item" id="mapid"></div>
</div>
<script>
var mymap = L.map('mapid', {
maxZoom: 18,
minZoom: 1,
maxBounds: [
//south west
[-90, -180],
//north east
[90, 180]
],
})
.setView([0, 0], 1);
L.tileLayer.provider('CartoDB.DarkMatterNoLabels')
.addTo(mymap);
var geojsonLayer = new L.GeoJSON.AJAX(
"https://cdn.jsdelivr.net/gh/dieghernan/celestial_data@main/data/mw.min.geojson"
);
geojsonLayer.addTo(mymap);
function update() {
mymap.eachLayer(function(layer) {
if (layer instanceof L.GeoJSON) mymap.removeLayer(layer);
});
var select = document.getElementById('geojson_file');
var option = select.options[select.selectedIndex];
var newgeo = option.value;
var geourl =
'https://cdn.jsdelivr.net/gh/dieghernan/celestial_data@main/data/' +
newgeo + '.min.geojson';
var geojsonLayer2 = new L.GeoJSON.AJAX(geourl);
geojsonLayer2.addTo(mymap);
}
</script>

6
data/README.md

@ -138,7 +138,7 @@ Deep Space Objects
### Traditional Chinese DSO names
`dsonames.cn.json` with 6 rows
`dsonames.cn.<data format>` with 6 rows
- **id**: Hipparcos number
- **name**: Chinese name
@ -214,7 +214,7 @@ than HIP/HD
### Traditional Chinese star names
`starnames.cn.json` with 3056 rows
`starnames.cn.<data format>` with 3056 rows
- **id**: Hipparcos number
- **name**: Chinese name
@ -224,7 +224,7 @@ than HIP/HD
### Stars
`stars.6.<data format>`, `stars.8.<data format>`, `<data format>.14.json`: the
`stars.6.<data format>`, `stars.8.<data format>`, `stars.14.<data format>`: the
number indicates limit magnitude:
- **id**: Short designator

Loading…
Cancel
Save