can anyone tell me how to display local shapefiles in Android with the WhirlyGlobe SDK?
I'm using readFromFile but I get always false. http://mousebird.github.io/WhirlyGlobe/reference/android_2_5/index.html
My Code: string is the path to the folder with the shapefiles
@Override
protected void onPostExecute(String string) {
VectorInfo vectorInfo = new VectorInfo();
vectorInfo.setColor(Color.RED);
vectorInfo.setLineWidth(4.f);
VectorObject object = new VectorObject();
File fileShape = new File(string + "/poly.shp");
String shapefile = "";
if (fileShape .exists()){
shapefile = fileShape.getAbsolutePath();
}
if(object.readFromFile(shapefile)){
controller.addVector(object,vectorInfo,MaplyBaseController.ThreadMode.ThreadAny);
}
//if (object1.fromGeoJSON(shapefile)) {
// controller.addVector(object, vectorInfo, MaplyBaseController.ThreadMode.ThreadAny);
//}
}
The example with GeoJSON works fine. http://mousebird.github.io/WhirlyGlobe/tutorial/android/vector-data.html