add new templatetag to display a map centered on a place
This commit is contained in:
parent
bc49366139
commit
5a2ea72886
|
@ -34,7 +34,7 @@ from django.utils.timezone import is_naive, make_aware
|
|||
from django.utils.safestring import mark_safe
|
||||
|
||||
from combo.apps.dashboard.models import DashboardCell
|
||||
from combo.apps.maps.models import MapLayer
|
||||
from combo.apps.maps.models import Map, MapLayer
|
||||
from combo.data.models import Page, ConfigJsonCell
|
||||
from combo.public.views import render_cell
|
||||
from combo.utils import requests
|
||||
|
@ -646,3 +646,14 @@ def get_gnm_collectivities():
|
|||
collectivities.append({'url': service.get('url'), 'label': matching_hobo['title']})
|
||||
collectivities.sort(key=lambda x: x['label'])
|
||||
return collectivities
|
||||
|
||||
@register.inclusion_tag('combo/gnm/place_map.html')
|
||||
def gnm_place_map(lat, lng):
|
||||
map_cell = Map()
|
||||
map_cell.initial_zoom = '17'
|
||||
map_cell.min_zoom = '17'
|
||||
map_cell.max_zoom = '17'
|
||||
context = map_cell.get_cell_extra_context({})
|
||||
context['init_lat'] = lat
|
||||
context['init_lng'] = lng
|
||||
return context
|
||||
|
|
Loading…
Reference in New Issue