Skip to content

#2459 - Can't Access Map Controls #2465

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dt-assets/build/css/style.min.css

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion dt-assets/scss/_mapbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,11 @@
}
#add_records_div {
position: absolute;
top: 15%;
top: 90px;
left: 10px;
z-index: 2;
max-height: 100%;
overflow-x: auto;
}
.add-records-div {
background-color: #ffffff;
Expand All @@ -67,6 +69,7 @@
width: 300px;
display:none;
}

.close-add-records-div {
cursor:pointer;
}
Expand Down
30 changes: 16 additions & 14 deletions dt-metrics/records/dynamic-records-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ jQuery(document).ready(function ($) {
<tr>
<td>
<select id="add_records_div_content_post_type_fields"></select>
<div id="add_records_div_content_post_type_field_values" style="overflow: auto; max-height: 200px;"></div>
<div id="add_records_div_content_post_type_field_values"></div>
</td>
</tr>
</tbody>
Expand Down Expand Up @@ -250,10 +250,8 @@ jQuery(document).ready(function ($) {
// Determine post type to be adopted.
if (adopt_layer_settings) {
$(this).val(layer_settings.post_type);
$(this).prop('disabled', true);
} else {
$(this).prop('disabled', false);
}
$(this).prop('disabled', false);

let selected_post_type = $(this).val();
$(add_records_div_content_post_type_field_values).fadeOut(
Expand All @@ -277,16 +275,11 @@ jQuery(document).ready(function ($) {
$(add_records_div_content_post_type_fields).val(
layer_settings.field_key,
);
$(add_records_div_content_post_type_fields).prop(
'disabled',
true,
);
} else {
$(add_records_div_content_post_type_fields).prop(
'disabled',
false,
);
}
$(add_records_div_content_post_type_fields).prop(
'disabled',
false,
);

$(add_records_div_content_post_type_fields).trigger(
'change',
Expand Down Expand Up @@ -330,7 +323,7 @@ jQuery(document).ready(function ($) {
)
.each(function () {
let checkbox = $(this);
$(checkbox).prop('disabled', true);
$(checkbox).prop('disabled', false);
$(checkbox).prop(
'checked',
window.lodash.includes(
Expand Down Expand Up @@ -493,6 +486,10 @@ jQuery(document).ready(function ($) {
});

// Persist updates.
map_query_layer_payload.post_type = payload.post_type;
map_query_layer_payload.field_key = payload.field_key;
map_query_layer_payload.field_type = payload.field_type;
map_query_layer_payload.field_values = payload.field_values;
map_query_layer_payload.color = layer_color;
map_query_layer_payload.layer_color = layer_color;
map_query_layer_payload.layer_name = layer_name;
Expand All @@ -517,6 +514,11 @@ jQuery(document).ready(function ($) {

// Close layer records edit modal.
$('#add_records_div').fadeOut('fast');

// Reload map and reflect latest changes.
mapbox_library_api.reload_record_layers(true, function () {
mapbox_library_api.adjust_layer_point_sizes();
});
}
break;
}
Expand Down
Loading