Skip to content

Commit

Permalink
Fixes #267
Browse files Browse the repository at this point in the history
  • Loading branch information
capooti committed Mar 8, 2018
1 parent eabf8f3 commit ae537d3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions geonode/contrib/worldmap/wm_extra/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from geonode.maps.views import snapshot_create

from .views import (proxy, ajax_snapshot_history, ajax_layer_update, ajax_layer_edit_check, upload_layer,
create_pg_layer, ajax_increment_layer_stats, new_map_wm, new_map_json_wm,
create_pg_layer, ajax_increment_layer_stats, add_layer_wm, new_map_wm, new_map_json_wm,
map_view_wm, map_json_wm, map_detail_wm, add_endpoint, printmap)
from tastypie.api import Api
from .api.resources import (LayerResource, TagResource, TopicCategoryResource,
Expand All @@ -29,10 +29,10 @@
# maps
url(r'^maps/print/?$', printmap, name='printmap'),
url(r'^maps/new$', new_map_wm, name="new_map_wm"),
url(r'^maps/add_layer$', add_layer_wm, name='add_layer_wm'),
url(r'^maps/new/data$', new_map_json_wm, name='new_map_json_wm'),
url(r'^maps/(?P<mapid>[^/]+)/data$', map_json_wm, name='map_json'),
url(r'^maps/(?P<mapid>[^/]+)$', map_detail_wm, name='map_detail_wm'),
#url(r'^maps/add_layer$', add_layer_wm, name='add_layer_wm'),
url(r'^maps/(?P<mapid>[^/]+)/view$', map_view_wm, name='map_view_wm'),
url(r'^maps/add_endpoint?$', add_endpoint, name='add_endpoint'),
url(r'^snapshot/create/?$', snapshot_create, name='snapshot_create'),
Expand Down
30 changes: 15 additions & 15 deletions geonode/contrib/worldmap/wm_extra/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,21 +173,21 @@ def ajax_increment_layer_stats(request):
)


# def add_layer_wm(request):
# """
# The view that returns the map composer opened to
# a given map and adds a layer on top of it.
# """
# map_id = request.GET.get('map_id')
# layer_name = request.GET.get('layer_name')
#
# map_obj = _resolve_map(
# request,
# map_id,
# 'base.view_resourcebase',
# _PERMISSION_MSG_VIEW)
#
# return map_view_wm(request, str(map_obj.id), layer_name=layer_name)
def add_layer_wm(request):
"""
The view that returns the map composer opened to
a given map and adds a layer on top of it.
"""
map_id = request.GET.get('map_id')
layer_name = request.GET.get('layer_name')

map_obj = _resolve_map(
request,
map_id,
'base.view_resourcebase',
_PERMISSION_MSG_VIEW)

return map_view_wm(request, str(map_obj.id), layer_name=layer_name)


def map_view_wm(request, mapid, snapshot=None, layer_name=None, template='wm_extra/maps/map_view.html'):
Expand Down

0 comments on commit ae537d3

Please sign in to comment.