File: mapviewer.js

package info (click to toggle)
osm-gps-map 1.2.0-4
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,020 kB
  • sloc: ansic: 5,381; python: 217; makefile: 207; xml: 45; sh: 33; javascript: 17
file content (34 lines) | stat: -rwxr-xr-x 685 bytes parent folder | download | duplicates (8)
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
#!/usr/bin/seed

// You probbably need to tell GObject introspection where to find the bindings
// export LD_LIBRARY_PATH=../src/.libs/
// export GI_TYPELIB_PATH=../src/

const Gtk = imports.gi.Gtk;
const Osm = imports.gi.OsmGpsMap;

Gtk.init(0, null);

var win = new Gtk.Window({ type: Gtk.WindowType.TOPLEVEL });
win.set_border_width(10);
win.set_default_size(400,400);

// ARRRGGGHHHHH GNOME
if (0)
    // GJS makes me do this
    win.connect("delete-event", Gtk.main_quit);
else
    // Seed makes me do this
    win.signal.delete_event.connect(Gtk.main_quit);

var map = new Osm.OsmGpsMap()
var osd = new Osm.Osd()

map.layer_add(osd)
win.add(map);

win.show_all();

Gtk.main();