Importing AndroidMapsExtensions into Android Studio

683 views Asked by At

I have been trying relentlessly to use this library. Everytime I add it, I lose all android.support.v4 and com.google.android.gms.maps cababilities. There is very little documentation for this library.

Is there any tutorial that I have overlooked in my extensive Google searching?

Here's my gradle file:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:21.0.3'
    compile 'com.google.android.gms:play-services:6.5.87'
    compile 'com.androidmapsextensions:android-maps-extensions:2.2.0'
}

Also, I was using the raw code. Just found a jar on the net. Should I be using that instead?

1

There are 1 answers

3
Mina Fawzy On

what conflict you that you are using two dependencies with common function

compile 'com.google.android.gms:play-services:6.5.87'
compile 'com.androidmapsextensions:android-maps-extensions:2.2.0'

when you using it in your application make sure which library imported

example

you try use GoogleMap

you have two options in import

import com.google.android.gms.maps.GoogleMap;
                 **OR**
import com.androidmapsextensions.GoogleMap;
.........
...

private GoogleMap map; 

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

   // options instance from MarkerOptions
   // choose map extensions if you want pass data by setData method
    map.addMarker(options).setData(data);

}

Summary

Organize your imports as your need from google map libraries