Select to view content in your preferred language

How to get graphics from feature layer.

2836
2
04-11-2012 05:42 AM
VirenSavaliya
Emerging Contributor
Hello All,,


I want to get graphics from feature layer when I will tap on any feature.

Previously worked fine in old SDK.


code snipped.

map.setOnSingleTapListener(new OnSingleTapListener() {

   private static final long serialVersionUID = 1L;

   public void onSingleTap(float x, float y) {
    try {
     Point pointClicked = map.toMapPoint(x, y);
     Graphic[] graphic = fLayer.getGraphics(x, y, 10);





But in new SDK how I can get graphics object.

Thanks in advance..
Viren
0 Kudos
2 Replies
SimonKlein
Regular Contributor
Maybe the PopupInWebmapFOrViewing Example can help you
0 Kudos
RainaldSuchan1
Deactivated User
This has changed. Now you first have to get the ids of the graphics:

int[] ids = fLayer.getGraphicIds(x, y, 10);

And than get the graphic by the id:

Graphic graphic = fLayer.getGraphic(ids[0]);
0 Kudos