11# Cartography
2+ [ ![ 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 )
23
3- Nventive solution for mobile app map.
4-
5- [ ![ License] ( https://img.shields.io/badge/License-Apache%202.0-blue.svg )] ( LICENSE )
4+ Cartography provides you 3 map related libraries for iOS, Android and Windows using native map of each platform.
65
76## Getting Started
87
98### ** Samples**
109- Clone project a sample is available.
11- - For seeing samples, build and install app with VS on the desire device (Android, IOS, or UWP)
10+ - For seeing samples, build and install app with VS on the desire device (Android, IOS, or UWP).
11+
12+ ### API Key (not needed for mapService)
13+ - For Google Maps (Android), you need to [ create your Api Key] ( https://developers.google.com/maps/documentation/android-sdk/get-api-key ) .
14+ - 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.
15+
16+ Set it in : sample.shared => Constants.
17+
18+ ``` csharp
19+ public class GoogleMaps
20+ {
21+ // TODO: Get new API Key
22+ public const string ApiKey = " " ;
23+ }
24+ ```
25+
26+ ### ** DynamicMap**
27+
28+ ### Permission
29+ - Maps doesn't required to ask permission to the user.
30+ - User Location isn't include in Cartography see: [ GeolocatorService] ( https://github.com/nventive/GeolocatorService ) .
31+
32+ #### Android
33+ - Setup your permission, in your AssemblyInfo of Android.
34+
35+ ``` csharp
36+ // Required, replace AppName by your Application Name.
37+ [assembly : UsesPermission (" AppName.permission.MAPS_RECEIVE" )]
38+ [assembly : Permission (Name = " AppName.permission.MAPS_RECEIVE" , ProtectionLevel = Android .Content .PM .Protection .Signature )]
39+
40+ [assembly : UsesPermission (" com.google.android.providers.gsf.permission.READ_GSERVICES" )]
41+
42+ [assembly : MetaData (" com.google.android.maps.v2.API_KEY" , Value = Constants .GoogleMaps .ApiKey )]
43+
44+ ```
45+ #### UWP
46+ - For windows location is in Package.appxmanifest under capabilities, select Location and Internet(Client).
47+
48+ ### Integration
1249
13-   ;
14- ## ** DynamicMap**
1550- Add Cartography.DynamicMap NuGet package to your project.
1651- In your ViewModel :
1752``` csharp
1853using Cartography .DynamicMap
1954```
20- - Implement IDynamicMapComponent to your ViewModel
55+ - Implement IDynamicMapComponent to your ViewModel . [ ViewModel sample ]( https : // github.com/nventive/Cartography/blob/master/Samples/Samples/Samples.Shared/Presentation/DynamicMap_FeaturesPageViewModel.cs)
2156 - Set Initial Value to your ViewPort .
22- - Add in your Page
57+ - Add in your Page .
58+
59+ [ViewModel sample ](https :// github.com/nventive/Cartography/blob/master/Samples/Samples/Samples.Shared/Presentation/DynamicMap_FeaturesPageViewModel.cs)
60+
2361#### **UWP **
2462```xml
2563<win :Grid >
2664 <dynamicMap :MapControl ViewModel = "{Binding }" />
2765</win :Grid >
2866```
67+
68+ - Add Style MapControl : see [MapControl ](https :// github.com/nventive/Cartography/blob/master/Samples/Samples/Samples.Shared/Views/Styles/MapControl.xaml).
69+
2970#### **Android / IOS **
3071```xml
3172<xamarin :Grid >
3273 <dynamicMap :MapControl ViewModel = "{Binding }" />
3374</xamarin :Grid >
3475```
35- - Add Style MapControl : see https :// github.com/nventive/Cartography/blob/master/Samples/Samples/Samples.Shared/Views/Styles/MapControl.xaml
36-
37- #### **DynamicMap Control **
38-
39- - Control can be added to your map : See [DynamicMapControl ](Documentation /DynamicMapControl .md )
76+ - Control can be added to your map : See [DynamicMap Control Documentation ](Documentation /DynamicMapControl .md ).
4077
4178  ;
42- ## **StaticMap**
79+ ### **StaticMap**
4380- Add Cartography .StaticMap NuGet package to your project .
4481- In your ViewModel :
4582```csharp
4683using Cartography .StaticMap
4784```
48- - Implement IStaticMapComponent to your ViewModel
85+ - Implement IStaticMapComponent to your ViewModel .
4986- Set Initial Value to your ViewPort and MapSize .
50- - Add in your Page
87+ - Add it in your Page .
5188```xml
5289<staticmap :StaticMapControl MapViewPort = "{Binding ViewPort }"
5390 MapSize = "{Binding MapSize }"
5491 Width = "10"
5592 Height = "10" />
5693```
57- - Add Style StaticMapControl : see https :// github.com/nventive/Cartography/blob/master/Samples/Samples/Samples.Shared/Views/Styles/StaticMapControl.xaml
94+ - Add Style StaticMapControl : see [ StaticMapControl ]( https :// github.com/nventive/Cartography/blob/master/Samples/Samples/Samples.Shared/Views/Styles/StaticMapControl.xaml).
5895
5996  ;
60- ## **MapService**
97+ ### **MapService**
6198- Add Cartography .MapService NuGet package to your project .
6299- In your ViewModel :
63100```csharp
@@ -78,8 +115,8 @@ private IMapService _mapService = this.GetService<IMapService>();
78115 " Montreal"
79116 ));
80117```
81- OR
82- for Direction (from user location to a GeoPosition) :
118+ OR
119+ for Direction (from user location to a GeoPosition) :
83120``` csharp
84121 await _mapService .ShowDirections (ct , new MapRequest (
85122 new BasicGeoposition ()
94131## Features
95132
96133### DynamicMap
97- 1 . ` Show Map ` : Show a interactive map on screen
98- - ` Google Map ` : Show Google Map on screen available for UWP, IOS , Android(native)
99- - ` IOS Map ` : Show Apple Map on screen available only on IOS (native)
100- - ` Bing Map ` : Show Bing Map on screen available only on UWP(native)
134+ 1 . ` Show Map ` : Show a interactive map on screen.
135+ - ` Google Map ` : Show Google Map on screen available for UWP, iOS , Android(native).
136+ - ` IOS Map ` : Show Apple Map on screen available only on iOS (native).
137+ - ` Bing Map ` : Show Bing Map on screen available only on UWP(native).
101138
1021392 . ` Show user location ` : Show the user location on the map.
103140
119156 - ` Remove Pushpin ` : User can remove pushpin.
120157 - ` Stop animation ` : User can stop animation to somewhere.
121158 - ` Zoom on user ` : Center the map to user location.
122- - ` Show POI ` : IOS only: show Point Of Interest. eg : Tour Eiffel.
159+ - ` Show POI ` : iOS only: show Point Of Interest. ex : Tour Eiffel.
123160
1241615 . ` Follow User `
125162 - ` Start follow user `
126163 - ` Stop follow user ` : Can detect if dragging or on button press.
127164
128165### StaticMap
1291661 . ` Show Map ` : Show a map on screen without interraction possible.
130- - ` Google Map ` : Show Google Map on screen available for UWP, IOS , Android(native)
131- - ` IOS Map` : Show Apple Map on screen available only on IOS (native)
132- - ` Bing Map ` : Show Bing Map on screen available only on UWP(native)
133- 2 . ` Show Pushpin ` : Show one pushpin on map (if place in bound)
167+ - ` Google Map ` : Show Google Maps on screen available for UWP, iOS , Android(native).
168+ - ` iOS Map` : Show Apple Maps on screen available only on iOS (native).
169+ - ` Bing Map ` : Show Bing Maps on screen available only on UWP(native).
170+ 2 . ` Show Pushpin ` : Show one pushpin on map (if place in bound).
134171
135172### MapService
1361731. ` Location ` : Open user default map service and show a location.
1371742. ` Direction ` : Open user default map service and show direction from User location to somewhere.
138175
139176
140- ## Changelog
177+ ## Breaking Changes
178+
179+ Please consult the [ BREAKING CHANGES] ( BREAKING_CHANGES.md ) for the list of breaking changes.
141180
142181Please consult the [ CHANGELOG] ( CHANGELOG.md ) for more information about version
143182history.
144183
145184## License
146185
147- This project is licensed under the Apache 2.0 license - see the
148- [ LICENSE] ( LICENSE ) file for details.
186+ This project is licensed under the [ Apache 2.0 license] ( LICENSE ) .
149187
150188## Contributing
151189
0 commit comments