Skip to content
Open
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
Empty file added BREAKING_CHANGES.md
Empty file.
102 changes: 70 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,63 +1,100 @@
# Cartography
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=flat-square)](LICENSE)![Version](https://img.shields.io/nuget/v/Cartography.DynamicMap?style=flat-square)![Downloads](https://img.shields.io/nuget/dt/Cartography.DynamicMap?style=flat-square)

Nventive solution for mobile app map.

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
Cartography provides you 3 map related libraries for iOS, Android and Windows using native map of each platform.

## Getting Started

### **Samples**
- Clone project a sample is available.
- For seeing samples, build and install app with VS on the desire device (Android, IOS, or UWP)
- For seeing samples, build and install app with VS on the desire device (Android, IOS, or UWP).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iOS, not IOS

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking the samples should not be steps of the Getting Started section.
Please check the following link for the content and structure of the readme: https://dev.azure.com/nventive/Practice%20committees/_wiki/wikis/Committees.wiki/14813/Recipes?anchor=repository-structure-and-documentation


### API Key (not needed for mapService)
- For Google Maps (Android), you need to [create your Api Key](https://developers.google.com/maps/documentation/android-sdk/get-api-key).
- For Bing Maps, you need a [Bing Api Key](https://learn.microsoft.com/en-us/bingmaps/getting-started/bing-maps-dev-center-help/getting-a-bing-maps-key) to remove warning.

Set it in : sample.shared => Constants.

```csharp
public class GoogleMaps
{
//TODO: Get new API Key
public const string ApiKey = "";
}
```

### **DynamicMap**

### Permission
- Maps doesn't required to ask permission to the user.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Permissions for what? Why are we mentioning this in the Getting Started section if it's not even needed?

It's also a bit confusing because the next nested section is about setting up permissions on Android, which seem to be required.

- User Location isn't include in Cartography see: [GeolocatorService](https://github.com/nventive/GeolocatorService).

#### Android
- Setup your permission, in your AssemblyInfo of Android.

```csharp
//Required, replace AppName by your Application Name.
[assembly: UsesPermission("AppName.permission.MAPS_RECEIVE")]
[assembly: Permission(Name = "AppName.permission.MAPS_RECEIVE", ProtectionLevel = Android.Content.PM.Protection.Signature)]

[assembly: UsesPermission("com.google.android.providers.gsf.permission.READ_GSERVICES")]

[assembly: MetaData("com.google.android.maps.v2.API_KEY", Value = Constants.GoogleMaps.ApiKey)]

```
#### UWP
- For windows location is in Package.appxmanifest under capabilities, select Location and Internet(Client).

### Instantiation

 
## **DynamicMap**
- Add Cartography.DynamicMap NuGet package to your project.
- In your ViewModel :
```csharp
using Cartography.DynamicMap
```
- Implement IDynamicMapComponent to your ViewModel
- Implement IDynamicMapComponent to your ViewModel. [ViewModel sample](https://github.com/nventive/Cartography/blob/master/Samples/Samples/Samples.Shared/Presentation/DynamicMap_FeaturesPageViewModel.cs)
- Set Initial Value to your ViewPort.
- Add in your Page
- Add in your Page.

[ViewModel sample](https://github.com/nventive/Cartography/blob/master/Samples/Samples/Samples.Shared/Presentation/DynamicMap_FeaturesPageViewModel.cs)

#### **UWP**
```xml
<win:Grid>
<dynamicMap:MapControl ViewModel="{Binding}" />
</win:Grid>
```

- Add Style MapControl : see [MapControl](https://github.com/nventive/Cartography/blob/master/Samples/Samples/Samples.Shared/Views/Styles/MapControl.xaml).

#### **Android / IOS**
```xml
<xamarin:Grid>
<dynamicMap:MapControl ViewModel="{Binding}" />
</xamarin:Grid>
```
- Add Style MapControl : see https://github.com/nventive/Cartography/blob/master/Samples/Samples/Samples.Shared/Views/Styles/MapControl.xaml

#### **DynamicMap Control**

- Control can be added to your map : See [DynamicMapControl](Documentation/DynamicMapControl.md)
- Control can be added to your map : See [DynamicMap Control Documentation](Documentation/DynamicMapControl.md).

&nbsp;
## **StaticMap**
### **StaticMap**
- Add Cartography.StaticMap NuGet package to your project.
- In your ViewModel :
```csharp
using Cartography.StaticMap
```
- Implement IStaticMapComponent to your ViewModel
- Implement IStaticMapComponent to your ViewModel.
- Set Initial Value to your ViewPort and MapSize.
- Add in your Page
- Add it in your Page.
```xml
<staticmap:StaticMapControl MapViewPort="{Binding ViewPort}"
MapSize="{Binding MapSize}"
Width="10"
Height="10" />
```
- Add Style StaticMapControl : see https://github.com/nventive/Cartography/blob/master/Samples/Samples/Samples.Shared/Views/Styles/StaticMapControl.xaml
- Add Style StaticMapControl : see [StaticMapControl](https://github.com/nventive/Cartography/blob/master/Samples/Samples/Samples.Shared/Views/Styles/StaticMapControl.xaml).

&nbsp;
## **MapService**
### **MapService**
- Add Cartography.MapService NuGet package to your project.
- In your ViewModel :
```csharp
Expand All @@ -78,8 +115,8 @@ private IMapService _mapService = this.GetService<IMapService>();
"Montreal"
));
```
OR
for Direction (from user location to a GeoPosition) :
OR
for Direction (from user location to a GeoPosition) :
```csharp
await _mapService.ShowDirections(ct, new MapRequest(
new BasicGeoposition()
Expand All @@ -94,10 +131,10 @@ OR
## Features

### DynamicMap
1. `Show Map` : Show a interactive map on screen
- `Google Map` : Show Google Map on screen available for UWP, IOS, Android(native)
- `IOS Map` : Show Apple Map on screen available only on IOS(native)
- `Bing Map` : Show Bing Map on screen available only on UWP(native)
1. `Show Map` : Show a interactive map on screen.
- `Google Map` : Show Google Map on screen available for UWP, iOS, Android(native).
- `IOS Map` : Show Apple Map on screen available only on iOS(native).
- `Bing Map` : Show Bing Map on screen available only on UWP(native).

2. `Show user location` : Show the user location on the map.

Expand All @@ -119,33 +156,34 @@ OR
- `Remove Pushpin` : User can remove pushpin.
- `Stop animation` : User can stop animation to somewhere.
- `Zoom on user` : Center the map to user location.
- `Show POI` : IOS only: show Point Of Interest. eg: Tour Eiffel.
- `Show POI` : iOS only: show Point Of Interest. ex: Tour Eiffel.

5. `Follow User`
- `Start follow user`
- `Stop follow user` : Can detect if dragging or on button press.

### StaticMap
1. `Show Map`: Show a map on screen without interraction possible.
- `Google Map` : Show Google Map on screen available for UWP, IOS, Android(native)
- `IOS Map` : Show Apple Map on screen available only on IOS(native)
- `Bing Map` : Show Bing Map on screen available only on UWP(native)
2. `Show Pushpin` : Show one pushpin on map (if place in bound)
- `Google Map` : Show Google Maps on screen available for UWP, iOS, Android(native).
- `iOS Map` : Show Apple Maps on screen available only on iOS(native).
- `Bing Map` : Show Bing Maps on screen available only on UWP(native).
2. `Show Pushpin` : Show one pushpin on map (if place in bound).

### MapService
1. `Location` : Open user default map service and show a location.
2. `Direction` : Open user default map service and show direction from User location to somewhere.


## Changelog
## Breaking Changes

Please consult the [BREAKING CHANGES](BREAKING_CHANGES.md) for the list of breaking changes.

Please consult the [CHANGELOG](CHANGELOG.md) for more information about version
history.

## License

This project is licensed under the Apache 2.0 license - see the
[LICENSE](LICENSE) file for details.
This project is licensed under the [Apache 2.0 license](LICENSE).

## Contributing

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@
<Company>nventive</Company>
<AssemblyName>Cartography.DynamicMap</AssemblyName>
<PackageId>Cartography.DynamicMap</PackageId>
<Description>Cartography.DynamicMap</Description>
<Description>Provide an interactive map for iOS, Android and UWP.</Description>
<PackageTags>cartography;dynamicmap;mvvm;ios;android;xamarin;uwp;google maps;bing maps;uno;maps</PackageTags>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/nventive/Cartography</PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>

<!--Needed for Source Link support -->
<PublishRepositoryUrl>true</PublishRepositoryUrl>
Expand Down Expand Up @@ -54,6 +57,13 @@
</None>
</ItemGroup>

<ItemGroup>
<None Include="..\..\..\README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'monoandroid12.0'">
<PackageReference Include="Xamarin.GooglePlayServices.Base">
<Version>117.6.0.5</Version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@
<Company>nventive</Company>
<AssemblyName>Cartography.MapService</AssemblyName>
<PackageId>Cartography.MapService</PackageId>
<Description>Cartography.MapService</Description>
<Description>Open the default map service of the platform.</Description>
<PackageTags>cartography;mapService;mvvm;ios;android;xamarin;uwp;google maps;bing maps;uno;maps</PackageTags>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageProjectUrl>https://github.com/nventive/Cartography</PackageProjectUrl>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageReadmeFile>README.md</PackageReadmeFile>

<!--Needed for Source Link support -->
<PublishRepositoryUrl>true</PublishRepositoryUrl>
Expand All @@ -34,4 +37,11 @@
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
<None Include="..\..\..\README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@
<Company>nventive</Company>
<AssemblyName>Cartography.StaticMap</AssemblyName>
<PackageId>Cartography.StaticMap</PackageId>
<Description>Cartography.StaticMap</Description>
<Description>Provide a static map for iOS, Android and UWP.</Description>
<PackageTags>cartography;staticmap;mvvm;ios;android;xamarin;uwp;google maps;bing maps;uno;maps</PackageTags>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/nventive/Cartography</PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>

<!--Needed for Source Link support -->
<PublishRepositoryUrl>true</PublishRepositoryUrl>
Expand All @@ -34,6 +37,13 @@
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
<None Include="..\..\..\README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'xamarinios10'">
<PackageReference Include="Uno.Extensions.Logging.OSLog">
<Version>1.4.0</Version>
Expand Down