You should not need to manage the movement of the callout once it is set the coordinates with the show() method. Try removing the Callout.setCoordinates() and Callout.refresh() methods. Refer to the SymbolizingResults sample to see how the Callout holds on the initial position.
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
/*** * 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(); } }
<?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>
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.