Reputation: 2748
Does anyone know how, if possible, to display a popup infoWindow type bubble when a marker is tapped on an ArcGIS MapView in an Android app?
I've managed to create a SimpleMarkerSymbol type marker but I would like to be able to display more information about the marker when the user presses on it, not sure if this is even possible in ArcGIS. Thanks
code for map and marker:
GraphicsLayer graphicsLayer = new GraphicsLayer();
mapView = (MapView) findViewById(R.id.mapView);
mapView.addLayer(graphicsLayer);
SimpleMarkerSymbol simpleMarker = new SimpleMarkerSymbol(Color.RED, 10, SimpleMarkerSymbol.STYLE.CROSS);
Point pointGeometry = new Point(34.056215, -117.195668);
Graphic pointGraphic = new Graphic(pointGeometry, simpleMarker);
graphicsLayer.addGraphic(pointGraphic);
Upvotes: 2
Views: 1786
Reputation: 4932
You have three things you need to accomplish:
OnSingleTapListener
to the MapView
.GraphicsLayer.getGraphicIds(float, float, int, int)
to query the graphics.MapView.getCallout().show(Point, View)
.Check out a really awesome example of an OnSingleTapListener
that does #2 and #3. At least I think it's awesome because I wrote it. ;-)
Upvotes: 5