Code Monkey home page Code Monkey logo

mapsapidemoapp's Introduction

MapsApiDemoApp

Dealing with Google Maps API on an Android app is not so hard as it seems when we first look into it. We just need to understand some basic concepts and then put some pieces together.

You should first visit some official docs like this and this. You could also check this Udacity course.

It is important to take sometime reading the docs, since there are some steps you must take prior to get your app up and running. One important step is to create an API key on the developer console in order to identify your project.

This project is an attempt to show you many things involving Google Maps working together in a single app. It uses Google Maps Android API v2.

Demo

With it you can:

  • Fly from one place to another (there are some fixed places already configured)
  • See lat/lng being updated at real time while you are flying on the map
  • Control zoom in and out
  • Add a marker to any place you want by choosing from 10 different marker colors
  • Add a circle up to to 5km of radious
  • Change map style [day and night styles]
  • Change map type [normal, Sattelite, hybrid]
  • Move a marker (long-click on it) and make maps to follow the marker

It uses:

  • CameraPosition class to get locations (lat/lng)
  • GoogleMap::animateCamera() to get some animation when moving the camera between places
  • MarkerOptions and LatLng classes to define markers
  • GoogleMap::addCircle() method in order to add circles around the map
  • GoogleMap::setMapType() and GoogleMap::setMapStype() methods to change map type and style
  • GoogleMap::OnMarkerDragListener and GoogleMap::animateCamera to move the map while moving a marker

When you see the code, you will realize how easy is to implement those features on your app. So, take it, read it and use it the way you want. Hope you enjoy it.

Thanks to Manoj Reddy on this SO question for the custom night map style.

If you want to know more about my projects, please, visit my blog.

License

This project is licensed under the MIT License - see the LICENSE file for details

mapsapidemoapp's People

Contributors

joaomotondon avatar

Watchers

James Cloos avatar  avatar

mapsapidemoapp's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.