kopia lustrzana https://github.com/hholzgra/maposmatic/
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
rodzic
70fa380a9b
commit
2403874fe0
|
@ -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)
|
||||
|
|
Ładowanie…
Reference in New Issue