diff --git a/umap/templates/umap/map_fragment.html b/umap/templates/umap/map_fragment.html
index 83bed716..ddeb4525 100644
--- a/umap/templates/umap/map_fragment.html
+++ b/umap/templates/umap/map_fragment.html
@@ -1,5 +1,5 @@
{% load umap_tags %}
-
+
diff --git a/umap/templates/umap/map_list.html b/umap/templates/umap/map_list.html
index 926bcdd3..672aa6a8 100644
--- a/umap/templates/umap/map_list.html
+++ b/umap/templates/umap/map_list.html
@@ -3,7 +3,7 @@
{% for map_inst in maps %}
- {% map_fragment map_inst prefix=prefix %}
+ {% map_fragment map_inst prefix=prefix page=request.GET.p %}
{% endfor %}
diff --git a/umap/templates/umap/search.html b/umap/templates/umap/search.html
index 51c37a17..074c54c6 100644
--- a/umap/templates/umap/search.html
+++ b/umap/templates/umap/search.html
@@ -8,7 +8,7 @@
{% if maps %}
- {% include "umap/map_list.html" with prefix='search_map_' %}
+ {% include "umap/map_list.html" with prefix='search_map' %}
{% else %}
{% trans "Not map found." %}
{% endif %}
diff --git a/umap/templatetags/umap_tags.py b/umap/templatetags/umap_tags.py
index 86a2bbeb..c40691d1 100644
--- a/umap/templatetags/umap_tags.py
+++ b/umap/templatetags/umap_tags.py
@@ -50,11 +50,13 @@ def map_fragment(map_instance, **kwargs):
'slideshow': {}
})
map_settings['properties'].update(kwargs)
- prefix = kwargs.pop('prefix', None) or 'map_'
+ prefix = kwargs.pop('prefix', None) or 'map'
+ page = kwargs.pop('page', None) or ''
+ unique_id = prefix + str(page) + "_" + str(map_instance.pk)
return {
"map_settings": json.dumps(map_settings),
"map": map_instance,
- "prefix": prefix
+ "unique_id": unique_id
}