Commit 30fdbb3a authored by Tomas Pettersson's avatar Tomas Pettersson 🏸
Browse files

using standar grunt

parent 80978a52
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n',
sourceMap: true,
sourceMapName: 'dist/<%= pkg.name %>.map'
},
build: {
src: 'dist/<%= pkg.name %>.js',
dest: 'dist/<%= pkg.name %>.min.js'
}
},
concat: {
js: {
src: 'src/*.js',
dest: 'dist/<%= pkg.name %>.js'
},
css: {
src: 'src/*.css',
dest: 'dist/<%= pkg.name %>.css'
}
},
cssmin: {
options: {
shorthandCompacting: false,
roundingPrecision: -1
},
target: {
files: {
'dist/<%= pkg.name %>.min.css': 'dist/<%= pkg.name %>.css'
}
}
},
wiredep: {
task: {
includeSelf: true,
devDependencies: true,
src: ['demo/index.html'],
overrides : {
"uikit": {
"main" : [
"js/uikit.js",
"css/uikit.almost-flat.min.css"
]
},
"ion.rangeSlider": {
"main" : ["js/ion.rangeSlider.min.js", "css/ion.rangeSlider.css", "css/ion.rangeSlider.skinNice.css" ]
},
"L.TimeDimension.layer.particle": {
"main" : ["src/L.TimeDimension.layer.geojsontime.js" ]
},
"leaflet-timedimension-weather": {
"main" : ["src/L.TimeDimension.layer.wms.picasso.js" ]
}
}
}
},
bower_concat: {
all: {
dest: {
'js': 'build/src/lib.min.js',
'css': 'build/src/lib.min.css'
},
bowerOptions: {
relative: false
},
mainFiles: {
'uikit': ['js/uikit.js', 'js/components/notify.min.js', 'css/uikit.almost-flat.min.css', 'css/components/notify.almost-flat.min.css']
},
dependencies: {
'uikit': 'jquery'
}
}
},
copy: {
dist: {
files: [
{
expand: true,
flatten: true,
src: ['dist/<%= pkg.name %>.js', 'dist/<%= pkg.name %>.css'],
dest: 'build/src'
},
{
expand: true,
flatten: true,
src: ['package/index.html', 'package/server.js'],
dest: 'build/'
},
{
expand: true,
flatten: true,
src: 'bower_components/**/images/*',
dest: 'build/images/'
},
{
expand: true,
flatten: true,
src: 'bower_components/**/fonts/*',
dest: 'build/fonts/'
}]
}
},
clean: 'build'
});
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-bower-concat');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-wiredep');
grunt.registerTask('default', ['concat', 'uglify', 'cssmin']);
grunt.registerTask('production', ['clean', 'bower_concat', 'copy']);
};
......@@ -15,15 +15,17 @@
"url": "git@git.smhi.se:stw/leaflet-player-control.git"
},
"dependencies": {
"leaflet": "https://github.com/Leaflet/Leaflet.git#v1.0.0-rc.1",
"leaflet": "https://github.com/Leaflet/Leaflet.git#v1.0.0-rc.1",
"jquery": "latest",
"ion.rangeSlider": "latest",
"reqwest" : "https://github.com/ded/reqwest.git",
"leaflet-timedimension" : "https://github.com/socib/Leaflet.TimeDimension.git#v1.0.2",
"ion.rangeSlider": "latest",
"reqwest" : "https://github.com/ded/reqwest.git",
"leaflet-timedimension" : "https://github.com/socib/Leaflet.TimeDimension.git#v1.0.2",
"moment": "latest",
"uikit": "latest"
},
"devDependencies": {
"L.TimeDimension.layer.particle": "https://git.smhi.se/stw/L.TimeDimension.layer.particle.git",
"leaflet-timedimension-weather": "https://git.smhi.se/stw/L.TimeDimension.layer.weather.git"
},
"license": "MIT",
"ignore": [
......
......@@ -9,49 +9,74 @@
<meta name='copyright' content='STW'>
<meta name='owner' content='STW'>
<link href="../bower_components/leaflet/dist/leaflet.css" rel="stylesheet">
<!-- bower:css -->
<link rel="stylesheet" href="../bower_components/leaflet/dist/leaflet.css" />
<link rel="stylesheet" href="../bower_components/ion.rangeSlider/css/ion.rangeSlider.css" />
<link rel="stylesheet" href="../bower_components/ion.rangeSlider/css/ion.rangeSlider.skinNice.css" />
<link rel="stylesheet" href="../bower_components/leaflet-timedimension/dist/leaflet.timedimension.control.css" />
<link rel="stylesheet" href="../bower_components/uikit/css/uikit.almost-flat.min.css" />
<link rel="stylesheet" href="../src/leaflet-player-control.css" />
<!-- endbower -->
<!--<link href="../bower_components/leaflet/dist/leaflet.css" rel="stylesheet">
<link href="../bower_components/ion.rangeSlider/css/ion.rangeSlider.css" rel="stylesheet">
<link href="../bower_components/ion.rangeSlider/css/ion.rangeSlider.skinNice.css" rel="stylesheet">
<link href="../bower_components/uikit/css/uikit.almost-flat.min.css" rel="stylesheet">
<link href="../src/leaflet-player-control.css" rel="stylesheet">
<link href="../src/leaflet-player-control.css" rel="stylesheet"> -->
</head>
<body>
<div id="map" style="width: 800px; height: 600px"></div>
<p><div id="map1" style="width: 800px; height: 450px"></div></p>
<p><div id="map2" style="width: 800px; height: 450px"></div></p>
<!-- bower:js -->
<script src="../bower_components/leaflet/dist/leaflet-src.js"></script>
<script src="../bower_components/jquery/dist/jquery.js"></script>
<script src="../bower_components/ion.rangeSlider/js/ion.rangeSlider.min.js"></script>
<script src="../bower_components/reqwest/reqwest.js"></script>
<script src="../bower_components/iso8601-js-period/iso8601.min.js"></script>
<script src="../bower_components/leaflet-timedimension/dist/leaflet.timedimension.src.js"></script>
<script src="../bower_components/moment/moment.js"></script>
<script src="../bower_components/uikit/js/uikit.js"></script>
<script src="../bower_components/L.TimeDimension.layer.particle/src/L.TimeDimension.layer.geojsontime.js"></script>
<script src="../bower_components/leaflet-timedimension-weather/src/L.TimeDimension.layer.wms.picasso.js"></script>
<script src="../src/leaflet-player-control.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/ion.rangeSlider/js/ion.rangeSlider.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="../bower_components/leaflet-timedimension-weather/src/L.TimeDimension.layer.wms.picasso.js"></script>
<script src="../src/leaflet-player-control.js"></script>
<script src="../src/leaflet-player-control.js"></script>-->
<script>
var map = L.map('map').setView([ 58.5, 19.0 ], 5);
var map1 = L.map('map1').setView([ 58.5, 19.0 ], 5);
L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom : 18,
attribution : '&copy; <a href="http://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors</a>'
}).addTo(map);
}).addTo(map1);
var language = 'en';
var langData = {
"tTitle" : "Player"
};
var player = new L.Control.Player({
var player1 = new L.Control.Player({
"lang" : language,
"langdata" : langData,
"position": 'bottomleft',
"display" : 'horizontal'
});
map.addControl(player);
map1.addControl(player1);
var timeDimension = player.getTimeDimension();
var timeDimension1 = player1.getTimeDimension();
var wmsLayer1 = L.tileLayer.wms('http://wts.smhi.se/tile/', {
layers: "hiromb-BS01:oceancurrent-arrows_n-europe_4326_",
layers: "NEMO:NS02_oceancurrentarrows_neurope_",
transparent: true,
crs: L.CRS.EPSG900913,
format: 'image/png',
......@@ -63,18 +88,18 @@
var weatherLayer1 = L.timeDimension.layer.wms.picasso(wmsLayer1, {
proxy: 'proxy',
cache: 10,
timeDimension : timeDimension
timeDimension : timeDimension1
});
weatherLayer1.on('metadataload', function(){
console.log('metadata loaded 1');
player.refresh();
player1.refresh();
});
map.addLayer(weatherLayer1);
map1.addLayer(weatherLayer1);
var wmsLayer2 = L.tileLayer.wms('http://wts.smhi.se/tile/', {
layers: "hiromb-BS01:oceancurrent-speed_n-europe_4326_",
layers: "NEMO:NS02_oceancurrentspeed_neurope_",
transparent: true,
crs: L.CRS.EPSG900913,
format: 'image/png',
......@@ -86,15 +111,37 @@
var weatherLayer2 = L.timeDimension.layer.wms.picasso(wmsLayer2, {
proxy: 'proxy',
cache: 10,
timeDimension : timeDimension
timeDimension : timeDimension1
});
weatherLayer2.on('metadataload', function(){
console.log('metadata loaded 2');
player.refresh();
player1.refresh();
});
map.addLayer(weatherLayer2);
map1.addLayer(weatherLayer2);
/*--------------------------------------------------*/
var map2 = L.map('map2').setView([ 58.5, 19.0 ], 5);
L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom : 18,
attribution : '&copy; <a href="http://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors</a>'
}).addTo(map2);
var language = 'en';
var langData = {
"tTitle" : "Player"
};
var player2 = new L.Control.Player({
"lang" : language,
"langdata" : langData,
"position": 'bottomleft',
"display" : 'horizontal'
});
map2.addControl(player2);
var timeDimension2 = player2.getTimeDimension();
</script>
......
{
"name": "noderest",
"description": "Demo REST API with Node",
"version": "0.0.1",
"private": true,
"dependencies": {
"express": "4.x",
"path": "latest",
"request" : "latest"
}
}
\ No newline at end of file
{
"name": "leaflet-player-control",
"description": "Used for demo folder and creating dist folder",
"version": "0.0.1",
"private": true,
"dependencies": {
"express": "4.x",
"multer": "^1.2.0",
"path": "latest",
"request": "latest"
},
"devDependencies": {
"grunt": "^1.0.1",
"grunt-bower-concat": "^1.0.0",
"grunt-contrib-clean": "^1.0.0",
"grunt-contrib-concat": "^1.0.1",
"grunt-contrib-copy": "^1.0.0",
"grunt-contrib-cssmin": "^1.0.1",
"grunt-contrib-uglify": "^2.0.0",
"grunt-wiredep": "^3.0.1"
}
}
......@@ -150,6 +150,11 @@ var L;
Player.prototype.clear = function () {
this.disable();
};
//TODO
// Player: Cannot click in progress bar when playing. Sometimes click are not registered. Try change from onChange to onFinish
// Player: Changing speed while backward play causes forward play
// Player: Both playbuttons are sometimes active at the same time
// Player: Drag handle should be enabled
Player.prototype.addLayout = function () {
var self = this;
self.playerDiv = L.DomUtil.create('div', 'player', self.container);
......
This diff is collapsed.
......@@ -173,6 +173,12 @@ export class Player extends L.Control {
this.disable();
}
//TODO
// Player: Cannot click in progress bar when playing. Sometimes click are not registered. Try change from onChange to onFinish
// Player: Changing speed while backward play causes forward play
// Player: Both playbuttons are sometimes active at the same time
// Player: Drag handle should be enabled
private addLayout() {
var self = this;
self.playerDiv = <HTMLDivElement>L.DomUtil.create('div', 'player', self.container);
......
Supports Markdown
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