Hi, Everyone : is there any clicklistener for marker in ArcGis runtime sdk for android,
Solved! Go to Solution.
Thanks for your help, i succeed to do it, using this code :
public void markerClick() {
mvHelper.setOnGraphicClickListener(new OnGraphicClickListener() {
@Override
public void onGraphicClick(Graphic graphic) {
double gX, gY;
mvHelper.setShowGraphicCallout(false);
gX = ((Point)graphic.getGeometry()).getX();
gY = ((Point)graphic.getGeometry()).getY();
Point p = new Point(gX, gY);
Point newPoint =
(Point) GeometryEngine.project(p,
arcMap.getSpatialReference(), SpatialReference.create(4326));
Toast.makeText(ctx, String.valueOf(newPoint.getX()) + " "
+ String.valueOf(newPoint.getY()), Toast.LENGTH_LONG).show();
}
});
}
2016-07-28 17:43 GMT+01:00 Alexander Nohe <geonet@esri.com>:
GeoNet <https://community.esri.com/?et=watches.email.thread>
Marker onClickListener
reply from Alexander Nohe
<https://community.esri.com/people/ANohe-esristaff?et=watches.email.thread>
in ArcGIS Runtime SDK for Android - View the full discussion
<https://community.esri.com/message/624384?et=watches.email.thread#comment-624384>
I do not believe that there is a listener for this class (MarkerSymbol | ArcGIS Android 10.2.8 API ).
Instead, I would implement an OnSingleTapListener on the map object and check if there are any markers there using a query. If there are, then handle the OnSingleTap as you wish. ( SingleTapListener )
Is there something special you wanted to do with selecting marker symbols when clicking on the MapView?
Thanks for the feedback, i don't how can i check if there are any markers
there using a query, i wish that u can send me an example of code which
could help me
2016-07-26 15:56 GMT+01:00 Alexander Nohe <geonet@esri.com>:
GeoNet <https://community.esri.com/?et=watches.email.thread>
Marker onClickListener
reply from Alexander Nohe
<https://community.esri.com/people/ANohe-esristaff?et=watches.email.thread>
in ArcGIS Runtime SDK for Android - View the full discussion
<https://community.esri.com/message/623545?et=watches.email.thread#comment-623545>
You would query against whatever geometry is showing the marker. This is generally a feature service layer or graphics layer. Do you know what is supporting the underlying geometry of the marker symbol?
Not really, I m using arcGis for the first time, so it s quite difficult to
use it even after reading the api
Le 27 juil. 2016 18:26, "Alexander Nohe" <geonet@esri.com> a écrit :
GeoNet <https://community.esri.com/?et=watches.email.thread>
Marker onClickListener
reply from Alexander Nohe
<https://community.esri.com/people/ANohe-esristaff?et=watches.email.thread>
in ArcGIS Runtime SDK for Android - View the full discussion
<https://community.esri.com/message/623979?et=watches.email.thread#comment-623979>
Hello Mohamed EzzerI,
How are you creating the markers?
This should give us some insight in to how best to assist you in querying for their values.
i have a JSON and i parse it to create my markers
Le 28 juil. 2016 13:11, "Alexander Nohe" <geonet@esri.com> a écrit :
GeoNet <https://community.esri.com/?et=notification.mention>
You have been mentioned
by Alexander Nohe
<https://community.esri.com/people/ANohe-esristaff?et=notification.mention> *in
Re: Marker onClickListener in GeoNet* - View Alexander Nohe's reference
to you
<https://community.esri.com/message/624281?et=notification.mention#comment-624281>
Can you upload the smallest reproducible test case that you have? I may gain better insight if I can see what exactly you are doing.
Thank you!
Thanks for your help, i succeed to do it, using this code :
public void markerClick() {
mvHelper.setOnGraphicClickListener(new OnGraphicClickListener() {
@Override
public void onGraphicClick(Graphic graphic) {
double gX, gY;
mvHelper.setShowGraphicCallout(false);
gX = ((Point)graphic.getGeometry()).getX();
gY = ((Point)graphic.getGeometry()).getY();
Point p = new Point(gX, gY);
Point newPoint =
(Point) GeometryEngine.project(p,
arcMap.getSpatialReference(), SpatialReference.create(4326));
Toast.makeText(ctx, String.valueOf(newPoint.getX()) + " "
+ String.valueOf(newPoint.getY()), Toast.LENGTH_LONG).show();
}
});
}
2016-07-28 17:43 GMT+01:00 Alexander Nohe <geonet@esri.com>:
GeoNet <https://community.esri.com/?et=watches.email.thread>
Marker onClickListener
reply from Alexander Nohe
<https://community.esri.com/people/ANohe-esristaff?et=watches.email.thread>
in ArcGIS Runtime SDK for Android - View the full discussion
<https://community.esri.com/message/624384?et=watches.email.thread#comment-624384>
Do you still require assistance with this or did this code resolve the issue for you?