title: How do I post multiple markers from a JSON array on google maps
body: <p>I have an android app that takes an array from a website </p>
  
  <p>{"d":[{"latitude":-1.0,"longitude":-1.0,"time":"07:14 PM    01/18/2038","most_recent":"1","user_id":"4e3f2c6659f25a0f8400000b"},{"latitude":-1.0,"longitude":-1.0,"time":"07:14 PM 01/18/2038","most_recent":"0","user_id":"4e3f2c6659f25a0f8400000b"},{"latitude":-1.0,"longitude":-1.0,"time":"07:14 PM 01/18/2038","most_recent":"0","user_id":"4e3f2c6659f25a0f8400000b"},{"latitude":34.0608,"longitude":-118.454,"time":"07:14 PM 01/18/2038","most_recent":"1","user_id":"4e3da65e59f25a3956000005"},{"latitude":34.0608,"longitude":-118.454,"time":"07:14 PM 01/18/2038","most_recent":"0","user_id":"4e3da65e59f25a3956000005"},{"latitude":34.0608,"longitude":-118.454,"time":"07:14 PM 01/18/2038","most_recent":"0","user_id":"4e3da65e59f25a3956000005"}]}</p>
  
  <p>as you can see each item has a latitude and longitude component as well as an id.</p>
  
  <p>How do I modify this program to show either a green pin <code>R.drawable.greenpin</code> or a blue pin <code>R.drawable.bluepin</code> for "user_id":"4e3f2c6659f25a0f8400000b" or "user_id":"4e3da65e59f25a3956000005" for each of the items in the array ( should be three blue pins and three green pins at these locations)</p>
  
  <pre><code>public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when)
  { 
  super.draw(canvas,mapView,shadow);
  Point screenPts=new Point();
  mapView.getProjection().toPixels(p,screenPts);
  Bitmap bmp=BitmapFactory.decodeResource(getResources(),R.drawable.greenpin);
  canvas.drawBitmap(bmp,screenPts.x,screenPts.y-50,null);
  return true;
  }
  }
  
  //to add the location marker
  MapOverlay mapOverlay=new MapOverlay();
  List&lt;Overlay&gt; listOfOVerlays=mapView.getOverlays();
  listOfOverlays.clear();
  listOfOverlays.add(mapOverlay);
  </code></pre>
  
  <p>The method that I have confuses me a bit because it draws the point based on the screen point. I would rather add these points by inserting the pins by the longitude and latitude of the arrays.</p>