Issue
I am trying to add an overlay to the map view as it is described here.
Everything works as expected (even onTap event is fired) except the fact that markers remain invisible.
I've modified an onTap
method adding the line
dialog.setIcon(item.getMarker(0));
Now markers become visible after taping any item (i have two items in the overlay and I use the same drawable as a marker for both). When I turn the device (causing the map to redraw) markers become invisible again.
I am using Samsung Galaxy p1000 with Android 2.2. Any ideas?
Solution
I seem to remember there were a couple of errors in this tutorial.
Firstly the HelloItemizedOverlay constructor which takes a context needs to change to
public HelloItemizedOverlay(Drawable defaultMarker, Context context) {
// super(defaultMarker); - REPLACE THIS WITH LINE BELOW
super(boundCenterBottom(defaultMarker));
mContext = context;
}
and the context needs to be passed in from the other class
HelloItemizedOverlay itemizedoverlay = new HelloItemizedOverlay(drawable, this);
You shouldn't need to use the 'getMarker' change you described.
Answered By - NickT
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.