Hello, I am trying to load shape files containing road files i mean custom made map but i have seen the examples but i can't get picture on exactly how to do e.g //= "http://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapSe

511
2
Jump to solution
03-18-2017 12:13 AM
DenisIsack
New Contributor


// basemap
ArcGISTiledMapServiceLayer tiledLayer = new ArcGISTiledMapServiceLayer(URL_BASEMAP);
//pageLayout = new PageLayoutBean();

map.getLayers().add(tiledLayer);
String documentPath = "";
documentPath = "C:" + File.separator + "Users" + File.separator + "Structure" + File.separator + "Desktop" + File.separator + "isa" + File.separator + "application" + File.separator + "app" + File.separator + "now.mxd";
// if (pageLayout.checkMxFile(documentPath)) {
// pageLayout.loadMxFile(documentPath, null);
// }
// // (Map)pageLayout.getActiveView().getFocusMap();
// map.add(pageLayout);
map.getLayers().add(
new ArcGISLocalFeatureLayer( documentPath, 0,
RenderingMode.STATIC));
// graphics layer for taxi graphics

//Basically i need to load my shape file containing road map like one example moving graphic on custom map with .mxd extension  2012 java developer summit  but i can figure out my way out

I have tried may scenarios but with no luck this is sample map where i want to move my points in java but even given sample source to load this in javacustom map

0 Kudos
1 Solution

Accepted Solutions
EricBader
Occasional Contributor III

Denis,

It looks like your code is trying to directly access an MXD file. ArcGIS Runtime APIs can't read MXDs. 

You can create Map Packages from within ArcMap. ArcMap can open your MXD and package the contents of that document into an .MPK file. That MPK can be opened in your Runtime app using a Local Server instance, as described in this example: 

Local Server feature layer | ArcGIS for Developers 

Or, you can read the shapefile directly (using version 10.2.4, which seems to be what you're using?). Here's an example:

Shapefile feature layer | ArcGIS for Developers 

I hope this is helpful!

View solution in original post

2 Replies
EricBader
Occasional Contributor III

Denis,

It looks like your code is trying to directly access an MXD file. ArcGIS Runtime APIs can't read MXDs. 

You can create Map Packages from within ArcMap. ArcMap can open your MXD and package the contents of that document into an .MPK file. That MPK can be opened in your Runtime app using a Local Server instance, as described in this example: 

Local Server feature layer | ArcGIS for Developers 

Or, you can read the shapefile directly (using version 10.2.4, which seems to be what you're using?). Here's an example:

Shapefile feature layer | ArcGIS for Developers 

I hope this is helpful!

DenisIsack
New Contributor

Thanks it will help me a lot. 

0 Kudos