Skip to content

googlemaps-samples/android-maps3d-samples

Build

Contributors License StackOverflow Discord

Google Maps 3D SDK for Android Samples

Hello Map Camera Markers Polygons Polylines Models
Hello Map Activity Camera Controls Activity Markers Activity Polygons Activity Polylines Activity Models Activity

Description

The Google Maps Platform Maps3D SDK for Android (Experimental Preview) empowers developers to bring immersive, real-world 3D experiences into their Android applications. This SDK allows you to render detailed 3D buildings, terrain, and landmarks, offering users a richer and more interactive way to explore geographical data. Key features include programmatic camera control for cinematic fly-throughs, the ability to add 3D markers and models to the map, and drawing custom polylines and polygons in a 3D space.

This repository provides a collection of sample applications to help you get started and explore the capabilities of the Maps3D SDK:

  • Maps3DSamples/ApiDemos: This module showcases the fundamental API features using Kotlin and traditional Android Views. It's a great starting point to understand core concepts like map instantiation, camera manipulation, and adding various map objects.
  • Maps3DSamples/advanced: For developers using Jetpack Compose, this sample demonstrates how to integrate the Maps3D SDK into a declarative UI. It utilizes helper classes to bridge the SDK's View-based SDK with Compose, offering a more modern approach to building UIs with 3D maps.

View-based Kotlin Samples

[Maps3DSamples/ApiDemos]This repo contains the following samples:

Maps3DSamples/ApiDemos/kotlin-app: Demonstrates various features of the Maps3D SDK for Android using Kotlin and Android Views. This module includes examples for:

  • Basic map setup ("Hello Map")
  • Camera controls and restrictions
  • Adding and customizing markers
  • Drawing polygons and polylines
  • Loading and displaying 3D models

The Maps3DSamples/ApiDemos/common module contains shared utilities and layouts.

Jetpack Compose Samples

Maps3DSamples/advanced demonstrates options for integrating the Maps3D SDK into a Jetpack Compose UI. It also has Map3dViewModel which demonstrates how to create an abstract base class for view models needing to interact with the Maps3DView via a GoogleMap3D.

Requirements

To run the samples, you will need:

  • To sign up with Google Maps Platform and enable Maps3D API for Android.
  • An API key associated with the project above. Follow the API key instructions if you're new to the process.
  • Copy Maps3DSamples/ApiDemos/local.defaults.properties to Maps3DSamples/ApiDemos/secrets.properties and set the value of MAPS3D_API_KEY to your API key.
  • (for the advanced sample, copy Maps3DSamples/advanced/local.defaults.properties to Maps3DSamples/advanced/secrets.properties and set the value of MAPS3D_API_KEY to your API key.)
  • All samples require up-to-date versions of the Android build tools and the Android support repository.

Running the sample(s)

  1. Download the samples by cloning this repository:
    git clone https://github.com/googlemaps-samples/android-maps3d-samples.git
  2. In the welcome screen of Android Studio, select "Open".
  3. Navigate to the root directory of this cloned repository and select it, or navigate into a specific sample directory, open either of the base projects,Maps3DSamples/ApiDemos or Maps3DSamples/advanced.

Alternatively, use the gradlew build command within a sample's directory to build the project directly or download an APK under releases (if available for the specific sample).

Contributing

Contributions are welcome and encouraged! If you'd like to contribute, send us a pull request and refer to our code of conduct and contributing guide.

Terms of Service

This sample uses Google Maps Platform services. Use of Google Maps Platform services through this sample is subject to the Google Maps Platform Terms of Service.

This sample is not a Google Maps Platform Core Service. Therefore, the Google Maps Platform Terms of Service (e.g. Technical Support Services, Service Level Agreements, and Deprecation Policy) do not apply to the code in this sample.

Support

This sample is offered via an open source license. It is not governed by the Google Maps Platform Support Technical Support Services Guidelines, the SLA, or the Deprecation Policy. However, any Google Maps Platform services used by the sample remain subject to the Google Maps Platform Terms of Service.

If you find a bug, or have a feature request, please file an issue on GitHub. If you would like to get answers to technical questions from other Google Maps Platform developers, ask through one of our developer community channels. If you'd like to contribute, please check the contributing guide.

You can also discuss this sample on our Discord server.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages