Map Marker Management, Android

醉酒当歌 提交于 2019-12-23 02:36:26

问题


I have a map that dispays markers. If the user clicks on a marker a popup shows up. A method calculates wheather there is a marker at the clicked position.

My Problem is that I have a lot of different markers, but in this method I can handle only one specific marker.

I need something like a general bitmap, that holds all marker resources. E.g. I do not wand to handle 100 markers manually, because all are a Bitmap so I need just to handle one general bitmap.

any ideas?


回答1:


I have solved my problem. I define a MarkerManager class that holds static fields that contain intergers.

public class MarkerManager{
    private static final int ME = 1;

public static int getResource(int id){
    int marker = 0;
    switch(id){
    case id:
        marker = R.drawable.me;
    break;

    }
    return marker;
}

}



来源:https://stackoverflow.com/questions/3529022/map-marker-management-android

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