开发者

how to add a marker to basicComponentMap from given coordinates with Nutiteq package?

开发者 https://www.devze.com 2023-03-31 03:31 出处:网络
How to add a marker to BasicComponentMap from given coordinates using the Nutiteq package. Its quite easy to add a marker if using the current user location, but I want to set a开发者_运维百科 marker

How to add a marker to BasicComponentMap from given coordinates using the Nutiteq package. Its quite easy to add a marker if using the current user location, but I want to set a开发者_运维百科 marker in a given location from longitude and latitude.

Thanks.


I have found a way:

    try {
        Image poiImage = Image.createImage("/res/drawable/gps_marker.png");
        PlaceLabel poiLabel =new PlaceLabel("location");
        Place p = new Place(1, poiLabel, poiImage, lon, lat);
        mapComponent.addPlace(p);
    } catch (IOException e) {
        Log.d("MAPA", "Couldn't location marker image.");
    }

Where mapComponent is BasicMapComponent.

0

精彩评论

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