Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>More details on what you're trying to do would help to answer this question correctly. What methods have you tried already?</p> <ol> <li>Are you trying to just draw static images overlaid each other in a view?</li> <li>Are you trying to draw an actual geographic map with a <code>MapView</code> or something along those lines?</li> </ol> <p>If you're trying to draw an image over another, you can do it in a number of ways.</p> <ul> <li>You could use a <code>RelativeLayout</code> to assign absolute positions your overlay images (most likely each in the form of an <code>ImageView</code>). Here's a good SO answer that covers assigning absolute positions to children in an RelativeLayout: <a href="https://stackoverflow.com/questions/3294590/set-the-absolute-position-of-a-view-in-android">Set the absolute position of a view</a></li> <li>You could load the base image (your map) and the overlays into <code>Bitmap</code> objects. Then, using a <code>Canvas</code> object you could draw them in specified locations. Look at the various <code>Canvas.drawBitmap()</code> functions to see your options on specifying the position of the <code>Bitmap</code> you are drawing. You could also draw shapes instead of images using the <code>drawRect()</code>, <code>drawRoundRect()</code>, <code>drawLine()</code>, or <code>drawOval()</code> methods. There are other options as well. Read the <a href="http://developer.android.com/reference/android/graphics/Canvas.html" rel="nofollow noreferrer"><code>Canvas</code> documentation</a>.</li> </ul> <p>Otherwise, if you're trying to draw a movable map of some sort, then you'll need to use a <code>MapView</code> or <code>MapActivity</code>. There are classes that you use to overlay images in specified locations on the map. This won't be a static image, but a movable map along with the overlays that stay in the specified location. You'll use the <code>ItemizedOverlay</code> class to act as a data structure to store your actual overlay images (wrapped in the <code>OverlayItem</code> class). </p> <p>This is a great tutorial that goes into depth about what I'm talking about: <a href="http://developer.android.com/guide/tutorials/views/hello-mapview.html" rel="nofollow noreferrer">http://developer.android.com/guide/tutorials/views/hello-mapview.html</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload