Skip to content

Commit

Permalink
Serve GeoJS script locally
Browse files Browse the repository at this point in the history
  • Loading branch information
Chatewgne committed Aug 31, 2023
1 parent d4ca0be commit 341f178
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ CHANGELOG
- Add model LinePictogram for each line (#3327)
- Create Organizer model for touristic events, configurable in admin site (#3625)
- Remove elliptic annotations from HD Views (they cannot be displayed on Leaflet)
- Serve GeoJS script locally

**Documentation**

Expand Down
74 changes: 74 additions & 0 deletions geotrek/common/static/common/js/geojs-1.10.17-min.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
{{object.annotations|json_script:"geojson_annotations"}}
<div id="hdviewpoint-map" class='large'><span class="loader-wrapper"><span class="loader"></span></span></div>
<script type="text/javascript" src="{% static 'common/js/hdviewpoint_viewer.js' %}"></script>
<script type="text/javascript" src="https://opengeoscience.github.io/geojs/built/geo.min.js"></script>
<script type="text/javascript" src="{% static 'common/js/geojs-1.10.17-min.js' %}"></script>
<script>
initializeViewer("{{base_tile_url}}", edit_annotations=true);
</script>
Expand Down
2 changes: 1 addition & 1 deletion geotrek/common/templates/common/hdviewpoint_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ <h3>{% trans "Attributes" %}</h3>
{% url 'common:hdviewpoint-drf-detail' object.pk as base_tile_url %}
{{object.annotations|json_script:"geojson_annotations"}}
<div id="hdviewpoint-map"><span class="loader-wrapper"><span class="loader"></span></span></div>
<script type="text/javascript" src="https://opengeoscience.github.io/geojs/built/geo.min.js"></script>
<script type="text/javascript" src="{% static 'common/js/geojs-1.10.17-min.js' %}"></script>
<script>
$(window).on('detailmap:ready', function (e, data) {
initializeViewer("{{base_tile_url}}");
Expand Down

0 comments on commit 341f178

Please sign in to comment.