fixes GMaps usage & Command creation
parent
cec790b71e
commit
5a3fdada8f
@ -1,48 +1,48 @@
|
|||||||
@model SetAddressViewModel
|
@model Location
|
||||||
|
@section header {
|
||||||
<style>
|
<style>
|
||||||
#map {
|
#amap {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 250px;
|
height: 250px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
}
|
||||||
|
|
||||||
<form asp-action="SetAddress">
|
<form asp-action="SetAddress">
|
||||||
<div asp-validation-summary="ValidationSummary.All" class="text-danger" id="ValidationSummary"></div>
|
<div asp-validation-summary="ValidationSummary.All" class="text-danger" id="ValidationSummary"></div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|
||||||
<label asp-for="Street1" class="col-md-2 control-label">@SR["Address"]</label>
|
<label asp-for="Address" class="col-md-2 control-label">@SR["Address"]</label>
|
||||||
<div class="col-md-10">
|
<div class="col-md-10">
|
||||||
<input asp-for="Street1" class="form-control" type="text" />
|
<input asp-for="Address" class="form-control" type="text" data-val-required="Spécifier un lieu" />
|
||||||
|
|
||||||
<span id="AddressError" asp-validation-for="Street1" class="text-danger"></span>
|
<span id="AddressError" asp-validation-for="Address" class="text-danger"></span>
|
||||||
<ul id="LocationCombo" >
|
<ul id="LocationCombo" >
|
||||||
</ul>
|
</ul>
|
||||||
<div id="map"></div>
|
<div id="amap"></div>
|
||||||
|
<input class="text-box" id="Latitude" name="Latitude" type="hidden" value="@Model.Latitude" readonly/>
|
||||||
|
<input class="text-box" id="Longitude" name="Longitude" type="hidden" value="@Model.Longitude" readonly/>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<input type="submit" class="btn btn-success" value="Enregistrer" />
|
<input type="submit" class="btn btn-success" value="Enregistrer" />
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
@section scripts {
|
||||||
@{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
|
@{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
|
||||||
|
@{ await Html.RenderPartialAsync("_MapScriptsPartial"); }
|
||||||
@section scripts {
|
<script>
|
||||||
|
$(document).ready(function(){
|
||||||
<script src="https://maps.googleapis.com/maps/api/js?key=@ViewBag.GoogleSettings.BrowserApiKey"></script>
|
$("#Address").googlegeocode({
|
||||||
<script src="~/js/google-geoloc.js" asp-append-version="true"></script>
|
culture: '@System.Globalization.CultureInfo.CurrentCulture.Name',
|
||||||
<script >
|
mapsApiKey: '@Startup.GoogleSettings.BrowserApiKey',
|
||||||
$(document).ready(function(){
|
mapId: 'amap',
|
||||||
$.validator.setDefaults({
|
longId: 'Longitude',
|
||||||
messages: {
|
latId: 'Latitude',
|
||||||
remote: "Ce lieu n'est pas identifié par les services de géo-localisation Google",
|
addrValidationId: 'AddressError',
|
||||||
required: "Veuillez renseigner ce champ"
|
formValidId: 'ValidationSummary',
|
||||||
}
|
locComboId: 'LocationCombo'})
|
||||||
});
|
})
|
||||||
$("#Address").googlegeocode()
|
</script>
|
||||||
})
|
|
||||||
</script>
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue