Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 419
lukegjpotter Avatar asked Oct 18 '22 15:10

lukegjpotter


1 Answers

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.

like image 107
TejjD Avatar answered Oct 21 '22 07:10

TejjD