HAL9000
HAL9000

Reputation: 3761

Draw on Google Maps API Android

Is it possible to draw over the map as it was a canvas? Or even better, is it possible to put a transparent layer over a Google Map and dinamically paint over it?

Upvotes: 0

Views: 634

Answers (2)

WSS
WSS

Reputation: 513

If you want it by only coding then just create a view do drawing in its onDraw() method this method was for static drawing.For dynamic drawing use SurfaceView.After that add (View if static SurfaceView if dynamic) in oncreate() method.as-

           addContentView(new View(this),new LayoutParams (LayoutParams.WRAP_CONTENT,
           LayoutParams.WRAP_CONTENT));//edit parameters according to you

Upvotes: 1

MaciejGórski
MaciejGórski

Reputation: 22232

You can put any View on top of another View like here:

<FrameLayout>
  <fragment class="SupportMapFragment" />
  <CustomView />
</FrameLayout>

and override onDraw to paint what you like.

Upvotes: 1

Related Questions