1

I'm creating an Android application to display shapefiles. I'm using this code that I found on the Internet:

try {
        ShapefileFeatureTable shapefileFeatureTable = new ShapefileFeatureTable("file:///mnt/sdcard/ShapeFile/LVA_water_lines_dcw.shp");
        FeatureLayer featureLayer = new FeatureLayer(shapefileFeatureTable);
        featureLayer.setRenderer(new SimpleRenderer(new SimpleFillSymbol(
                getResources().getColor(android.R.color.holo_blue_bright),
                SimpleFillSymbol.STYLE.SOLID)));
        map.addLayer(featureLayer);
    } catch (FileNotFoundException ex) {
        //Toast.makeText(this, R.string.shapefile_not_found, Toast.LENGTH_LONG).show();
        ex.printStackTrace();
        return;
    }

But it gives me the error:

ShapefileFeatureTable cannot be converted to FeatureTable
1

I had a wrong import.

import com.esri.arcgisruntime.layers.FeatureLayer;

instead of

import com.esri.android.map.FeatureLayer;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.