https://github.com/nventive/cartography
https://github.com/nventive/cartography
android dotnet ios mobile uno-platform uwp xamarin
Last synced: 29 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/nventive/cartography
- Owner: nventive
- License: apache-2.0
- Created: 2022-04-20T00:35:33.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-09-29T02:25:49.000Z (about 1 year ago)
- Last Synced: 2024-12-13T02:40:39.164Z (11 months ago)
- Topics: android, dotnet, ios, mobile, uno-platform, uwp, xamarin
- Language: C#
- Homepage:
- Size: 1.22 MB
- Stars: 2
- Watchers: 5
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Cartography
Nventive solution for mobile app map.
[](LICENSE)
## Getting Started
### **Samples**
- Clone project a sample is available.
- For seeing samples, build and install app with VS on the desire device (Android & IOS)
## Mobile
### Android
On Android we need to add these lines to the manifest :
```
```
You'll also need to add the location permissions :
```
```
### iOS
For iOS you need to add these lines to your info.plist.
```
NSLocationWhenInUseUsageDescription
Sample would like to access your location
NSLocationUsageDescription
Sample would like to access your location
```
## **DynamicMap**
- Add Cartography.DynamicMap NuGet package to your project.
- In your ViewModel:
```csharp
using Cartography.DynamicMap
```
- Implement IDynamicMapComponent to your ViewModel
- Set Initial Value to your ViewPort.
- Add in your Page
### **Android / IOS**
```xml
```
#### GoogleMap with Dynamic Map on iOS
```xml
xmlns:gmc="using:Cartography.DynamicMap.GoogleMap.iOS"
```
## Pushpins
In order for the pushpins to display properly on all platforms you need to add a MapControlBehavior.PushpinImageSelector
```xml
```
Then you need to have a converter in your page for the Selector
```xml
```
Finally you need to place your pushpin icons assets in the Shared project assets folder AND the android assets folder in the mobile head.
If you don't do the latter the pushpin won't work on android.
It is imperative that you place the assets in the android assets folder and not in a subfolder otherwise the assets wont be found by the MapControlBehavior.
This is because uno 4.5 changed how the assets where generated forcing us to apply a workaround for Android.
Your Android folder should look like this :
Sample.Mobile
- Android
- Assets
- active.png
- active.scale-200.png
- active.scale-300.png
- inactive.png
- inactive.scale-200.png
- inactive.scale-300.png
- Add Style MapControl: see
#### **DynamicMap Control**
- Control can be added to your map: See [DynamicMapControl](Documentation/DynamicMapControl.md)
## **StaticMap**
- Add Cartography.StaticMap NuGet package to your project.
- In your ViewModel:
```csharp
using Cartography.StaticMap
```
- Implement IStaticMapComponent to your ViewModel
- Set Initial Value to your ViewPort and MapSize.
- Add in your Page
```xml
```
- Add Style StaticMapControl: see
## **MapService**
- Add Cartography.MapService NuGet package to your project.
- In your ViewModel:
```csharp
using Cartography.MapService
```
- Add Service:
```csharp
private IMapService _mapService = this.GetService();
```
- For location:
```csharp
await _mapService.ShowLocation(ct, new MapRequest(
new BasicGeoposition()
{
Latitude = 45.5016889,
Longitude = -73.56725599999999
},
"Montreal"
));
```
- for Direction (from user location to a GeoPosition):
```csharp
await _mapService.ShowDirections(ct, new MapRequest(
new BasicGeoposition()
{
Latitude = 45.5016889,
Longitude = -73.56725599999999,
},
"Montreal"
));
```
## 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)
2. `Show user location` : Show the user location on the map.
3. `Show Pushpin` : Show Pushpin (marker) on the map.
- `Filter Pushpin`
- `Add Pushpin`
- `Remove Pushpin`
- `Customize pushpin` : Change appearance of pushpin.
- `Group pushpin` : Group multiple pushpins together, show only one pushpin.
4. `Map interaction`
- `Drag` : Move the map.
- `Zoom` : Two finger zooming.
- `Rotate` : Two finger rotating, can be disable.
- `Select pushpin` : Pushpin selected. Can be single or multiple.
- `Deselect pushpin` : Pushpin deselection. Can be single or global.
- `Zoom on pushpin` : At the start or after an action.
- `Add Pushpin` : User can add pushpin.
- `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.
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)
### 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
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.
## Contributing
Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on the process for
contributing to this project.
Be mindful of our [Code of Conduct](CODE_OF_CONDUCT.md).