1
/*
2
 * Copyright (C) 2010 Simon Wenner <simon@wenner.ch>
3
 *
4
 * This library is free software; you can redistribute it and/or
5
 * modify it under the terms of the GNU Lesser General Public
6
 * License as published by the Free Software Foundation; either
7
 * version 2.1 of the License, or (at your option) any later version.
8
 *
9
 * This library is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
 * Lesser General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU Lesser General Public
15
 * License along with this library; if not, write to the Free Software
16
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17
 */
18
19
using GLib;
20
using Clutter;
21
22
class DemoLayer : Champlain.MarkerLayer
23
{
24
  public DemoLayer ()
25
  {
26
    Clutter.Color orange = { 0xf3, 0x94, 0x07, 0xbb };
27
    var marker = new Champlain.Label.with_text (
28
        "Montréal\n<span size=\"xx-small\">Québec</span>",
29
        "Serif 14", null, null);
30
    marker.set_use_markup (true);
31
    marker.set_alignment (Pango.Alignment.RIGHT);
32
    marker.set_color (orange);
33
    marker.set_location (45.528178, -73.563788);
34
    add_marker (marker);
35
36
    try {
37
      marker = new Champlain.Label.from_file (
38
          "icons/emblem-generic.png");
39
    } catch (GLib.Error e) {
40
      GLib.warning ("%s", e.message);
41
    }
42
    marker.set_text ("New York");
43
    marker.set_location (40.77, -73.98);
44
    add_marker (marker);
45
46
    try {
47
      marker = new Champlain.Label.from_file (
48
          "icons/emblem-important.png");
49
    } catch (GLib.Error e) {
50
      GLib.warning ("%s", e.message);
51
    }
52
    marker.set_location (47.130885, -70.764141);
53
    add_marker (marker);
54
55
    try {
56
      marker = new Champlain.Label.from_file (
57
          "icons/emblem-favorite.png");
58
    } catch (GLib.Error e) {
59
      GLib.warning ("%s", e.message);
60
    }
61
    marker.set_draw_background (false);
62
    marker.set_location (45.41484, -71.918907);
63
    add_marker (marker);
64
  }
65
}