Importing AndroidMapsExtensions into Android Studio

邮差的信 提交于 2019-12-13 06:14:22

问题


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:


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



来源:https://stackoverflow.com/questions/28816471/importing-androidmapsextensions-into-android-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!