def get_context_data(self, **kwargs): context = super(MapDetailView, self).get_context_data(**kwargs) context['date'] = self.get_object_date() context['map'] = InfoMap([(self.object.geom, self.object.page.name)], options={'permalink': True}) return context
def get_context_data(self, **kwargs): context = super(MapGlobalView, self).get_context_data(**kwargs) map_objects = [(obj.geom, popup_html(obj)) for obj in self.object_list] context['map'] = InfoMap(map_objects, options={ 'dynamic': True, 'zoomToDataExtent': False}) context['dynamic_map'] = True return context
def get_context_data(self, **kwargs): context = super(DetailView, self).get_context_data(**kwargs) context['show_revision'] = True context['map'] = InfoMap([(self.object.geom, self.object.page.name)]) context['date'] = self.object.version_info.date return context
def get_map(self): map_objects = self.get_map_objects() return InfoMap(map_objects, options={ 'dynamic': self.dynamic, 'zoomToDataExtent': self.zoom_to_data, 'permalink': self.permalink, 'cluster': True})
def get_context_data(self, **kwargs): # Send this in directly because we've wrapped InfoMap. context = super(MapCompareView, self).get_context_data(**kwargs) # We subclassed olwidget.widget.InfoMap. We want to combine both # their media here to ensure we display more than one layer # correctly. context['map_diff_media'] = InfoMap([]).media + OLInfoMap([]).media return context