private MapView osm; osm = (MapView) findViewById(R.id.mapView); public void addMarker() { GeoPoint colombo = new GeoPoint(6.9271, 79.8612); Marker startMarker = new Marker(osm); startMarker.setPosition(colombo); osm.getOverlays().add(startMarker); startMarker.setIcon(getResources().getDrawable(R.drawable.black)); }
startMarker.setTitle("title") 应该做这项工作。。。您可以通过调用 showInfoWindow() 方法。
startMarker.setTitle("title")
showInfoWindow()
如果您想拥有自己的弹出式菜单布局,可以将其子类化 InfoWindow .
InfoWindow