A view abstraction to provide a map user interface with various underlying map providers

Overview

AirMapView

Build Status

AirMapView is a view abstraction that enables interactive maps for devices with and without Google Play Services. It is built to support multiple native map providers including Google Maps V2 and soon Amazon Maps V2. If a device does not have any supported native map provider, AirMapView will fallback to a web based map provider (currently Google Maps). Easy to integrate, it is a drop-in replacement for the Google Maps V2 package. AirMapView's original author is Nick Adams.

Features

  • Google Maps V2
  • Swap map providers at runtime
  • Web based maps for devices without Google Play Services

Download

Grab via Gradle:

compile 'com.airbnb.android:airmapview:1.8.0'

Snapshots of the development version are available in Sonatype's snapshots repository.

Sample App

The project includes a sample app which uses AirMapView. The sample app allows toggling between map providers, exemplifies adding map markers, and displays various callback information. The sample project can be built manually or you can download the APK.

How to Use

  1. Define AirMapView in your layout file

    <com.airbnb.android.airmapview.AirMapView
        android:id="@+id/map_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>
  2. Initialize in code

    mapView = (AirMapView) findViewById(R.id.map_view);
    mapView.initialize(getSupportFragmentManager());
  3. Add markers/polylines/polygons

    map.addMarker(new AirMapMarker(latLng, markerId)
            .setTitle("Airbnb HQ")
            .setIconId(R.drawable.icon_location_pin));

Mapbox Web setup

To use Mapbox Web maps in AirMapView, you'll need to sign up for a free account with Mapbox. From there you'll use an Access Token and Map ID in your AirMapView app. They're are then included in your app's AndroidManifest.xml file as meta-data fields.

<meta-data
    android:name="com.mapbox.ACCESS_TOKEN"
    android:value=ACCESS_TOKEN/>
<meta-data
    android:name="com.mapbox.MAP_ID"
    android:value=MAP_ID/>

Native Google Maps setup

With AirMapView, to support native Google maps using the Google Maps v2 SDK you will still need to set up the Google Maps SDK as described here. Follow all the instructions except the one about adding a map since AirMapView takes care of that for you. See the sample app for more information about how to set up the maps SDK.

License

