Skip to content

Commit e0f6d7f

Browse files
committed
Made inverse polygon consistent
Signed-off-by: Ko Nagase <[email protected]>
1 parent d4f40dd commit e0f6d7f

File tree

6 files changed

+9
-6
lines changed

6 files changed

+9
-6
lines changed

app/helpers/gtt_map_helper.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
module GttMapHelper
44

5-
def map_form_field(form, map, field: :geojson, edit_mode:)
5+
def map_form_field(form, map, field: :geojson, bounds: nil, edit_mode: nil)
66
safe_join [
77
form.hidden_field(field, id: 'geom'),
8-
map_tag(map: map, bounds: map.bounds, edit: edit_mode)
8+
map_tag(map: map, bounds: bounds, edit: edit_mode)
99
]
1010
end
1111

app/views/projects/settings/_gtt.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</div>
1616

1717
<div class="box">
18-
<%= map_form_field f, @form.map, edit_mode: 'Polygon' %>
18+
<%= map_form_field f, @form.map, bounds: nil, edit_mode: 'Polygon' %>
1919
</div>
2020

2121

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
</fieldset>
22
<fieldset class="box tabular">
33
<legend><%= l(:label_user_map) %></legend>
4-
<%= map_form_field form, user.map, edit_mode: 'Point' %>
4+
<%= map_form_field form, user.map, bounds: nil, edit_mode: 'Point' %>
55

app/views/redmine_gtt/hooks/_view_issues_form_details_top.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
((issue.new_record? && User.current.allowed_to?(:add_issues, issue.project)) ||
33
User.current.allowed_to?(:edit_issues, issue.project))
44
%>
5-
<%= map_form_field form, issue.map, edit_mode: 'Point LineString Polygon' %>
5+
<%= map_form_field form, issue.map, bounds: issue.project.map.bounds, edit_mode: 'Point LineString Polygon' %>
66
<% end %>
77

lib/redmine_gtt/patches/issue_patch.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def self.apply
2323
def map
2424
json = as_geojson
2525
GttMap.new json: json, layers: project.gtt_tile_sources.sorted,
26-
bounds: (new_record? ? project.map.json : json)
26+
bounds: project.map.json
2727
end
2828

2929
# Check if geometry change aren't small and ignore it

src/components/gtt-client.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,9 @@ export class GttClient {
202202
}
203203
)
204204
this.bounds.getSource().addFeature(boundary)
205+
if (this.contents.bounds === this.contents.geom) {
206+
this.vector.setVisible(false)
207+
}
205208
this.layerArray.forEach((layer:Layer) => {
206209
if (layer.get('baseLayer')) {
207210
layer.addFilter(new Mask({

0 commit comments

Comments
 (0)