Last change
on this file since 2539 was
1,
checked in by myroslav, 18 years ago
|
Building directory structure
|
-
Property svn:eol-style set to
native
|
File size:
1.0 KB
|
Line | |
---|
1 | # zope 3 imports |
---|
2 | from zope.interface import implements |
---|
3 | |
---|
4 | # Five imports |
---|
5 | from Products.Five.browser import BrowserView |
---|
6 | |
---|
7 | # Product imports |
---|
8 | from geo.interfaces import IPoint |
---|
9 | from Products.geolocation.interfaces.geolocation import IPointView |
---|
10 | |
---|
11 | class PointView(BrowserView): |
---|
12 | |
---|
13 | implements(IPointView) |
---|
14 | |
---|
15 | def __init__(self, context, request): |
---|
16 | """ init view """ |
---|
17 | self.context = context |
---|
18 | self.request = request |
---|
19 | self.location = IPoint(self.context, None) |
---|
20 | self.longitude = self.location and self.location.coordinates[0] or None |
---|
21 | self.latitude = self.location and self.location.coordinates[1] or None |
---|
22 | |
---|
23 | def editLocation(self, latitude=None, longitude=None): |
---|
24 | """ update location properties """ |
---|
25 | self.location.coordinates = (longitude, latitude,0) |
---|
26 | self.context.reindexObject() |
---|
27 | |
---|
28 | def getLatitude(self): |
---|
29 | """ return point latitude """ |
---|
30 | return self.latitude |
---|
31 | |
---|
32 | def getLongitude(self): |
---|
33 | """ return point longitude """ |
---|
34 | return self.longitude |
---|
Note: See
TracBrowser
for help on using the repository browser.