Copyright 2015 Airbnb, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Comments
  • Add Mapbox As Web Map Source

    Add Mapbox As Web Map Source

    I've integrated Mapbox.js as the default Web map provider and would like to contribute it to AirMapView. All that's needed to make it work is to signup for a free Mapbox account and add your Access Token and MapId (this is documented in README as part of this PR as well as the updated Sample app).

    Please let me know if you have any questions. Thanks!

    20150705-airmapview-mapbox-js

    /cc @petzel @lxdvs

    opened by bleege 11
  • Don't force location permissions

    Don't force location permissions

    Don't force enabling location permissions when loading map. First commit needs to be taken out once the PR for it is merged.

    Resolves https://github.com/airbnb/AirMapView/issues/97

    @felipecsl @petzel @gpeal

    opened by nwadams 4
  • android-maps-utils compatibility

    android-maps-utils compatibility

    Google provides a utility library named android-map-utils, which includes many features not included directly in Google Maps, like :

    • clustering
    • heat maps
    • GeoJSON support
    • KML support

    Obviously, this library expects the APIs from Google Maps, so it cannot work with AirMapView.

    Since this library is open-source, I started integrating it in AirMapView. A working demo can be found at this address : https://github.com/acq/AirMapView/tree/map-utils. The only feature that does not work yet is custom tiles (and others require more work, like custom images for markers). Here are some screenshots:

    In this proof of concept, several features needed to be added or reworked in order the library to work. This includes ground overlays, custom image markers on web maps, changed APIs (for example: AirMapPolyline), various bug fixes, ...

    This code is not ready to be merged, but raises several questions:

    • are you interested in having those features? part of those features?
    • do you want them inside of AirMapView or in their own library (like android-map-utils exists currently), in order to keep AirMapView light?
    • I modified the package of these utils, so this library could exist in the same environment than the "old" android-map-utils. What package should be used?
    • are you open to the modification of current AirMapView APIs?

    Thanks!

    opened by acq 4
  • Marker positions are incorrect in web map when device language is changed

    Marker positions are incorrect in web map when device language is changed

    With the sample app installed on a UK based device, Nexus 6 running Lollipop

    1. Change device language to Spanish / German etc
    2. Select 'Use Google Web Map' or 'Use MapBox Map'
    3. RESULT: the markers are incorrectly placed in a horizontal line across globe

    If you change the language to certain Asian ones - Chinese, Thai for example, the markers are correctly placed.

    opened by geofffalk 4
  • Prevent crash on Android M new permission model

    Prevent crash on Android M new permission model

    Native Google Maps needs WRITE_EXTERNAL_STORAGE permission on Android M, so we should check for that as well before assuming that it is supported. This prevents AirMapView from crashing on M.

    @petzel @nwadams

    opened by felipecsl 4
  • Forced asking for location permission

    Forced asking for location permission

    Hey,

    looks like the library asks for a location permission on behalf of us. What I'd like to achieve is to ask for this permission on my own.

    From what I can see checkLocationPermissions() checks if permission is granted and asks for it if not. This method is used only from setMyLocationEnabled() method. This would be acceptable if, as a workaround, I could pass false to it and avoid asking. Unfortunately in NativeGoogleMapFragment init() method there's a setMyLocationEnabled(true) call which forces asking for permission.

    Is this correct or am I missing something?

    As for me, the ideal solution would be to completely remove asking for this permission from AirMapView and leave it to developer's decision. Another, that would probably work for most of people, would be to remove setMyLocationEnabled(true) from mentioned init() method.

    What do you think?

    opened by MateuszMlodawski 3
  • Add geolocation support for tracking user location

    Add geolocation support for tracking user location

    In a project I'm doing I realized that I needed to show the user location on the map. As I didn't find any way to directly do this, I coded something that should work on both native and webview versions.

    opened by jmartinesp 3
  • Fail on compile

    Fail on compile

    This return a error when I try to compile. The build of gradle works well, but the app, not.

    Error:Execution failed for task ':app:dexDebug'.
    > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/lib/jvm/java-7-openjdk-amd64/bin/java'' finished with non-zero exit value 2
    
    opened by ppamorim 3
  • add amazon maps SDK

    add amazon maps SDK

    @felipecsl @nwadams

    this just adds the amazon module.

    since it is an aar, android studio won't build it if simply included in libs - it has to be imported as a new module

    opened by petzel 3
  • [native] Fix enabling location and show location button

    [native] Fix enabling location and show location button

    Change summary:

    onLocationPermissionsGranted is called only when location permissions were granted. We should set location enabled as true and show the location button.

    tested on the sample app

    How was it tested?

    • [X] Built and ran on simulator
    • [X] Built and ran on device

    Please review:

    @felipecsl

    screenshot_20171212-151411

    opened by wonginese 2
  • Allow Zoom Control & Location Button Customization

    Allow Zoom Control & Location Button Customization

    Allowing the user to set not only MyLocationEnabled but also ZoomControlsEnabled and MyLocationButtonEnabled

    Attempts to address https://github.com/airbnb/AirMapView/issues/103

    opened by forrestbice 2
  • Trying to get in touch regarding a security issue

    Trying to get in touch regarding a security issue

    Hey there!

    I'd like to report a security issue but cannot find contact instructions on your repository.

    If not a hassle, might you kindly add a SECURITY.md file with an email, or another contact method? GitHub recommends this best practice to ensure security issues are responsibly disclosed, and it would serve as a simple instruction for security researchers in the future.

    Thank you for your consideration, and I look forward to hearing from you!

    (cc @huntr-helper)

    opened by zidingz 1
  • How to add TouchListener?

    How to add TouchListener?

    TouchListener simply will not work since mapview itself is using touchlistener inside of it. What if we want to detect action up by our own touchlistenr? Please provide solution.

    opened by waqaruet 0
  • [DO NOT MERGE] Preparing for 1.9.1 release

    [DO NOT MERGE] Preparing for 1.9.1 release

    I accidentally published this breaking change https://github.com/airbnb/AirMapView/pull/136 to Airbnb Artifactory for version 1.9.0.

    This version, 1.9.1, removes the breaking change. I'll have a releases to update airmapview version in the Android app to 1.9.1.

    Do not merge this into master

    opened by npham02 0
Releases(v2.1.1)
  • v2.1.1(Oct 10, 2019)

  • v1.5.0(Sep 8, 2017)

  • v1.4.0(Jan 21, 2017)

    • Fix: Crash in requestPermissions pre M #89
    • Updated Google Play Services to v10.0.1 #96
    • Fix: Setting location enabled and denying permissions leads to inconsistent state #93
    Source code(tar.gz)
    Source code(zip)
This is a repo for implementing Map pan or drag (up, down, right ,left) to load more places on the Google Map for Android

Challenge Display restaurants around the user’s current location on a map ○ Use the FourSquare Search API to query for restaurants: https://developer.

Mahmoud Ramadan 7 Jul 30, 2022
This project allows you to calculate the route between two locations and displays it on a map.

Google-Directions-Android This project allows you to calculate the direction between two locations and display the route on a Google Map using the Goo

