forked from anitagraser/TimeManager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
timemanager.py
55 lines (46 loc) · 1.99 KB
/
timemanager.py
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
48
49
50
51
52
53
54
55
#!/usr/bin/python
# -*- coding: UTF-8 -*-
#=============================================================
#=================== TimeManager ========================
#=================== a QGIS Plug-In ========================
#=============================================================
#
# ***************************************************************************
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it under the terms of the GNU General Public License as published by *
# * the Free Software Foundation; either version 2 of the License, or *
# * (at your option) any later version. *
# * *
# ***************************************************************************
from qgis.core import *
from qgis.utils import qgsfunction
from timemanagercontrol import TimeManagerControl
import resources # loads the icons
class timemanager:
""" plugin information """
name = "TimeManagerPlugin"
longName = "TimeManager Plugin for QGIS >= 2.0"
description = "Working with temporal vector data"
version = "Version 1.0.2"
qgisMinimumVersion = '2.0'
author = "Anita Graser"
pluginUrl = "https://github.com/anitagraser/TimeManager"
control = None
def __init__( self, iface ):
"""initialize the plugin"""
global control
try:
control
except NameError:
control = TimeManagerControl(iface)
def initGui( self ):
"""initialize the gui"""
control.initGui()
def unload( self ):
"""Unload the plugin"""
control.unload()
@qgsfunction(0, "TimeManager")
def animation_datetime(values, feature, parent):
"""called by QGIS to determine the current animation time"""
return str(control.getCurrentTimePosition())