diff options
Diffstat (limited to 'ishtar_common/templates/ishtar/blocks/sheet_map.html')
-rw-r--r-- | ishtar_common/templates/ishtar/blocks/sheet_map.html | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/ishtar_common/templates/ishtar/blocks/sheet_map.html b/ishtar_common/templates/ishtar/blocks/sheet_map.html index 296516e86..e0278b8c7 100644 --- a/ishtar_common/templates/ishtar/blocks/sheet_map.html +++ b/ishtar_common/templates/ishtar/blocks/sheet_map.html @@ -1,11 +1,18 @@ +{% if PROFILE.mapping and geo_item.main_geodata %} +<div class="col-12 col-lg-6 flex-wrap"> + <div class="window-map" id="map-{{window_id}}-{{geo_item.SLUG}}-{{geo_item.pk}}"> + </div> + <div id="map-content-{{window_id}}-{{geo_item.SLUG}}-{{geo_item.pk}}"></div> +</div> +<script type="text/javascript"> + const disp_map = function() { const html = render_map("map-{{window_id}}-{{geo_item.SLUG}}-{{geo_item.pk}}", false, true); $("#map-content-{{window_id}}-{{geo_item.SLUG}}-{{geo_item.pk}}").html(html); - {% if geo_item.most_precise_geo == 'point' %} - const {{geo_item.SLUG}}{{geo_item.pk}} = {{geo_item.point_2d_geojson|safe}}; + const {{geo_item.SLUG}}{{geo_item.pk}} = {{geo_item.main_geodata.geojson|safe}}; + {% if geo_item.main_geodata.geometry_type == 'POINT' %} display_map("map-{{window_id}}-{{geo_item.SLUG}}-{{geo_item.pk}}", {{geo_item.SLUG}}{{geo_item.pk}}); {% else %} - const {{geo_item.SLUG}}{{geo_item.pk}} = {{geo_item.multi_polygon_geojson|safe}}; display_map("map-{{window_id}}-{{geo_item.SLUG}}-{{geo_item.pk}}", null, {{geo_item.SLUG}}{{geo_item.pk}}); {% endif %} } @@ -60,3 +67,6 @@ get_polygons.change( function () { }) {% endif %} {% endif %} + +</script> +{% endif %} |