开发者

Map Marker Management, Android

开发者 https://www.devze.com 2023-01-12 15:04 出处:网络
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 p开发者_StackOverflowosition.

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 p开发者_StackOverflowosition.

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?


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;
}

}

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号