android overlay not visible
I am making a location based app.
I have the following code:Drawable blueDrawable = getApplicationContext().getResources().getDrawable(R.drawable.blue);
Drawable redDrawable = getApplicationContext().getResources().getDrawable(R.drawable.red);
CustomizedOverlay blueItemizedOverlay = new CustomizedOverlay(blueDrawable);
CustomizedOverlay redItemizedOverlay = new CustomizedOverlay(redDrawable);
String [] s = startloc.getText().toString().split(" ");
Log.e(tag, s[0]); Log.e(tag, s[1]);
Double lat = Double.parseDouble(s[0]);
Double lon = Double.parseDouble(s[开发者_如何学C1]);
GeoPoint startpoint = new GeoPoint((int) (lat * 1e6) , (int) (lon * 1e6));
s = startloc.getText().toString().split(" ");
lat = Double.parseDouble(s[0]);
lon = Double.parseDouble(s[1]);
GeoPoint stoppoint = new GeoPoint((int) (lat * 1e6) , (int) (lon * 1e6));
OverlayItem overlayitem = new OverlayItem(startpoint, "base camp","");
blueItemizedOverlay.addOverlay(overlayitem);
The map is animating to the correct point. But the overlay is not getting displayed.
If you want the CustomizedOverlay class, I'll post it. Thank you.I forgot to add
List<Overlay> mapOverlays = mapView.getOverlays();
mapOverlays.add(blueItemizedOverlay);
精彩评论