Beispiel #1
0
def get_map(latitude, longitude):
    view = Champlain.View()
    view.set_kinetic_mode(True)
    view.set_property("zoom-level", 12)
    view.set_reactive(True)
    view.set_size(500, 350)
    view.center_on(latitude, longitude)

    embed = GtkClutter.Embed.new()
    embed.realize()
    stage = embed.get_stage()
    stage.add_actor(view)

    return embed
Beispiel #2
0
    def get_map(self, latitude, longitude):
        view = Champlain.View()
        view.set_kinetic_mode(True)
        view.set_property("zoom-level", 18)
        view.set_reactive(True)
        view.set_size(1000, 800)
        view.center_on(latitude, longitude)

        layer = Champlain.MarkerLayer()
        marker = Champlain.Point.new()
        marker.set_location(latitude, longitude)
        layer.add_marker(marker)
        view.add_layer(layer)

        embed = GtkClutter.Embed.new()
        embed.realize()
        stage = embed.get_stage()
        stage.add_actor(view)

        return embed
Beispiel #3
0
def main_quit(data):
    Clutter.main_quit()


if __name__ == '__main__':
    total_width = 0

    stage = Clutter.Stage()
    stage.set_size(800, 600)
    # It complains about the number of arguments passed to main_quit()
    #stage.connect('destroy', Clutter.main_quit)
    stage.connect('destroy', main_quit)

    # Create the map view
    view = Champlain.View()
    view.set_size(800, 600)
    stage.add_child(view)

    # Create the buttons
    buttons = Clutter.Actor()
    buttons.set_position(PADDING, PADDING)

    button = make_button('Zoom in')
    buttons.add_child(button)
    button.set_reactive(True)
    (width, height) = button.get_size()
    total_width += width + PADDING
    #button.connect('button-release-event', zoom_in, view)
    button.connect('button-release-event', zoom_in, view)