Follow the official demo after deployment. Add a cover.
Required classes:
The Bitmapdescriptor bitmap Image object is used to display the area of the overlay.
Mapview the primary object has a control instantiation on the page.
Baidumap has Mapview.getmap (); Map object. You can add a variety of things to the map.
Mapstatusupdate describes the changes that will occur in the map state.
LATLNG geographic coordinates the basic data structure is instantiated directly by latitude longitude.
Overlayoptions overlay Configuration object. Can be the overlay icon, location and so on.
Main methods:
Overlay icon Bitmapdescriptor BdA = Bitmapdescriptorfactory.fromresource (R.drawable.weizhi);
The geographical location of the coverings latlng LlA = new Latlng (39.963175, 116.400244);
Overlay Configuration Object Overlayoptions OoA new Markeroptions (). Position (LlA). Icon (BdA). ZIndex (9)
Covering Object Mmarkera = (Marker) (Mbaidumap.addoverlay (OoA));
Baidu Map Add Overlay