POST
|
Thanks for the quick reply. Add marker on graphic layer and the simple straight forward document I already referred but the problem is lots of methods are not available in new library. even alternate method is not mentioned anywhere in document. So if you are aware about how to update the existing marker position which already drawn on map.
... View more
09-29-2020
02:40 AM
|
0
|
1
|
816
|
POST
|
We have migrated ArcGis library from 10x to 100.9.0. In our app we have the functionality of change mock location using long press. Below is the code snippet of 10x which is working fine. Graphic graphic = mGraphicsLayer.getGraphic(marker); if (graphic != null) { Point point = LocationUtils.convertToMapPoint(position, getSpatialReference()); final Point geometry = (Point) graphic.getGeometry(); geometry.setXY(point.getX(), point.getY()); mGraphicsLayer.updateGraphic(marker, geometry); mGraphicsLayer.bringToFront(marker); } After Migration we does not found any method like update graphic and change location of marker which is already drawn on Graphic layer. We have more than 1000 marker on Map so also not feasible to clear and redraw all again. I tried so much but there are no such documentation help. So we are stuck now. Please help and provide code snippet to migrate above code with new library.
... View more
09-29-2020
12:05 AM
|
0
|
3
|
873
|
POST
|
Hi Thanks for the reply. Can you please help me to draw circle with dynamic radius. I have my current lat/long which is centre point and through that centre point i need to draw circle for that I need to calculate x and y coordinates. I have used below equation to calculate x and y double rad = 2 * Math.PI / pointCount * i;
double x = Math.cos(rad) * radius + center.getX();
double y = Math.sin(rad) * radius + center.getY(); after that convert x,y to the map location using mapToLocation method, it will return me object of Point which I am adding into PointCollection object. Please suggest me what I did wrong.
... View more
09-09-2020
02:37 AM
|
0
|
0
|
1285
|
POST
|
In example it shows the conversion from touch event to map location, that is working fine and we have no question on that. The problem which we are facing in below method public static Point convertToMapPoint(double longitude, double latitude,
SpatialReference mapReference) {
Point wgsPoint = new Point(longitude, latitude);
return (Point) GeometryEngine.project(wgsPoint,mapReference);
}
For example if we have location value "-102.29872652008582, 21.879840237531294" then with help of above method I need to convert location to mapView point which is near to [-1.1387842145016305E7, 2497104.718795404] as value. Could you please suggest what we can do in that case
... View more
09-08-2020
06:37 AM
|
0
|
0
|
1285
|
POST
|
We had developer an application in past which had integrated old Arc gis core Android library. Now we have migrated from 10x to 100.9.0 Runtime library. And we have observed many functionality is not working due to method changed. Most of the functionality we had fixed but we are stuck at 2 functionality which is like draw circle with user centre location. Please see my below code which I have used to draw circle. Actually we are able to get the circle on map but it is not with the centre point which I have used. I have passed my location as param you can see in below method, the first one param. private Graphic getCircleForMapReference(LatLng position, double radius, SpatialReference mapReference, MapView mapView) {
int pointCount = 360;
if (radius > 0)
{
Application application = ApplicationUtil.getInstance().getApplicationInstance();
int color = application.getResources().getColor(com.cityshob.responder.R.color.investigationCircleOrange);
Point center = LocationUtils.convertToMapPoint(position, mapReference);
SimpleLineSymbol lineSymbol = new SimpleLineSymbol(SimpleLineSymbol.Style.SOLID,color, 7);
PointCollection pointCollection = new PointCollection(SpatialReferences.getWgs84());
for (int i = 0; i <= pointCount; i++)
{
double rad = 2 * Math.PI / pointCount * i;
double x = Math.cos(rad) * radius + center.getX();
double y = Math.sin(rad) * radius + center.getY();
android.graphics.Point screenPoint = new android.graphics.Point((int) Math.round(x),(int) Math.round(y));
Point mapPoint = mapView.screenToLocation(screenPoint);
Point wgs84Point = (Point) GeometryEngine.project(mapPoint, SpatialReferences.getWgs84());
pointCollection.add(wgs84Point.getX(),wgs84Point.getY());
}
Polyline lineGeometry = new Polyline(pointCollection);
Graphic lineGraphic = new Graphic(lineGeometry, lineSymbol);
return lineGraphic;
}
return null;
}
Second issue which I am facing is to clear that circle. I used below line of code to clear but it is not working.
mGraphicsLayer.getGraphics().remove(circle)
where
mGraphicsLayer is the object of GraphicOverlay
circle is the index where I have added object. we are stuck on above 2 points, Please help us as soon as possible. Please let us know what we had implemented wrong.
... View more
09-08-2020
03:30 AM
|
0
|
3
|
1378
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|