
External Maps Plugin:
Platform Support:
- Xamarin.iOS - iOS 7+
- Xamarin.Android - API 10+
Coding Part:
Steps:
Step 1
Create New Project by Selecting New -> Project -> Select Xamarin Cross Platform App and Click OK.

Step 2
We will start coding for External Maps. Create New Xamarin Forms Project. Open Nuget Package Manager against the solution and do search for External Maps Plugin or Paste the following Nuget Installation.Install-Package ExternalMapsPlugin -Version 1.0.0
Add this Plugin against Android & iOS Platforms.

Step 3
Open your XAML file and paste the following code. I have added a clicked event for the button to trigger or pin the specific co-ordinate to the map.<code class="xml language-xml"><?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:MapsPluginSample" x:Class="MapsPluginSample.MainPage"> <Button Text="Pin Co-Ordinate" Clicked="OnButtonClicked" VerticalOptions="Center" HorizontalOptions="Center" /> </ContentPage>Open your MainPage.xaml.cs and add button click as shown below.
private void OnButtonClicked(object sender, EventArgs e)
{
}
Add Pinto method to locate co-ordinates in External Maps.
private void OnButtonClicked(object sender, EventArgs e)
{
CrossMapsPlugin.Current.PinTo("Vannarapettai", 10.7653, 79.0687, 8);
}
Here, Vannarapettai is the label for your location 10.7653, 79.0687 is Latitude & Longitude of the location respectively. 8 is the zoom level of your Application.
Demo
The Following screenshots demonstrates how this plugin works. You can download the source code of this article and post your comments about this article and Plugin.
Android | iOS |
---|---|
![]() | ![]() |
Download Code
You can download the full source code of the article in GitHub. If you like this article, do star the repo in GitHub. Hit like the article.
0 comments:
Please Comment about the Posts and Blog