https://github.com/johnthiriet/encodedpolyline
A demo application of a Xamarin Forms project using Xamarin Forms Maps displaying an encoded polyline
https://github.com/johnthiriet/encodedpolyline
android csharp ios maps polyline sample xamarin xamarin-forms
Last synced: about 1 year ago
JSON representation
A demo application of a Xamarin Forms project using Xamarin Forms Maps displaying an encoded polyline
- Host: GitHub
- URL: https://github.com/johnthiriet/encodedpolyline
- Owner: johnthiriet
- License: mit
- Created: 2017-10-16T19:48:14.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-10-17T17:04:23.000Z (over 8 years ago)
- Last Synced: 2025-04-05T18:12:40.976Z (about 1 year ago)
- Topics: android, csharp, ios, maps, polyline, sample, xamarin, xamarin-forms
- Language: C#
- Size: 57.6 KB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# EncodedPolyline
A demo application of a Xamarin Forms project using Xamarin Forms Maps displaying an encoded polyline
# The application
When first running the application the map is centered around the users geolocation using the geolocator plugin.
You then have two buttons, one for changing the polyline, one for changing the polyline's colour.
# Interesting parts
In the shared project you will find a subclass of a Xamarin.Forms.Maps Map which adds support for a Google style encoded polyline and setting its colour.
The decoding of the polyline happens in this subclass and a dialog between this Forms control and it's custom renderer is established in order to properly display the map.
# Encoded polyline format
You can find more information about the Google's encoded polyline format on this website:
[https://developers.google.com/maps/documentation/utilities/polylinealgorithm?hl=en](https://developers.google.com/maps/documentation/utilities/polylinealgorithm?hl=en)
# Polyline example
```
kegiH}{dMv`@mhBhKzDcJtx@xFfFmRj_AsJiGg@wB}FsDoAv@eLmH~DoQvGhFu@jE
```
# Android
Please don't forget to add your own Google Maps Android API key in the Manifest before running the app !
# Reference
I found where to decode the encoded polyline there [https://forums.xamarin.com/discussion/85684/how-can-i-draw-polyline-for-an-encoded-points-string](https://forums.xamarin.com/discussion/85684/how-can-i-draw-polyline-for-an-encoded-points-string)
Thanks Luiz Gustavo !