Skip to content

Commit

Permalink
added responsive map as example, ref #53
Browse files Browse the repository at this point in the history
  • Loading branch information
bashu committed Oct 10, 2016
1 parent b4d2dfa commit 23ab9f0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions easy_maps/templatetags/easy_maps_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ class EasyMapTag(InclusionTag):
template = 'easy_maps/map.html'
options = Options(
Argument('address', resolve=True, required=True),
IntegerArgument('width', required=False, default=None),
IntegerArgument('height', required=False, default=None),
Argument('width', required=False, default=None),
Argument('height', required=False, default=None),
IntegerArgument('zoom', required=False, default=None),
'using',
Argument('template_name', default=None, required=False),
Expand Down
12 changes: 12 additions & 0 deletions example/templates/easy_maps/responsive.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{% extends "easy_maps/map.html" %}

{% block html %}
<div id="map-canvas-{{ map.pk }}"
{% if map.computed_address %}
style="width: 100% !important; height: {{ height|default:"240" }}px;"
{% endif %}
class="easy-map-googlemap">
{% block noscript %}{{ block.super }}{% endblock %}
{% if not map.computed_address %}<!-- geocoding error -->{% endif %}
</div>
{% endblock %}

0 comments on commit 23ab9f0

Please sign in to comment.