Skip to content
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
17 changes: 14 additions & 3 deletions Web/Resgrid.Web/Areas/User/Views/Dispatch/AddArchivedCall.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@
<div class="row">
<div class="col-md-8 col-md-offset-1">
@Html.AntiForgeryToken()
@Html.HiddenFor(m => m.Latitude)
@Html.HiddenFor(m => m.Longitude)
@Html.HiddenFor(m => m.Call.ReportingUserId)
@Html.HiddenFor(m => m.Call.CallFormData)
<div asp-validation-summary="All" class="text-danger"></div>
Expand Down Expand Up @@ -181,7 +179,20 @@
<span class="help-inline">@localizer["W3wHelp"] <a href="https://what3words.com/about/" target="_blank">@localizer["LearnMore"]</a></span>
</div>
</div>
<div id="callMap" name="callMap" style="position: relative; width: 90%; height: 500px;"></div>
<div class="row" style="margin-top: 8px;">
<div class="col-md-11">
<div class="input-group input-group-sm">
<span class="input-group-addon">Lat</span>
<input type="text" class="form-control" asp-for="Latitude" placeholder="Latitude">
<span class="input-group-addon">Lng</span>
<input type="text" class="form-control" asp-for="Longitude" placeholder="Longitude">
<span class="input-group-btn">
<a id="setPinButton" href="#" class="btn btn-warning">Set Pin on Map</a>
</span>
</div>
</div>
</div>
<div id="callMap" name="callMap" style="position: relative; width: 90%; height: 500px; margin-top: 8px;"></div>
</div>
</div>
<div class="form-group">
Expand Down
17 changes: 14 additions & 3 deletions Web/Resgrid.Web/Areas/User/Views/Dispatch/NewCall.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@
<div class="row">
<div class="col-md-8 col-md-offset-1">
@Html.AntiForgeryToken()
@Html.HiddenFor(m => m.Latitude)
@Html.HiddenFor(m => m.Longitude)
@Html.HiddenFor(m => m.Call.ReportingUserId)
@Html.HiddenFor(m => m.Call.CallFormData)
<div asp-validation-summary="All" class="text-danger"></div>
Expand Down Expand Up @@ -174,7 +172,20 @@
<span class="help-inline">@localizer["W3wHelp"] <a href="https://what3words.com/about/" target="_blank">@localizer["LearnMore"]</a></span>
</div>
</div>
<div id="callMap" name="callMap" style="position: relative; width: 90%; height: 500px;"></div>
<div class="row" style="margin-top: 8px;">
<div class="col-md-11">
<div class="input-group input-group-sm">
<span class="input-group-addon">Lat</span>
<input type="text" class="form-control" asp-for="Latitude" placeholder="Latitude">
<span class="input-group-addon">Lng</span>
<input type="text" class="form-control" asp-for="Longitude" placeholder="Longitude">
<span class="input-group-btn">
<a id="setPinButton" href="#" class="btn btn-warning">Set Pin on Map</a>
</span>
</div>
</div>
</div>
<div id="callMap" name="callMap" style="position: relative; width: 90%; height: 500px; margin-top: 8px;"></div>
</div>
</div>
<div class="form-group">
Expand Down
17 changes: 14 additions & 3 deletions Web/Resgrid.Web/Areas/User/Views/Dispatch/UpdateCall.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@
<div class="row">
<div class="col-md-8 col-md-offset-1">
@Html.AntiForgeryToken()
@Html.HiddenFor(m => m.Latitude)
@Html.HiddenFor(m => m.Longitude)
@Html.HiddenFor(m => m.Call.CallId)
@Html.HiddenFor(m => m.Call.ReportingUserId)
@Html.HiddenFor(m => m.Call.CallFormData)
Expand Down Expand Up @@ -175,7 +173,20 @@
<span class="help-inline">@localizer["W3wHelp"] <a href="https://what3words.com/about/" target="_blank">@localizer["LearnMore"]</a></span>
</div>
</div>
<div id="callMap" name="callMap" style="position: relative; width: 90%; height: 500px;"></div>
<div class="row" style="margin-top: 8px;">
<div class="col-md-11">
<div class="input-group input-group-sm">
<span class="input-group-addon">Lat</span>
<input type="text" class="form-control" asp-for="Latitude" placeholder="Latitude">
<span class="input-group-addon">Lng</span>
<input type="text" class="form-control" asp-for="Longitude" placeholder="Longitude">
<span class="input-group-btn">
<a id="setPinButton" href="#" class="btn btn-warning">Set Pin on Map</a>
</span>
</div>
</div>
</div>
<div id="callMap" name="callMap" style="position: relative; width: 90%; height: 500px; margin-top: 8px;"></div>
</div>
</div>
<div class="form-group">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ var resgrid;
if (result && result.Data && result.Data.Latitude && result.Data.Longitude) {
var lat = result.Data.Latitude;
var lng = result.Data.Longitude;
map.panTo(new L.LatLng(lat, lng));
map.setView(new L.LatLng(lat, lng), 16);
$("#Latitude").val(lat.toString());
$("#Longitude").val(lng.toString());
resgrid.dispatch.addArchivedCall.setMarkerLocation(lat, lng);
Expand All @@ -126,6 +126,17 @@ var resgrid;
.catch(function(err) { console.error("Geocode error:", err); });
evt.preventDefault();
});
$("#setPinButton").click(function (evt) {
var lat = parseFloat($("#Latitude").val());
var lng = parseFloat($("#Longitude").val());
if (isNaN(lat) || isNaN(lng)) {
alert("Please enter valid numeric latitude and longitude values.");
return false;
}
map.setView(new L.LatLng(lat, lng), 16);
resgrid.dispatch.addArchivedCall.setMarkerLocation(lat, lng);
evt.preventDefault();
});
$("#findw3wButton").click(function (evt) {
var word = jQuery.trim($("#What3Word").val());
if (word.length < 1)
Expand All @@ -136,7 +147,7 @@ var resgrid;
type: 'GET'
}).done(function (data) {
if (data && data.Latitude && data.Longitude) {
map.panTo(new L.LatLng(data.Latitude, data.Longitude));
map.setView(new L.LatLng(data.Latitude, data.Longitude), 16);

$("#Latitude").val(data.Latitude);
$("#Longitude").val(data.Longitude);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ var resgrid;
if (result && result.Data && result.Data.Latitude != null && result.Data.Longitude != null) {
var lat = result.Data.Latitude;
var lng = result.Data.Longitude;
map.panTo(new L.LatLng(lat, lng));
map.setView(new L.LatLng(lat, lng), 16);
$("#Latitude").val(lat.toString());
$("#Longitude").val(lng.toString());
resgrid.dispatch.editcall.setMarkerLocation(lat.toString(), lng.toString());
Expand All @@ -146,7 +146,7 @@ var resgrid;
type: 'GET'
}).done(function (data) {
if (data && data.Latitude && data.Longitude) {
map.panTo(new L.LatLng(data.Latitude, data.Longitude));
map.setView(new L.LatLng(data.Latitude, data.Longitude), 16);

$("#Latitude").val(data.Latitude);
$("#Longitude").val(data.Longitude);
Expand All @@ -162,6 +162,18 @@ var resgrid;
evt.preventDefault();
});

$("#setPinButton").click(function (evt) {
var lat = parseFloat($("#Latitude").val());
var lng = parseFloat($("#Longitude").val());
if (isNaN(lat) || isNaN(lng)) {
alert("Please enter valid numeric latitude and longitude values.");
return false;
}
map.setView(new L.LatLng(lat, lng), 16);
resgrid.dispatch.editcall.setMarkerLocation(lat.toString(), lng.toString());
evt.preventDefault();
});

$('#protocolQuestionWindow').on('show.bs.modal', function (event) {
var protocolId = $(event.relatedTarget).data('protocolid');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ var resgrid;
if (result && result.Data && result.Data.Latitude != null && result.Data.Longitude != null) {
var lat = result.Data.Latitude;
var lng = result.Data.Longitude;
map.panTo(new L.LatLng(lat, lng));
map.setView(new L.LatLng(lat, lng), 16);
$("#Latitude").val(lat.toString());
$("#Longitude").val(lng.toString());
resgrid.dispatch.newcall.setMarkerLocation(lat, lng);
Expand All @@ -141,7 +141,7 @@ var resgrid;
type: 'GET'
}).done(function (data) {
if (data && data.Latitude != null && data.Longitude != null) {
map.panTo(new L.LatLng(data.Latitude, data.Longitude));
map.setView(new L.LatLng(data.Latitude, data.Longitude), 16);

$("#Latitude").val(data.Latitude);
$("#Longitude").val(data.Longitude);
Expand All @@ -156,6 +156,17 @@ var resgrid;
});
evt.preventDefault();
});
$("#setPinButton").click(function (evt) {
var lat = parseFloat($("#Latitude").val());
var lng = parseFloat($("#Longitude").val());
if (isNaN(lat) || isNaN(lng)) {
alert("Please enter valid numeric latitude and longitude values.");
return false;
}
map.setView(new L.LatLng(lat, lng), 16);
resgrid.dispatch.newcall.setMarkerLocation(lat, lng);
evt.preventDefault();
});
var personnelTable = $("#personnelGrid").DataTable({
ajax: { url: resgrid.absoluteBaseUrl + '/User/Personnel/GetPersonnelForCallGrid?callLat=' + $("#Latitude").val() + '&callLong=' + $("#Longitude").val(), dataSrc: '' },
paging: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ $(document).ready(function () {
editStops.forEach(function (stop, index) {
if (stop.lat != null && stop.lng != null && Number.isFinite(Number(stop.lat)) && Number.isFinite(Number(stop.lng))) {
var m = L.marker([stop.lat, stop.lng]).addTo(map);
m.bindTooltip((index + 1) + '. ' + escapeHtml(stop.Name), { permanent: true, direction: 'right' });
m.bindPopup('<strong>' + (index + 1) + '. ' + escapeHtml(stop.Name) + '</strong>');
group.push(m);
}
Expand Down Expand Up @@ -288,8 +289,9 @@ $(document).ready(function () {
editStops = editStops.filter(function (s) { return s.id !== stopId; });
editStops.forEach(function (stop, index) {
if (stop.lat != null && stop.lng != null && Number.isFinite(Number(stop.lat)) && Number.isFinite(Number(stop.lng))) {
L.marker([stop.lat, stop.lng]).addTo(map)
.bindPopup('<strong>' + (index + 1) + '. ' + escapeHtml(stop.Name) + '</strong>');
var m = L.marker([stop.lat, stop.lng]).addTo(map);
m.bindTooltip((index + 1) + '. ' + escapeHtml(stop.Name), { permanent: true, direction: 'right' });
m.bindPopup('<strong>' + (index + 1) + '. ' + escapeHtml(stop.Name) + '</strong>');
}
});
}
Expand Down
Loading