Skip to content

Commit fd2e895

Browse files
committed
fix maps portlet
1 parent 1d09003 commit fd2e895

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/collective/collectionfilter/baseviews.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,19 @@ def ajax_url(self):
283283
)
284284
return ajax_url
285285

286+
@property
287+
def geojson_ajax_url(self):
288+
# Recursively transform all to unicode
289+
request_params = safe_decode(self.top_request.form)
290+
urlquery = base_query(
291+
request_params, extra_ignores=['latitude', 'longitude'])
292+
query_param = urlencode(safe_encode(urlquery), doseq=True)
293+
geojson_ajax_url = u'{}/@@geodata.json{}'.format(
294+
self.collection.getURL(),
295+
'?' + query_param if query_param else '',
296+
)
297+
return geojson_ajax_url
298+
286299
@property
287300
def locations(self):
288301
custom_query = {} # Additional query to filter the collection

src/collective/collectionfilter/portlets/maps.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class Assignment(base.Assignment):
2525
narrow_down = False
2626
default_map_layer = default_map_layer
2727
map_layers = default_map_layers
28+
geojson_properties_limit = 500
2829

2930
def __init__(
3031
self,
@@ -35,6 +36,7 @@ def __init__(
3536
narrow_down=False,
3637
default_map_layer=default_map_layer,
3738
map_layers=default_map_layers,
39+
geojson_properties_limit=500,
3840
):
3941
self.header = header
4042
self.target_collection = target_collection
@@ -43,6 +45,7 @@ def __init__(
4345
self.narrow_down = narrow_down
4446
self.default_map_layers = default_map_layers
4547
self.map_layers = map_layers
48+
self.geojson_properties_limit = geojson_properties_limit
4649

4750
@property
4851
def title(self):

0 commit comments

Comments
 (0)