source: subversion/applications/routing/pyroute-dev/sketch.py @ 18454

Last change on this file since 18454 was 18454, checked in by buerste, 10 years ago

-further updates of spaces to tabs

  • Property svn:keywords set to Rev
File size: 1.3 KB
Line 
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4"""Sketch-on-map module for pyroute
5
6Usage:
7"""
8
9
10__version__ = "$Rev: 18454 $"
11__license__ = """This program is free software: you can redistribute it and/or modify
12it under the terms of the GNU General Public License as published by
13the Free Software Foundation, either version 3 of the License, or
14(at your option) any later version.
15
16This program is distributed in the hope that it will be useful,
17but WITHOUT ANY WARRANTY; without even the implied warranty of
18MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19GNU General Public License for more details.
20
21You should have received a copy of the GNU General Public License
22along with this program. If not, see <http://www.gnu.org/licenses/>."""
23_debug = 0
24
25
26from base import pyrouteModule
27import os
28import cairo
29from lib_gpx import lib_gpx
30
31class sketching(pyrouteModule, lib_gpx):
32        """"""
33        def __init__(self, modules):
34                lib_gpx.__init__(self)
35                pyrouteModule.__init__(self, modules)
36
37        def startStroke(self,x,y):
38                lat,lon = self.m['projection'].xy2ll(x,y)
39                self.latest = [(lat,lon)]
40                self.lines.append(self.latest)
41
42        def moveTo(self,x,y):
43                lat,lon = self.m['projection'].xy2ll(x,y)
44                self.latest.append((lat,lon))
45                self.set("needRedraw", 1)
46
47        def save(self):
48                        self.saveAs("data/sketches/latest.gpx")
49
Note: See TracBrowser for help on using the repository browser.