ios map fix
This commit is contained in:
@ -94,10 +94,7 @@
|
|||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Models\Logs.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Models\Logs.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Views\ViewLocationPage.xaml.cs">
|
<Compile Include="$(MSBuildThisFileDirectory)Views\ViewLocationPage.cs" />
|
||||||
<DependentUpon>ViewLocationPage.xaml</DependentUpon>
|
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Include="$(MSBuildThisFileDirectory)MainShell.xaml">
|
<EmbeddedResource Include="$(MSBuildThisFileDirectory)MainShell.xaml">
|
||||||
@ -131,6 +128,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Views\IconSelectPage.xaml">
|
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Views\IconSelectPage.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
@ -139,26 +137,25 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Views\CategoryPage.xaml">
|
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Views\CategoryPage.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Views\AddCategoryPage.xaml">
|
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Views\AddCategoryPage.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Views\CategorySelectPage.xaml">
|
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Views\CategorySelectPage.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Views\RankPage.xaml">
|
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Views\RankPage.xaml">
|
||||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
<SubType>Designer</SubType>
|
||||||
</EmbeddedResource>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Views\ViewLocationPage.xaml">
|
|
||||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@ -133,9 +133,11 @@ namespace Billing.Views
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnLoaded()
|
protected override void OnLoaded()
|
||||||
|
{
|
||||||
|
if (bill == null)
|
||||||
{
|
{
|
||||||
editorAmount.SetFocus();
|
editorAmount.SetFocus();
|
||||||
|
}
|
||||||
if (bill == null && App.SaveLocation)
|
if (bill == null && App.SaveLocation)
|
||||||
{
|
{
|
||||||
_ = GetCurrentLocation();
|
_ = GetCurrentLocation();
|
||||||
|
35
Billing.Shared/Views/ViewLocationPage.cs
Normal file
35
Billing.Shared/Views/ViewLocationPage.cs
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
using Billing.Models;
|
||||||
|
using Billing.UI;
|
||||||
|
using Xamarin.Forms.Maps;
|
||||||
|
using Xamarin.Forms.PlatformConfiguration.iOSSpecific;
|
||||||
|
|
||||||
|
namespace Billing.Views
|
||||||
|
{
|
||||||
|
public class ViewLocationPage : BillingPage
|
||||||
|
{
|
||||||
|
public ViewLocationPage(Bill bill)
|
||||||
|
{
|
||||||
|
On<Xamarin.Forms.PlatformConfiguration.iOS>().SetUseSafeArea(false);
|
||||||
|
Title = bill.Name;
|
||||||
|
|
||||||
|
if (bill.Latitude != null && bill.Longitude != null)
|
||||||
|
{
|
||||||
|
var position = new Position(bill.Latitude.Value, bill.Longitude.Value);
|
||||||
|
var mapSpan = new MapSpan(position, 0.01, 0.01);
|
||||||
|
Content = new Map(mapSpan)
|
||||||
|
{
|
||||||
|
Pins =
|
||||||
|
{
|
||||||
|
new Pin
|
||||||
|
{
|
||||||
|
Label = bill.Name,
|
||||||
|
Type = PinType.Generic,
|
||||||
|
Position = position,
|
||||||
|
Address = bill.Store
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,15 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
|
||||||
<ui:BillingPage xmlns="http://xamarin.com/schemas/2014/forms"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
|
||||||
xmlns:ui="clr-namespace:Billing.UI"
|
|
||||||
xmlns:v="clr-namespace:Billing.Views"
|
|
||||||
xmlns:maps="clr-namespace:Xamarin.Forms.Maps;assembly=Xamarin.Forms.Maps"
|
|
||||||
x:Class="Billing.Views.ViewLocationPage"
|
|
||||||
x:Name="viewLocationPage"
|
|
||||||
x:DataType="v:ViewLocationPage"
|
|
||||||
BindingContext="{x:Reference viewLocationPage}">
|
|
||||||
<ContentPage.Content>
|
|
||||||
<maps:Map x:Name="map" IsShowingUser="False"
|
|
||||||
MoveToLastRegionOnLayoutChange="False"/>
|
|
||||||
</ContentPage.Content>
|
|
||||||
</ui:BillingPage>
|
|
@ -1,31 +0,0 @@
|
|||||||
using Billing.Models;
|
|
||||||
using Billing.UI;
|
|
||||||
using Xamarin.Forms.Maps;
|
|
||||||
|
|
||||||
namespace Billing.Views
|
|
||||||
{
|
|
||||||
public partial class ViewLocationPage : BillingPage
|
|
||||||
{
|
|
||||||
//private readonly Bill bill;
|
|
||||||
|
|
||||||
public ViewLocationPage(Bill bill)
|
|
||||||
{
|
|
||||||
//this.bill = bill;
|
|
||||||
Title = bill.Name;
|
|
||||||
|
|
||||||
InitializeComponent();
|
|
||||||
|
|
||||||
if (bill.Latitude != null && bill.Longitude != null)
|
|
||||||
{
|
|
||||||
var address = $"({bill.Latitude}, {bill.Longitude})";
|
|
||||||
map.Pins.Add(new Pin
|
|
||||||
{
|
|
||||||
Label = string.IsNullOrEmpty(bill.Store) ? address : bill.Store,
|
|
||||||
Type = PinType.Generic,
|
|
||||||
Position = new Position(bill.Latitude.Value, bill.Longitude.Value),
|
|
||||||
Address = address
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -19,6 +19,7 @@ namespace Billing.iOS
|
|||||||
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
|
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
|
||||||
{
|
{
|
||||||
Xamarin.Forms.Forms.Init();
|
Xamarin.Forms.Forms.Init();
|
||||||
|
Xamarin.FormsMaps.Init();
|
||||||
string action;
|
string action;
|
||||||
if (options != null && options.TryGetValue(UIApplication.LaunchOptionsShortcutItemKey, out var obj) && obj is UIApplicationShortcutItem shortcut)
|
if (options != null && options.TryGetValue(UIApplication.LaunchOptionsShortcutItemKey, out var obj) && obj is UIApplicationShortcutItem shortcut)
|
||||||
{
|
{
|
||||||
|
@ -80,7 +80,7 @@
|
|||||||
</dict>
|
</dict>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>17</string>
|
<string>18</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>1.2.317</string>
|
<string>1.2.317</string>
|
||||||
<key>LSApplicationQueriesSchemes</key>
|
<key>LSApplicationQueriesSchemes</key>
|
||||||
|
Reference in New Issue
Block a user