public VectorElement buildClusterElement(MapPos pos, VectorElementVector elements) {
// Try to reuse existing marker styles
MarkerStylEnter code her...
e style = markerStyles.get((int) elements.size());
if (elements.size() == 1) {
if(elements.get(0) instanceof BalloonPopup){
System.out.println("element is of balloon type so returning balloon from here...."); //If idont return heregetting class cast exception
return elements.get(0);
}
style = ((Marker) elements.get(0)).getStyle();
}
if (style == null) {
android.graphics.Bitmap canvasBitmap = markerBitmap.copy(android.graphics.Bitmap.Config.ARGB_8888, true);
android.graphics.Canvas canvas = new android.graphics.Canvas(canvasBitmap);
android.graphics.Paint paint = new android.graphics.Paint(android.graphics.Paint.ANTI_ALIAS_FLAG);
paint.setTextAlign(Align.CENTER);
paint.setTextSize(12);
paint.setColor(android.graphics.Color.argb(255, 0, 0, 0));
canvas.drawText(Integer.toString((int) elements.size()), markerBitmap.getWidth() / 2, markerBitmap.getHeight() / 2 - 5, paint);
MarkerStyleBuilder styleBuilder = new MarkerStyleBuilder();
styleBuilder.setBitmap(BitmapUtils.createBitmapFromAndroidBitmap(canvasBitmap));
styleBuilder.setSize(30);
styleBuilder.setPlacementPriority((int)-elements.size());
style = styleBuilder.buildStyle();
markerStyles.put((int) elements.size(), style);
}
System.out.println("returning marker");
// Create marker for the cluster
Marker marker = new Marker(pos, style);
return marker;
}
--
You received this message because you are subscribed to the Google Groups "Nutiteq-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nutiteq-dev...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--You received this message because you are subscribed to a topic in the Google Groups "Nutiteq-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/nutiteq-dev/wWZ74v7xEYo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to nutiteq-dev...@googlegroups.com.
You received this message because you are subscribed to the Google Groups "Nutiteq-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nutiteq-dev...@googlegroups.com.