I am new in the arcgis runtime. I am trying to develop an android application.
Steps that i follwed
- Created an account in arcgis.com .
- Then i created one Feature Layer (hosted) from the shape files zip .
- Then i share this to everyone.
- I copied the url given at the below. url is . Please see the output for the url.
- Then i try to implemet means to show this in the map on my android application And trying to do some feature-layer-query.Refference is in the GITHUB
- I am trying to replace the service_url to my url. I am doing the search operation and getting the result from the online then trying to zoom that extent. But is noe even showing my map too.
- Now i am getting problem. it showing the error in
05-10 16:31:23.516 20030-20030/com.esri.arcgisruntime.samples.featurelayerquery E/Feature layer query: Feature search failed for: kulathoor. Error=com.esri.arcgisruntime.ArcGISRuntimeException: Invalid JSON
Please see the below image for ref
My code try
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// inflate MapView from layout
mMapView = (MapView) findViewById(R.id.mapView);
// create a map with the topographic basemap
final ArcGISMap map = new ArcGISMap(Basemap.createTopographic());
// set the map to be displayed in the mapview
mMapView.setMap(map);
// create feature layer with its service feature table
// create the service feature table
//mServiceFeatureTable = new ServiceFeatureTable(getResources().getString(R.string.sample_service_url));
mServiceFeatureTable = new ServiceFeatureTable("https://services7.arcgis.com/7FyZZrSIYfiWYztL/arcgis/rest/services/MyGisFileLayerTest/MapServer");
// create the feature layer using the service feature table
mFeaturelayer = new FeatureLayer(mServiceFeatureTable);
mFeaturelayer.setOpacity(1.0f);
//override the renderer
SimpleLineSymbol lineSymbol= new SimpleLineSymbol(SimpleLineSymbol.Style.SOLID, Color.RED, 1);
SimpleFillSymbol fillSymbol = new SimpleFillSymbol(SimpleFillSymbol.Style.SOLID, Color.YELLOW, lineSymbol);
mFeaturelayer.setRenderer(new SimpleRenderer(fillSymbol));
// add the layer to the map
map.getOperationalLayers().add(mFeaturelayer);
// zoom to a view point of the USA
mMapView.setViewpointCenterAsync(new Point(-11000000, 5000000, SpatialReferences.getWebMercator()), 100000000);
}
Can you find out where i am doing mistake . Why the may is not shwing in my app. Below is the screen shot of my application.