Joel Dean 970 Dec 15, 2022
malik dawar 87 Sep 18, 2022
LocationPicker 2.1 0.4 Java - A simple and easy to way to pick a location from map

Introduction LocationPicker is a simple and easy to use library that can be integrated into your project. The project is build with androidx. All libr

Shivpujan yadav 61 Sep 17, 2022
typedmap is an implementation of heterogeneous type-safe map pattern in Kotlin

Typedmap typedmap is an implementation of heterogeneous type-safe map pattern in Kotlin. It is a data structure similar to a regular map, but with two

Ryszard Wiśniewski 34 Nov 7, 2022
Slime loader is a map loader & saver for the file format Slime as specified here implemented in Minestom.

??️ SlimeLoader Slime loader is a map loader & saver for the file format Slime as specified here implemented in Minestom. Features: World loading Bloc

null 25 Oct 2, 2022
Self-hosted map of visited places (with a very fancy stack underneath)

Tripmap Self-hosted map of visited places (with a very fancy stack underneath) Features Sharing custom map-view with pins in locations marked by user.

Igor Kurek 2 Feb 6, 2022
An android app that uses Google Maps API and SDK to track a user's location and calculate the total distance travelled

Bike Rush is an android app that uses Google Maps API and SDK to track a user's location and calculate the total distance travelled by him or her along with time and average speed.

Ishant Chauhan 21 Nov 14, 2022
The app has got fullscreen Turkey map via Huawei Map. App selects random province and shows it borders on the map than user will try to guess the provinces name.

Il Bil App Introduction I will introduce you to how to implement Account Kit, Map Kit, Game Service. About the game: The app has got fullscreen Turkey

Gökhan YILMAZ 4 Aug 2, 2022
ModernStorage is a group of libraries that provide an abstraction layer over storage on Android to simplify its interactions

ModernStorage ModernStorage is a group of libraries that provide an abstraction layer over storage on Android to simplify its interactions by apps dev

Google 1.1k Dec 30, 2022
Tree View; Mind map; Think map; tree map

A custom tree view for Android, designed for easy drawing some tree nodes (e.g. thind mind and tree nodes). Includes smoothly zoom, move, limit and center fix animation support, and allows easy extension so you can add your own child node's customs view and touch event detection.

怪兽N 304 Jan 3, 2023
Koin Annotations - help declare Koin definition in a very fast and intuitive way, and generate all underlying Koin DSL for you

The goal of Koin Annotations project is to help declare Koin definition in a very fast and intuitive way, and generate all underlying Koin DSL for you. The goal is to help developer experience to scale and go fast ?? , thanks to Kotlin Compilers.

insert-koin.io 68 Jan 6, 2023
My Maps displays a list of maps, each of which show user-defined markers with a title, description, and location. The user can also create a new map. The user can save maps and load them in from previous usages of the app.

My Maps Bryant Jimenez My Maps displays a list of maps, each of which show user-defined markers with a title, description, and location. The user can

null 0 Nov 1, 2021
A simple Kotlin multi-platform abstraction around the javax.inject annotations.

Inject A simple Kotlin multi-platform abstraction around the javax.inject annotations. This allows using the annotations in Kotlin common code so that

Christopher 43 Aug 17, 2022
Android integration of multiple icon providers such as FontAwesome, Entypo, Typicons,...

Note: Due to lack of time, Iconify is no longer maintained and icon packs are outdated. I'd be very happy to welcome a new contributor, please reach m

Joan Zapata 3.9k Dec 24, 2022
SPIDlibraryAndroid is a library for logging in via SPID through several different identity providers.

SPIDlibraryAndroid SPIDlibraryAndroid is a library for logging in via SPID through several different identity providers.

INPS 98 Dec 15, 2022
FairEmail is easy to set up and works with virtually all email providers, including Gmail, Outlook and Yahoo!

Downloads • Privacy • Support • License FairEmail Fully featured, open source, privacy oriented email app for Android FairEmail is easy to set up and

Marcel Bokhorst 1.5k Jan 2, 2023
A material-styled android view that provisions picking of a date, time & recurrence option, all from a single user-interface.

SublimePicker A customizable view that provisions picking of a date, time & recurrence option, all from a single user-interface. You can also view 'Su

Vikram 2.3k Jan 4, 2023
A material-styled android view that provisions picking of a date, time & recurrence option, all from a single user-interface.

SublimePicker A customizable view that provisions picking of a date, time & recurrence option, all from a single user-interface. You can also view 'Su

Vikram 2.3k Jan 4, 2023
This app should provide a common interface to fetch the estimated time of arrival for parcels

ETA-App This app should provide a common interface to fetch the estimated time of arrival for parcels. It will integrate with several backend systems

bring 0 Dec 14, 2021