Hi,
I am building an offline (permanently disconnected system) application. I need to load a combination of raster and shapefiles as different layers. Is there a sample program available to demonstrate this in 100.9 or above.
Is it also possible to load and display it without the base map?
thanks in advance
Giridhar
TileCache tileCache = new TileCache("\local_server\mpk_blank.mpk");
ArcGISTiledLayer tiledLayer = new ArcGISTiledLayer(tileCache);
Basemap basemap = new Basemap(tiledLayer);
// ArcGISMap map = new ArcGISMap(Basemap.createStreetsVector());
ArcGISMap map = new ArcGISMap(basemap);
mapView = new MapView();
mapView.setMap(map);
// create a shapefile feature table from the local file
File shapefile = new File(System.getProperty("data.dir"), "\san_diego_boundary_datasd.shp");
ShapefileFeatureTable shapefileFeatureTable = new ShapefileFeatureTable(shapefile.getAbsolutePath());
// use the shapefile feature table to create a feature layer
featureLayer = new FeatureLayer(shapefileFeatureTable);
featureLayer.addDoneLoadingListener(() -> {
if (featureLayer.getLoadStatus() == LoadStatus.LOADED) {
Alert alert = new Alert(Alert.AlertType.INFORMATION, "loaded success...");
alert.show();
} else {
Alert alert = new Alert(Alert.AlertType.ERROR, featureLayer.getLoadError().getMessage());
alert.show();
}
});
// add the feature layer to the map
map.getOperationalLayers().add(featureLayer);
//add the map view to the stack pane
stackPane.getChildren().add(mapView);