user14239450
user14239450

Reputation:

How use a Xamarin.GooglePlayServices.Maps in Xamarin.Forms?

I need use Xamarin.GooglePlayServices.Maps in my Xamarin.Forms App. But I wrote all my pages in shared project (for example App) and I can instal Xamarin.GooglePlayServices.Maps only in android project (App.Android). Can I use this pakage (Xamarin.GooglePlayServices.Maps) in my shared project (App)?

Upvotes: 0

Views: 726

Answers (3)

I'd suggest you as @HeroesVII said you should try Xamarin.Forms.Maps, is more lightweight and simplistic. Either way if you want to stick to Xamarin.GooglePlayServices.Maps there shouldn't be any problem with it being in the standard project.

You can find and example here in this repo I created about two days ago.

Upvotes: 0

Wendy Zang - MSFT
Wendy Zang - MSFT

Reputation: 10958

Like HeroesVII said, install the Xamarin.Forms.Maps for Xamarin.Forms. A code sample below for your reference.

The configuration process for displaying and interacting with a map on Android of Xamarin.Forms is:

  1. Get a Google Maps API key and add it to the manifest.
  2. Specify the Google Play services version number in the manifest.
  3. Specify the requirement for Apache HTTP Legacy library in the manifest.

For mroe details of steps, you could check the MS docs.

You could download the source file from the link below. https://learn.microsoft.com/en-us/samples/xamarin/xamarin-forms-samples/workingwithmaps/

Upvotes: 0

HeroesVII
HeroesVII

Reputation: 148

Download "Xamarin.Forms.Maps" instead. It have Dependencies to "Xamarin.GooglePlayService.Maps" and more.

Upvotes: 1

Related Questions