【ArcGIS Android 10.2.9】5. WMSLayer图层的使用

1. 活动

package aystudio.nopi.myarcgisapp;import android.app.Activity;import android.os.Bundle;import com.esri.android.map.MapView;import com.esri.android.map.ogc.WMSLayer;public class MainActivity extends Activity {    private MapView mapView;    private WMSLayer wmsLayer;    private String wmsURL;    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.activity_main);        mapView = findViewById(R.id.map);        wmsURL = "http://wms.openweathermap.org/service";        wmsLayer = new WMSLayer(wmsURL);        wmsLayer.setImageFormat("image/png");        String[] visibleLayers = {"clouds", "precipitation"};        wmsLayer.setVisibleLayer(visibleLayers);        wmsLayer.setOpacity(0.5f);        mapView.addLayer(wmsLayer);        mapView.setEsriLogoVisible(true);        mapView.enableWrapAround(true);    }}

2. 布局

<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    xmlns:tools="http://schemas.android.com/tools"    android:layout_width="match_parent"    android:layout_height="match_parent"    tools:context=".MainActivity">    <com.esri.android.map.MapView        android:id="@+id/map"        android:layout_width="match_parent"        android:layout_height="match_parent"        mapoptions.MapType="Topo"        mapoptions.center="39.50, -98.35"        mapoptions.ZoomLevel="4">    com.esri.android.map.MapView>LinearLayout>

3. 效果

更多相关文章

  1. Android(安卓)中使用 ComponentName 类
  2. Android常用代码
  3. Android(安卓)顶部悬停
  4. android 页面切换动画效果 转
  5. Android文件夹大小
  6. Android使用自带JSONObject解析JSON数据
  7. 箭头函数的基础使用
  8. NPM 和webpack 的基础使用
  9. Python list sort方法的具体使用

随机推荐

  1. android接收和发送短信
  2. android学习笔记之一
  3. Android(安卓)客户端性能优化(魅族资深工
  4. Android本地广播相关操作分析
  5. 修改AVD存放位置
  6. Android系统开发01—Android基本组件
  7. 《Android Studio日志工具Log》
  8. “Android Push 推送”
  9. android中webView使用总结---飞速浏览器
  10. 【转】android 安全机制