Hi, can you please provide some additional information just to make sure we are talking about the same thing. This issue may be a duplicate of this on-going post here: http://forums.arcgis.com/threads/51928-Callout-doesn-t-move-with-MapView.centerAt
- Which version of the ArcGIS Runtime SDK for Android are you running?
- Are you using a "web map" or your own tiled map service?
- Can you provide a snippet of code?
-Andy
Hi Andy, first of all thanks for the reply.The duplicate post you shared is little different from the my posting.Here i am able to show the call out but while zooming in/out the call out does't position itself with respect to the pin.it stays at the same position.- I am using 10.2 version SDK of Arcgis.- I am using tiled map service(i guess) as i use new ArcGISTiledMapServiceLayer(URL) for showing a map.- below is the code snippet for showing a callout on tapping of the pin./***
* Shows popup call out on the map pin
*
* @param x
* @param y
*/
private void showCallout(float x, float y) {
int[] uids = mGraphicLayer.getGraphicIDs(x, y, 2);
if (uids != null && uids.length > 0) {
int targetId = uids[0];
Graphic gr = mGraphicLayer.getGraphic(targetId);
mapPinCallout = mArcGisMapView.getCallout();
if (gr != null) {
isSingleTap = true;
String[] content = null;
String[] keys = gr.getAttributeNames();
if (((String) gr.getAttributeValue(keys[0])).contains("-")) {
content = ((String) gr.getAttributeValue(keys[0])).split("-");
} else if (((String) gr.getAttributeValue(keys[0])).contains(",")) {
content = ((String) gr.getAttributeValue(keys[0])).split(",");
y = (float) (Double.parseDouble(keys[0]) - (symbolHt / 2));
}
// Sets Callout style
// mapPinCallout.setStyle(R.xml.countypop);
if (content != null) {
// Sets custom content view to Callout
if (content.length > 1) {
mapPinCallout.show(mArcGisMapView.toScreenPoint(new Point(x, y)), loadView(content[0], content[1]));
} else {
// mapPinCallout.setContent(loadView(content[0], ""));
mapPinCallout.show(mArcGisMapView.toMapPoint(new Point(x, y)), loadView(content[0], ""));
}
}
calloutPoint = mArcGisMapView.toMapPoint(new Point(x, y));
mapPinCallout.setCoordinates(calloutPoint);
mapPinCallout.refresh();
} else {
hideCallout();
}
} else {
hideCallout();
}
}
county.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<calloutViewStyle
titleTextColor="#ffffff"
titleTextSize="20"
titleTextStyle="1"
titleTextTypeface="serif"
backgroundColor="#ffffff"
backgroundAlpha="255"
frameColor="#ffffff"
cornerCurve="10"
anchor="5" />
</resources>