Add geographic references of maps to RSS feed (GeoRSS).

Currently, this works only for bounding boxes, not for administrative
boundaries.

Signed-off-by: Gaël Utard <gael.utard@laposte.net>
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
stable
Gaël Utard 2010-08-06 19:07:20 +02:00 zatwierdzone przez Maxime Petazzoni
rodzic 70fa380a9b
commit 2403874fe0
1 zmienionych plików z 7 dodań i 1 usunięć

Wyświetl plik

@ -26,7 +26,7 @@
import datetime
from django.contrib.syndication.feeds import Feed
from django.contrib.gis.feeds import Feed
from django.utils.translation import ugettext_lazy as _
from www.maposmatic import models
@ -69,3 +69,9 @@ class MapsFeed(Feed):
def item_title(self, item):
return item.maptitle
def item_geometry(self, item):
if item.administrative_city:
return None
else:
return (item.lon_upper_left, item.lat_upper_left,
item.lon_bottom_right, item.lat_bottom_right)