开发者

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);
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