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.
精彩评论