title: Add location marker in addition to custom tile overlays android
body: <p>I am overlaying custom radar weather tiles on top of Google Maps.  I'd also like to add a location pin marker in accordance with city the user is viewing weather from.  I can't figure out how to have the tiles AND a marker.  I can do one or the other, but not both....any help? </p>
  
  <p>I have a MapsItemizedOverlay class:</p>
  
  <pre><code>&lt;pre&gt;&lt;code&gt;public class MapsItemizedOverlay extends ItemizedOverlay&lt;OverlayItem&gt; {
  
  private static final String DEBUG_TAG = "TurboWeather/MapsItemizedOverlay";
  
  private ArrayList&lt;OverlayItem&gt; myOverlays = new ArrayList&lt;OverlayItem&gt;();
  //private ArrayList&lt;Drawable&gt; mDrawables = new ArrayList&lt;Drawable&gt;();
  //private ArrayList&lt;GeoPoints&gt; mGeoPoints = new ArrayList&lt;GeoPoints&gt;();
  
  public MapsItemizedOverlay(Drawable defaultMarkers, Context context) {
      super(boundCenterBottom(defaultMarkers));
      //Log.i(DEBUG_TAG, "MapsItemizedOverlay constructor");
      populate();
  }
  
  public void addOverlay(OverlayItem overlay){
      //Log.i(DEBUG_TAG, "addOverlay");
      myOverlays.add(overlay);
      populate();
  }
  
  @Override
  protected OverlayItem createItem(int i) {
      //Log.i(DEBUG_TAG, "createItem");
      return myOverlays.get(i);
  }
  
  // Returns present number of items in list
  @Override
  public int size() {
      return myOverlays.size();
  }
  
  @Override
  public void draw(Canvas canvas, MapView mapview, boolean shadow) {
      super.draw(canvas, mapview, false);
  }
  </code></pre>
  
  <p>}
  </p>
  
  <p>And here is where I utilize the MapsItemizedOverlay class and am able to draw the custom radar image tiles to Google Maps:</p>
  
  <pre><code>
  private void addOverlay(Drawable drawable, int xTile, int yTile) {
          OverlayItem overlayitem, locationOverlayitem;
          GeoPoint geopoint, locGeopoint;
  
          int x1 = 0, y1 = 0;
          double lat[] = {0.0};
          double lon[] = {0.0};
          int x[] = {0};
          int y[] = {0};
          mCurrentProjection.fromPixels(x1, y1);
          mMapOverlays = mMapView.getOverlays();
          x = new int[] {xTile};
          y = new int[] {yTile};
          TileSystem.TileXYToPixelXY(xTile, yTile, x, y);
          TileSystem.PixelXYToLatLong(x, y, mZoomLevel, lat, lon);
          Log.i(DEBUG_TAG, "X: " + x[0] + " Y: " + y[0]);
          //Log.i(DEBUG_TAG, "GeoPointX is " + lat[0] + ", GeoPointY is " + lon[0]);
          geopoint = new GeoPoint((int)(lat[0] * 1E6), (int)(lon[0] * 1E6));
          if (mMapOverlays.size() == 0) {
              mItemizedOverlay = new MapsItemizedOverlay(drawable, mContext) {
                  public boolean onTouchEvent(MotionEvent event, com.google.android.maps.MapView mv) {
                      switch (event.getAction()) {
                      case MotionEvent.ACTION_UP:
                          post(new Runnable() {
                              @Override
                              public void run() {
                                  mMapView.getOverlays().clear();
                                  getAccuWxTiles(mMapVars);
                              }
                          });
                          break;
                      }
                      return false;
                  }
              };
          } else {
              mItemizedOverlay = new MapsItemizedOverlay(drawable, mContext);
          }
          overlayitem  = new OverlayItem(geopoint, "", "");
  
          mItemizedOverlay.addOverlay(overlayitem);
          mMapOverlays.add(mItemizedOverlay); 
          mMapView.invalidate();
      }
  </code></pre>