Commits

Mikhail Korobov  committed a48ac93

Revert 'Show map also on error or without coordinates'; add html comment for geocoding errors. Fix BB-18.

  • Participants
  • Parent commits 5af56a2

Comments (0)

Files changed (1)

File easy_maps/templates/easy_maps/map.html

 {% block html %}
     <!-- HTML map container -->
     <div id="map-canvas-{{ map.pk }}"
-         style="width: {{ width }}px; height: {{ height }}px;"
-         class="easy-map-googlemap">
-         {% block noscript %}
-         <noscript>
-            <img alt="Map of {{ map.address }}" src="https://maps.google.com/maps/api/staticmap?center={{ lat }},{{ long }}&zoom={{ zoom }}&markers={{ lat }},{{ long }}&size={{ width }}x{{ height }}&sensor=false">
-         </noscript>
-         {% endblock noscript %}
+        {% if width and map.latitude and not map.geocode_error %}
+        style="width: {{ width }}px; height: {{ height }}px;"
+        {% endif %}
+        class="easy-map-googlemap">
+        {% block noscript %}
+        <noscript>
+        <img alt="Map of {{ map.address }}" src="https://maps.google.com/maps/api/staticmap?center={{ lat }},{{ long }}&zoom={{ zoom }}&markers={{ lat }},{{ long }}&size={{ width }}x{{ height }}&sensor=false">
+        </noscript>
+        {% endblock noscript %}
+        {% if map.geocode_error %}<!-- geocoding error -->{% endif %}
     </div>
 {% endblock %}