aboutsummaryrefslogtreecommitdiff
path: root/web/m/app.js
blob: 744bd22bfd1ba11062a1f9ffa0e781ba30283532 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
var mapPanel, toolbar, map;

Ext.application({
    name: "Traccar",

    launch: function() {

        toolbar = Ext.create('Ext.Toolbar', {
            docked: 'top',
            ui: 'light',
            title: 'Traccar'
        });

        mapPanel = Ext.create('Ext.Panel', {
            listeners: {
                painted: function() {

                    var layer = new ol.layer.Tile({ source: new ol.source.OSM({
                    })});

                    var view = new ol.View({
                        center: ol.proj.fromLonLat([ -0.1275, 51.507222 ]),
                        zoom: 6,
                        maxZoom: 16
                    });

                    map = new ol.Map({
                        target: this.bodyElement.dom.id,
                        layers: [ layer ],
                        view: view
                    });
                },

                resize: function() {
                    map.updateSize();
                }
            }
        });

        Ext.create('Ext.Panel', {
            fullscreen: true,
            layout: 'fit',
            items: [toolbar, mapPanel]
        });

    }
});