lukegjpotter
lukegjpotter

Reputation: 251

How to get maps rendered inside of a CardView

I'm wondering how to get the map to appear inside the CardView, like in the images below, highlighted in pink.

On the left is Strava, it shows the map with the route highilghted. On the right is Google Calendar, it has a map of the location of the calender event.

strava on the left, google calendar on the right

I would really appriciate some pointer on where to look in the apis to achieve this.

Regards,
Luke

Upvotes: 6

Views: 2973

Answers (1)

TejjD
TejjD

Reputation: 2571

You need to use a MapView to achieve this.

This is part of Androids Lite Mode.

Create your card, and add the MapView inside the CardView.

Then in your onCreate(), you create the actual map and set the MapView to display that map.

Upvotes: 3

Related Questions