- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在尝试使用 ArcGis android sdk 开发离线 map 应用程序。按照 ArcGis 网站上的教程进行操作。由于它是一个离线 map 应用程序,因此我在没有互联网连接的情况下对其进行测试。但是,当我运行应用程序时,MapView
是空白的。它只是显示黑屏。当我检查 Logcat 时,它说
11-26 14:39:57.757 28520-28520/com.example.lalprakash.offlinearcgismap D/GLSurfaceView: checkGLSurfaceViewlLogProperty get invalid command
11-26 14:39:57.839 28520-28548/com.example.lalprakash.offlinearcgismap I/System.out: httpget:http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer?f=json
11-26 14:39:57.840 28520-28548/com.example.lalprakash.offlinearcgismap I/System.out: http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer?f=json
11-26 14:39:57.846 28520-28548/com.example.lalprakash.offlinearcgismap I/System.out: [CDS][DNS]Unable to resolve host "server.arcgisonline.com": No address associated with hostname
11-26 14:39:57.846 28520-28548/com.example.lalprakash.offlinearcgismap E/ArcGIS: url =http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer
11-26 14:39:57.884 28520-28520/com.example.lalprakash.offlinearcgismap V/PhoneWindow: DecorView setVisiblity: visibility = 4 ,Parent =null, this =com.android.internal.policy.impl.PhoneWindow$DecorView{41ce4470 I.E..... R.....ID 0,0-0,0}
11-26 14:39:57.891 28520-28520/com.example.lalprakash.offlinearcgismap V/PhoneWindow: DecorView setVisiblity: visibility = 0 ,Parent =ViewRoot{41d35928 com.example.lalprakash.offlinearcgismap/com.example.lalprakash.offlinearcgismap.MainActivity,ident = 0}, this =com.android.internal.policy.impl.PhoneWindow$DecorView{41ce4470 V.E..... R.....ID 0,0-0,0}
我无法理解从哪里发出对 server.arcgisonline.com
的请求。我的java文件和xml文件如下
MainActivity.java
public class MainActivity extends Activity {
MapView mMapView;
String extern = Environment.getExternalStorageDirectory().getPath();
final String tpkPath = "/ArcGIS/samples/OfflineRouting/ImageryTPK.tpk";
TiledLayer mTileLayer;
GraphicsLayer mGraphicsLayer = new GraphicsLayer(GraphicsLayer.RenderingMode.DYNAMIC);
RouteTask mRouteTask = null;
NAFeaturesAsFeature mStops = new NAFeaturesAsFeature();
Locator mLocator = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mTileLayer = new ArcGISLocalTiledLayer(extern + tpkPath);
// Retrieve the map and initial extent from XML layout
mMapView = (MapView) findViewById(R.id.map);
// Set the tiled map service layer and add a graphics layer
mMapView.addLayer(mTileLayer);
mMapView.addLayer(mGraphicsLayer);
}
}
activity_main.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.esri.android.map.MapView
android:id="@+id/map"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
initExtent = "-1.3296373526814876E7 3930962.41823043 -1.2807176545789773E7 4201243.7502468005"
mapoptions.MapType="Topo"
mapoptions.ZoomLevel="16" />
</RelativeLayout>
build.gradle如下
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.example.lalprakash.offlinearcgismap"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
sourceSets.main{
jniLibs.srcDir 'src/main/jni'
jni.srcDirs=[]
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile files('libs/arcgis-android-api.jar')
compile files('libs/arcgis-android-app-toolkit.jar')
compile files('libs/jackson-all-1.9.0.jar')
}
此外,我已将 tpk
文件放在内存的根目录中。请帮助我,因为我非常需要它。谢谢。
最佳答案
你能从你的 XML 中删除 initextent 和 mapoption.maptype 并告诉我发生了什么吗?我还没有机会查看你的堆栈跟踪,但这应该会在你的屏幕上显示你的 map
关于android - 使用 ArcGIS android SDK 的离线 map ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33934594/
我有两个 shapefile。一种是有交通量数据的街道 map ,另一种是没有交通量的详细街道 map (精确 map )。 当我将带有交通量数据的街道 map 与没有交通量的详细街道 map 进行比
关闭。这个问题是off-topic .它目前不接受答案。 想改善这个问题吗? Update the question所以它是 on-topic对于堆栈溢出。 9年前关闭。 Improve this q
我注意到 Arc Gis map 渲染速度非常慢。当你缩放时,它呈现得很慢。当您平移时,它呈现缓慢。有没有人有任何关于使 map 呈现速度更快的建议,类似于谷歌地图和微软虚拟地球。 最佳答案 动态 m
我有几个带有大约 100-150 个特征的压缩 shapefile。我正在尝试将它们添加到 ArcGIS Online(每个 shapefile 接受少于 1000 个要素)但无法这样做,这表明压缩的
我正在尝试使用 react-arcgis npm 向 arcgis 添加一个图层, esriPromise(["esri/layers/TileLayer"]).then(([ TileLayer ]
我正在使用 javascript 在 web map 上显示要素图层的标签和要素。要素图层成功在 arcgis 工具中显示标签,而不是在 web map 上显示标签。 谁能帮我解决这个问题吗?我正在尝
我有从驻留在目录托管服务器中的 ArcGIS 生成的形状文件列表,请注意该服务器不是 ArcGIS 服务器并且形状文件未发布。 是否可以使用 ArcGIS JS API 将此形状文件作为图层(要素图层
去年的某个时候,当我们使用 ArcGIS 9.3 时,我在 Visual Studio 2008 中编写了一个 C# 程序来遍历文件夹中的所有 MXD 文件,检查所有图层源,如果错误或不正确则替换它们
是否可以指定 ESRI basemap 图库 (esri/dijit/BasemapGallery) 使用哪些 ArcGIS basemap ? 将 showArcGISBasemaps 设置为 tr
我是 Eclipse 的新手。我打算创建一个 ArcGIS Android 应用程序,但目前我正在逐步学习它。我有一个问题,“ArcGIS Runtime SDK for Android”和“ArcG
如何在启用混淆器的情况下使用 com.esri.arcgis.android:arcgis-android:10.2.6-2?我在努力 -keep class com.esri.** { *; } -
我遵循this guide将ArcGIS map 添加到我的应用程序中,但是没有用。我收到以下错误: Error: Failed to resolve: com.esri.arcgis.android
我正在尝试开发我自己的 map 服务,然后将我生成的图像显示到 ARCGIS map 查看器中......无论如何,我的 *.ashx 服务读取 ARCGIS Tile URL 看起来像“http:/
我在一个多边形 shapefile 中有一个不规则的三角形网格。这些单元格的主题是仅显示高于我的“兴趣”阈值水平的三角形。可见的相邻三角形被认为是真实的。需要删除空间隔离的三角形,因为它们可能是虚假的
我被困住了,试图使用 ArcGIS 绘制一个简单的圆形缓冲区。以下是我设置 basemap 的方法: dojo.require("esri.map"); dojo.require("esri.task
我正在使用 JavaScript 编写一个程序,该程序通过 ArcGIS REST API 连接到本地 ArcGIS 服务器并加载 map 。 获取服务的 URL 是 let xmlhttp = ne
我想开发 Arcgis for android 和 web 服务,但我不知道它有 API 吗?如果有,是否可以在我服务器上收集的经纬度 map 上进行标记(如谷歌地图 API)? 谢谢卡:)) 最佳答
我刚刚偶然发现了 Backgroundworker 对象,它似乎是我正在寻找的工具,可以让我的 GUI 在执行计算时做出响应。我正在为 ArcGIS 编写 IO 插件。 我正在 ArcGIS 之外进行
我正在尝试使用 ArcGIS JavaScript API在 Angular 应用程序中。如我所见,它使用 Dojo。所以,我正在尝试从 Angular 指令初始化 ArcGIS,如下所示: li
在 Microsoft SQL 中,我可以使用 GETDATE() 函数作为 DATETIME 字段的默认值。我希望能够对 ArcGIS 地理数据库中的日期字段执行相同类型的操作。这可能吗,还是我仅限
我是一名优秀的程序员,十分优秀!