map.html 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. {% from 'simple/macros.html' import result_header, result_sub_header, result_sub_footer, result_footer, result_footer_rtl, icon %}
  2. {{ result_header(result, favicons, image_proxify) -}}
  3. {{- result_sub_header(result) -}}
  4. {%- if (result.latitude and result.longitude) or result.boundingbox -%}
  5. <small> &bull; <a class="btn-collapse collapsed searx_init_map hide_if_nojs" data-target="#result-map-{{ index }}" data-btn-text-collapsed="{{ _('show map') }}" data-btn-text-not-collapsed="{{ _('hide map') }}" data-leaflet-target="osm-map-{{ index }}" data-map-lon="{{ result.longitude }}" data-map-lat="{{ result.latitude }}" {% if result.boundingbox %}data-map-boundingbox='{{ result.boundingbox|tojson|safe }}'{% endif %} {% if result.geojson %}data-map-geojson='{{ result.geojson|tojson|safe }}'{% endif %}>{{ icon( 'globe') }} {{ _('show map') }}</a></small>
  6. {%- endif -%}
  7. {#-
  8. {% if (result.latitude and result.longitude) %}
  9. <small> &bull; <a class="btn-collapse disabled_if_nojs" data-target="#result-geodata-{{ index }}" data-btn-text-collapsed="{{ _('show geodata') }}" data-btn-text-not-collapsed="{{ _('hide geodata') }}">{{ icon('location') }} {{ _('show geodata') }}</a></small>
  10. {% endif %}
  11. -#}
  12. {%- if result.address -%}
  13. <p itemscope itemtype="http://schema.org/PostalAddress" class="content">
  14. {%- if result.address.name -%}
  15. <strong itemprop="name">{{ result.address.name }}</strong><br/>
  16. {%- endif -%}
  17. {% if result.address.road -%}
  18. <span itemprop="streetAddress">
  19. {%- if result.address.house_number -%}{{- result.address.house_number -}}, {% endif %}
  20. {{- result.address.road -}}
  21. </span><br/>
  22. {%- endif %}
  23. {%- if result.address.locality -%}
  24. <span itemprop="addressLocality">{{- result.address.locality -}}</span>
  25. {%- if result.address.postcode -%}, <span itemprop="postalCode">{{- result.address.postcode -}}</span>{% endif %}
  26. <br/>
  27. {%- endif -%}
  28. {%- if result.address.country -%}
  29. <span itemprop="addressCountry">{{- result.address.country -}}</span>
  30. {%- endif -%}
  31. </p>
  32. {%- endif -%}
  33. {%- if result.content %}<p class="content">{{ result.content|safe }}</p>{% endif -%}
  34. {{- result_sub_footer(result, proxify) -}}
  35. {#-
  36. {% if (result.latitude and result.longitude) -%}
  37. <div id="result-geodata-{{ index }}" class="invisible">
  38. <strong>Longitude:</strong> {{ result.longitude }} <br/>
  39. <strong>Latitude:</strong> {{ result.latitude }}
  40. </div>
  41. {%- endif %}
  42. -#}
  43. {% if (result.latitude and result.longitude) or result.boundingbox -%}
  44. <div id="result-map-{{ index }}" class="invisible"><div id="osm-map-{{ index }}" style="height:300px; width:100%; margin: 10px 0;" ></div></div>
  45. {%- endif %}
  46. {{- result_footer(result) }}