android - Adding an overlay to the camera view rather than the map view -


I am trying to add a 'target' which will be represented as a circle that is always made in the center of the present lives. map view. Looking for API I look a lot about adding markers, shapes, ground overlays and tile overlays, but no one seems friendly to my needs.

Actually they are used to attract all elements on the 'map'. Specified location I need some type of overlay for the actual camera view would be a good example when the camera lens See where a circle represents the center of the frame.

You can use a relative layout, which includes mappings and additional custom views:

  & lt; Relative layout xmlns: android = "http://schemas.android.com/apk/res/Android" Android: layout_width = "match_perrent" Android: layout_heat = "match_perrent" & gt; & Lt; Fragment android: id = "@ + id / map" class = "com.google.android.gms.maps.SupportMapFragment" Android: layout_width = "match_parent" Android: layout_height = "match_parent" /> & Lt; mypackage.MyCustomView Android: Android: id = "@ + ID / Map Overlay" Android: layout_width = "match_parent" Android: layout_height = "match_parent" Android: background = "@ Android: Color / transparent" /> & Lt; / RelativeLayout & gt;   

Whatever attracts you in custom view, e.g. A circle in the center is drawn to the top of the map, and to stay there, the map will be independent of the movement.

If you want to customize the size of the zoom, tilt, etc. then listen to the camera changes and customize the drawing accordingly. Unfortunately, the camera changer listener is called only after the change. So you can not immediately follow the zoom or tilt signal with your drawing.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -