I cannot seem to get a graphic with a spatial reference.
I have a basemap as a tpk. My mapview and Graphics layer have a spatial reference. I have tried many methods two are listed below that I thought should work.
public boolean onSingleTap(final MotionEvent e) {
Geometry geometry = mMapView.toMapPoint(new Point(e.getX(), e.getY()));
Graphic graphic = new Graphic(geometry, pointSymbol);
SpatialReference spatialReference = graphic.getSpatialReference();//=null
}
I've also tried to project it.
public boolean onSingleTap(final MotionEvent e) {
Geometry geometry = mMapView.toMapPoint(new Point(e.getX(), e.getY()));
Geometry RealProj = GeometryEngine.project(geometry, mMapView.getSpatialReference(), mMapView.getSpatialReference());
Graphic graphic = new Graphic(geometry, pointSymbol);
SpatialReference spatialReference = graphic.getSpatialReference();//=null
}
Nothing seems to work. Is there something obvious I am not doing? This has not been an issue until I have started trying to use the FeatureSet.toJson method and realized that my spatial reference was empty.
Thanks in advance for any help.