summaryrefslogtreecommitdiff
path: root/geshem.js
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2017-10-14 18:21:29 +0300
committerYuval Adam <_@yuv.al>2017-10-14 18:21:29 +0300
commitafd65a7baa001c3d506ec93453bd501c39df7079 (patch)
tree616871b39d5606e5eeeec05a575866e81522bafc /geshem.js
parent33eef57b24357f4a68d4c210b0b7b3b7633779cd (diff)
Webpack actually works
Diffstat (limited to 'geshem.js')
-rw-r--r--geshem.js92
1 files changed, 45 insertions, 47 deletions
diff --git a/geshem.js b/geshem.js
index dc1daa0..b5cea93 100644
--- a/geshem.js
+++ b/geshem.js
@@ -1,12 +1,10 @@
-import mapboxgl from 'mapbox-gl';
+//import mapboxgl from 'mapbox-gl';
import Vue from 'vue';
-
-Vue.component('root', {
- template: '<div>A custom component!</div>'
-})
+import Geshem from './Geshem.vue'
var app = new Vue({
el: '#app',
+ render: h => h(Geshem),
data: {
imgs: window.imgs,
res: 280,
@@ -28,52 +26,52 @@ var app = new Vue({
}
});
-mapboxgl.accessToken = 'pk.eyJ1IjoieXV2YWRtIiwiYSI6ImNpcnMxbzBuaTAwZWdoa25oczlzZmkwbHcifQ.UHtLngbKm9O8945pJm23Nw';
-var map = new mapboxgl.Map({
- container: 'map',
- style: 'mapbox://styles/mapbox/dark-v9',
- container: 'map',
- maxZoom: 10,
- minZoom: 5,
- zoom: 6.3,
- center: [35, 31.9],
- hash: false
-});
+// mapboxgl.accessToken = 'pk.eyJ1IjoieXV2YWRtIiwiYSI6ImNpcnMxbzBuaTAwZWdoa25oczlzZmkwbHcifQ.UHtLngbKm9O8945pJm23Nw';
+// var map = new mapboxgl.Map({
+// container: 'map',
+// style: 'mapbox://styles/mapbox/dark-v9',
+// container: 'map',
+// maxZoom: 10,
+// minZoom: 5,
+// zoom: 6.3,
+// center: [35, 31.9],
+// hash: false
+// });
-function addRadarSource(res, i, url) {
- map.addSource('radar-' + res + '-' + i, {
- type: 'image',
- url: '/static/img/' + url,
- coordinates: app.rasterCoords[res]
- })
-}
+// function addRadarSource(res, i, url) {
+// map.addSource('radar-' + res + '-' + i, {
+// type: 'image',
+// url: '/static/img/' + url,
+// coordinates: app.rasterCoords[res]
+// })
+// }
-function addRadarLayer(res, i) {
- map.addLayer({
- id: 'radar-' + res + '-' + i,
- source: 'radar-' + res + '-' + i,
- type: 'raster',
- paint: {
- 'raster-opacity': 0.85
- }
- })
-}
+// function addRadarLayer(res, i) {
+// map.addLayer({
+// id: 'radar-' + res + '-' + i,
+// source: 'radar-' + res + '-' + i,
+// type: 'raster',
+// paint: {
+// 'raster-opacity': 0.85
+// }
+// })
+// }
-function removeRadarLayer(res, i) {
- map.removeLayer('radar-' + res + '-' + i)
-}
+// function removeRadarLayer(res, i) {
+// map.removeLayer('radar-' + res + '-' + i)
+// }
-map.on('style.load', function () {
- var i = 0;
- while (i < app.imgs['140'].length) {
- addRadarSource('140', i, app.imgs['140'][i++])
- }
- var i = 0;
- while (i < app.imgs['280'].length) {
- addRadarSource('280', i, app.imgs['280'][i++])
- }
- addRadarLayer('280', 0)
-})
+// map.on('style.load', function () {
+// var i = 0;
+// while (i < app.imgs['140'].length) {
+// addRadarSource('140', i, app.imgs['140'][i++])
+// }
+// var i = 0;
+// while (i < app.imgs['280'].length) {
+// addRadarSource('280', i, app.imgs['280'][i++])
+// }
+// addRadarLayer('280', 0)
+// })