dburnett

PictureMarkerSymbol throws IllegalArgumentException

Discussion created by dburnett on Jan 11, 2012
Just started trying to upgrade from the beta. Everything was fairly easy to fix until I went to add a drawable to the map. This is all it will tell me:


01-11 13:49:56.905: E/AndroidRuntime(10514): Caused by: java.lang.IllegalArgumentException: width and height must be > 0
01-11 13:49:56.905: E/AndroidRuntime(10514):  at android.graphics.Bitmap.nativeCreate(Native Method)
01-11 13:49:56.905: E/AndroidRuntime(10514):  at android.graphics.Bitmap.createBitmap(Bitmap.java:477)
01-11 13:49:56.905: E/AndroidRuntime(10514):  at com.esri.core.symbol.PictureMarkerSymbol.toJson(Unknown Source)
01-11 13:49:56.905: E/AndroidRuntime(10514):  at com.esri.android.map.GraphicsLayer.addGraphic(Unknown Source)

I've tried setting the bounds on the drawable but appears that the dimensions it is looking at are not affected by these. Here's code:


PictureMarkerSymbol symbol = new PictureMarkerSymbol(item);
Graphic graphic = new Graphic(pt, symbol);
Layer layer = this.getLayer(overlayName);
  if(layer != null)
  {
   layer.graphics.addGraphic(graphic);

Where "item" is a procedurally drawn class derived from Drawable.

Outcomes