Skip to content

Commit

Permalink
allow cross-origin resource sharing (CROS) when embedding map (#343)
Browse files Browse the repository at this point in the history
fix #152 and fix #153
  • Loading branch information
boney-bun committed Sep 24, 2017
1 parent 19ca7f5 commit 9c64bb7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions geonode/maps/qgis_server_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

from django.conf import settings
from django.views.generic import CreateView, DetailView
from django.views.decorators.clickjacking import xframe_options_exempt
from django.utils.decorators import method_decorator
from django.core.urlresolvers import reverse
from django.http import HttpResponse

Expand Down Expand Up @@ -146,6 +148,10 @@ def get_context_data(self, **kwargs):
def get_object(self):
return Map.objects.get(id=self.kwargs.get("mapid"))

@method_decorator(xframe_options_exempt)
def dispatch(self, *args, **kwargs):
return super(MapEmbedView, self).dispatch(*args, **kwargs)


def map_download_qlr(request, mapid):
"""Download QLR file to open the maps' layer in QGIS desktop.
Expand Down

0 comments on commit 9c64bb7

Please sign in to comment.