Commit 09d044de authored by Tomas Pettersson's avatar Tomas Pettersson 🏸

example nemo images

parent a3a4a2c3
......@@ -16,6 +16,7 @@
"dependencies": {
"leaflet": "https://github.com/Leaflet/Leaflet.git#v1.0.0-rc.1",
"leaflet-timedimension" : "https://github.com/socib/Leaflet.TimeDimension.git#v1.0.2",
"reqwest" : "https://github.com/ded/reqwest.git",
"moment": "latest"
},
"resolutions": {
......
{"SignificantWaveHeight": {"llcon": [48.492, -4.102], "urcon": [65.908, 30.158], "legendColors": [[247, 244, 249], [232, 227, 240], [216, 194, 223], [204, 160, 205], [212, 122, 186], [226, 75, 159], [222, 33, 120], [194, 14, 81], [147, 0, 63], [103, 0, 31]], "unit": "m", "legendValues": [0.0, 0.3, 0.7, 1.0, 1.3, 1.6, 2.0, 2.3, 2.6, 2.9]}, "SeaSurfaceHeight": {"llcon": [48.492, -4.102], "urcon": [65.908, 30.158], "legendColors": [[0, 0, 127], [0, 0, 232], [0, 56, 255], [0, 148, 255], [8, 240, 237], [83, 255, 163], [160, 255, 86], [234, 255, 12], [255, 174, 0], [255, 89, 0], [236, 3, 0], [127, 0, 0]], "unit": "cm", "legendValues": [-42.9, -32.7, -22.5, -12.2, -2.0, 8.2, 18.4, 28.7, 38.9, 49.1, 59.4, 69.6]}, "SeaSurfaceTemperature": {"llcon": [48.492, -4.102], "urcon": [65.908, 30.158], "legendColors": [[0, 0, 127], [0, 0, 254], [0, 96, 255], [0, 212, 255], [76, 255, 170], [166, 255, 79], [255, 229, 0], [255, 126, 0], [255, 22, 0], [127, 0, 0]], "unit": "C", "legendValues": [-5.0, -3.5, -2.1, -0.6, 0.9, 2.4, 3.8, 5.3, 6.8, 8.3]}, "SeaSurfaceIceVelocity": {"llcon": [48.492, -4.102], "urcon": [65.908, 30.158], "legendColors": [[255, 247, 251], [238, 232, 243], [214, 214, 232], [180, 195, 222], [138, 178, 212], [89, 158, 200], [37, 133, 186], [4, 107, 168], [3, 86, 136], [2, 56, 88]], "unit": "m/s", "legendValues": [0.0, 0.05, 0.11, 0.16, 0.21, 0.26, 0.32, 0.37, 0.42, 0.48]}, "WindSpeed": {"llcon": [48.492, -4.102], "urcon": [65.908, 30.158], "legendColors": [], "unit": "m/s", "legendValues": []}, "SeaSurfaceSalinity": {"llcon": [48.492, -4.102], "urcon": [65.908, 30.158], "legendColors": [[247, 244, 249], [232, 227, 240], [216, 194, 223], [204, 160, 205], [212, 122, 186], [226, 75, 159], [222, 33, 120], [194, 14, 81], [147, 0, 63], [103, 0, 31]], "unit": "psu", "legendValues": [0.1, 3.6, 7.0, 10.5, 14.0, 17.4, 20.9, 24.4, 27.8, 31.3]}, "SeaSurfaceCurrentVelocity": {"llcon": [48.492, -4.102], "urcon": [65.908, 30.158], "legendColors": [[255, 247, 251], [238, 232, 243], [214, 214, 232], [180, 195, 222], [138, 178, 212], [89, 158, 200], [37, 133, 186], [4, 107, 168], [3, 86, 136], [2, 56, 88]], "unit": "m/s", "legendValues": [0.0, 0.32, 0.64, 0.96, 1.27, 1.59, 1.91, 2.23, 2.55, 2.87]}}
\ No newline at end of file
......@@ -14,8 +14,6 @@
<link rel="stylesheet" href="../bower_components/leaflet-timedimension/dist/leaflet.timedimension.control.css" />
<!-- endbower -->
<!--<link href="../bower_components/leaflet/dist/leaflet.css" rel="stylesheet">
<link href="../bower_components/leaflet-timedimension/dist/leaflet.timedimension.control.min.css" rel="stylesheet"> -->
</head>
<body>
......@@ -26,16 +24,11 @@
<script src="../bower_components/iso8601-js-period/iso8601.min.js"></script>
<script src="../bower_components/jquery/dist/jquery.js"></script>
<script src="../bower_components/leaflet-timedimension/dist/leaflet.timedimension.src.js"></script>
<script src="../bower_components/reqwest/reqwest.js"></script>
<script src="../bower_components/moment/moment.js"></script>
<script src="../src/L.TimeDimension.layer.wms.picasso.js"></script>
<!-- endbower -->
<!--<script src="../bower_components/leaflet/dist/leaflet-src.js"></script>
<script src="../bower_components/jquery/dist/jquery.js"></script>
<script src="../bower_components/moment/min/moment.min.js"></script>
<script src="../bower_components/iso8601-js-period/iso8601.min.js"></script>
<script src="../bower_components/leaflet-timedimension/dist/leaflet.timedimension.src.withlog.js"></script>
<script src="../src/L.TimeDimension.layer.wms.picasso.js"></script>-->
<script>
......@@ -62,6 +55,27 @@
cache: 10
});
map.addLayer(weatherLayer);
reqwest({
url: "meta",
method: 'get',
type: 'json',
success: function (data) {
console.log(data);
}
});
// var imageUrl = 'D:/stw/OceanRasterPlot/SeaSurfaceCurrentVelocity/SeaSurfaceCurrentVelocity_201704220000Z_0H.png',
// imageBounds = [[48.492, -4.102], [65.908, 30.158]];
// L.imageOverlay(imageUrl, imageBounds).addTo(map);
// var weatherLayer = L.timeDimension.layer.img.nemo('D:/stw/OceanRasterPlot', {
// proxy: 'proxy',
// cache: 10
// });
</script>
</body>
......
......@@ -2,18 +2,12 @@ var express = require('express');
var path = require('path');
var request = require('request');
var app = express();
app.get('/demo/proxy', function (req, res) {
request(req.query.url, function (error, response, body) {
if (!error && response.statusCode == 200) {
res.send(body);
}
})
});
var nemosrcpath = 'demo/';
require('../src/routes/nemoimg')('/demo',nemosrcpath, app);
// app.use(express.static(__dirname + '/../bower_components'));
//console.log(__dirname + '/../bower_components');
app.use('/bower_components', express.static(path.join(__dirname, '../bower_components')));
app.use('/src', express.static(path.join(__dirname, '../src')));
app.use('/demo', express.static(__dirname));
......
module.exports=function(url, path, app) {
var request = require('request');
var fs = require('fs');
app.get(url+'/proxy', function (req, res) {
request(req.query.url, function (error, response, body) {
if (!error && response.statusCode == 200) {
res.send(body);
}
})
});
app.get(url+'/meta',
function (req, res) {
fs.readFile(path+'/OceanRasterPlot/meta.json', 'utf8', function (err, data) {
if (err) throw err;
return res.json(data);
});
});
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment