安卓智能地图开发与实施十:图层管理 - ArcGIS Runtime SDK for Android(Version 100.0.0)

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/allenlu2008/article/details/72257898

图层管理

图层管理分为了基础底图切换和业务数据管理。基础底图主要是进行切换,而业务数据管理的功能因项目而已,基本有控制显示、图层查询、统计等。

基础底图

这里写图片描述

基础底图的加载前面的章节已经介绍过,只需要从做好布局,处理ArcGISMap对象的Basemap切换即可。

这里写图片描述

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center_horizontal|center_vertical"
    android:orientation="horizontal"
    android:layout_marginTop="@dimen/window_inner"
    android:layout_marginLeft="@dimen/window_inner"
    android:layout_marginRight="@dimen/window_inner">
    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal|center_vertical"
        android:orientation="vertical">
        <esrichina.hymn.Bootstrap.BootstrapThumbnail
            android:id="@+id/managerlayer_vector"
            app:bootstrapBrand="info"
            app:roundedCorners="true"
            android:layout_width="@dimen/basemap_layer_imagewidth"
            android:layout_height="@dimen/basemap_layer_imageheight"
            android:layout_gravity="center_horizontal|center_vertical"
            android:src="@drawable/ic_basemap_vector" />
        <esrichina.hymn.Bootstrap.BootstrapLabel
            app:bootstrapBrand="info"
            app:bootstrapHeading="h6"
            app:bootstrapText="{fa_globe}  矢量"
            app:showOutline="false"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal|center_vertical"
            android:layout_marginTop="@dimen/window_inner"
            android:clickable="false"
            android:textColor="@color/bootstrap_brand_info" />
    </LinearLayout>

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal|center_vertical"
        android:layout_marginLeft="@dimen/window_inner"
        android:orientation="vertical">

        <esrichina.hymn.Bootstrap.BootstrapThumbnail
            android:id="@+id/managerlayer_raster"
            android:layout_width="@dimen/basemap_layer_imagewidth"
            android:layout_height="@dimen/basemap_layer_imageheight"
            android:layout_gravity="center_horizontal|center_vertical"
            android:src="@drawable/ic_basemap_raster"
            app:bootstrapBrand="info"
            app:roundedCorners="true" />

        <esrichina.hymn.Bootstrap.BootstrapLabel
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal|center_vertical"
            android:layout_marginTop="@dimen/window_inner"
            android:clickable="false"
            android:textColor="@color/bootstrap_brand_info"
            app:bootstrapBrand="info"
            app:bootstrapHeading="h6"
            app:bootstrapText="{fa_globe}  影像"
            app:showOutline="false" />
    </LinearLayout>
</LinearLayout>

这里以只有矢量、影像两种地图为前提,制作布局文件,当然也可以有更多。

这里写图片描述

public void DisplayRasterBasemap() {
        this.mainArcGISMap.setBasemap(this.mainRasterBasemap);
        this.mainMapView.setMap(this.mainArcGISMap);
    }
public void DisplayVectorBasemap() {
        this.mainArcGISMap.setBasemap(this.mainVectorBasemap);
        this.mainMapView.setMap(this.mainArcGISMap);
    }

底图切换针对ArcGISMap对象,赋值新的Basemap对象,Basemap包含不同的底图图层。

业务图层管理

这里写图片描述

这里写图片描述
业务图层在一个项目中往往有比较多的数据,例如多个Feature Service、多个.geodatabase文件、多个mmpk文件。而.geodatabase和mmpk文件都可以包含多个图层。
这里写图片描述

此处以两个.geodatabase文件为例,介绍业务图层管理。由于文件解析都是异步处理,而多个文件的解析完成顺序不可控,需要等两个都解析完成后,再按照给定的文件上下顺序来得到图层列表。

多图层数据解析

这里写图片描述

安卓的回调机制比较麻烦,寻找了一种最简单的方式,定义包含方法的接口,在OpenLayerClass类的OpenLayer方法执行完打开文件并解析出结果后,调用接口中的方法getLayer。
实例化OpenLayerClass时,给出getLayer的具体内容。

IlayerResult.java文件:

package esrichina.hymn.OpenLayers;

/**
 * Created by HymnHan on 2017/5/15.
 */

public interface ILayerResult {
    public void getLayer();
}

LayerType.java文件:

package esrichina.hymn.OpenLayers;

/**
 * Created by HymnHan on 2017/5/15.
 */

public enum LayerType {
    FILE_TPK,
    FILE_VTPK,
    FILE_GEODATABASE,
    FILE_MMPK_BASEMAP,
    FILE_MMPK_OPERATIONALLAYER,
    URL_VTPK,
    URL_MAPSERVICECACHE,
    URL_FEATURESERVICE,
    URL_MAPSERVICENOCACHE
}

OpenLayerClass.java文件:

package esrichina.hymn.OpenLayers;

import com.esri.arcgisruntime.data.Geodatabase;
import com.esri.arcgisruntime.data.GeodatabaseFeatureTable;
import com.esri.arcgisruntime.data.ServiceFeatureTable;
import com.esri.arcgisruntime.data.TileCache;
import com.esri.arcgisruntime.layers.ArcGISMapImageLayer;
import com.esri.arcgisruntime.layers.ArcGISTiledLayer;
import com.esri.arcgisruntime.layers.ArcGISVectorTiledLayer;
import com.esri.arcgisruntime.layers.FeatureLayer;
import com.esri.arcgisruntime.layers.Layer;
import com.esri.arcgisruntime.mapping.ArcGISMap;
import com.esri.arcgisruntime.mapping.Basemap;
import com.esri.arcgisruntime.mapping.LayerList;
import com.esri.arcgisruntime.mapping.MobileMapPackage;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by HymnHan on 2017/5/10.
 */

public class OpenLayerClass {
    protected ILayerResult mainLayerReturn;

    protected ArrayList<Layer> mainLayerResult;
    public String url;
    public void OpenLayer(String urlOrPath,LayerType layerType,ILayerResult layerReturn)
    {
        mainLayerResult = new ArrayList<>();
        this.mainLayerReturn = layerReturn;
        url = urlOrPath;
        switch (layerType)
        {
            case FILE_TPK:
                TileCache vTileCache = new TileCache(urlOrPath);
                ArcGISTiledLayer mainArcGISTiledLayer = new ArcGISTiledLayer(vTileCache);
                mainLayerResult.add(mainArcGISTiledLayer);
                mainLayerReturn.getLayer();
                break;
            case FILE_VTPK:
            case URL_VTPK:
                ArcGISVectorTiledLayer mainArcGISVectorTiledLayer = new ArcGISVectorTiledLayer(urlOrPath);
                mainLayerResult.add(mainArcGISVectorTiledLayer);
                mainLayerReturn.getLayer();
                break;
            case FILE_GEODATABASE:
                final Geodatabase mainGeodatabase = new Geodatabase(urlOrPath);
                mainGeodatabase.loadAsync();
                mainGeodatabase.addDoneLoadingListener(new Runnable() {
                    @Override
                    public void run() {
                        List<GeodatabaseFeatureTable> results = mainGeodatabase.getGeodatabaseFeatureTables();
                        for (GeodatabaseFeatureTable value : results
                                ) {
                            FeatureLayer valueFL = new FeatureLayer(value);
                            mainLayerResult.add(valueFL);
                        }
                        mainLayerReturn.getLayer();
                    }
                });
                break;
            case FILE_MMPK_BASEMAP:
                final MobileMapPackage mainMobileMapPackageB =
                        new MobileMapPackage(urlOrPath);
                mainMobileMapPackageB.loadAsync();
                mainMobileMapPackageB.addDoneLoadingListener(new Runnable() {
                    @Override
                    public void run() {
                        List<ArcGISMap> mainArcGISMapL = mainMobileMapPackageB.getMaps();
                        for (ArcGISMap mainArcGISMap : mainArcGISMapL
                             ) {
                            Basemap mainBasemap = mainArcGISMap.getBasemap();
                            LayerList mainBaseLayers = mainBasemap.getBaseLayers();
                            for (Layer mainLayer : mainBaseLayers
                                 ) {
                                mainLayerResult.add(mainLayer);
                            }
                            for (int i = mainBaseLayers.size(); i > -1; i--) {
                                mainBasemap.getBaseLayers().remove(i);
                            }
                        }
                        mainLayerReturn.getLayer();
                    }
                });
                break;
            case FILE_MMPK_OPERATIONALLAYER:
                final MobileMapPackage mainMobileMapPackageO =
                        new MobileMapPackage(urlOrPath);
                mainMobileMapPackageO.loadAsync();
                mainMobileMapPackageO.addDoneLoadingListener(new Runnable() {
                    @Override
                    public void run() {
                        List<ArcGISMap> mainArcGISMapL = mainMobileMapPackageO.getMaps();
                        for (ArcGISMap mainArcGISMap : mainArcGISMapL
                                ) {
                            LayerList mainMMPKLL = mainArcGISMap.getOperationalLayers();
                            for (Layer mainLayer : mainMMPKLL
                                    ) {
                                mainLayerResult.add(mainLayer);
                            }
                            for (int i = mainMMPKLL.size(); i > -1; i--) {
                                mainArcGISMap.getOperationalLayers().remove(i);
                            }
                        }
                        mainLayerReturn.getLayer();
                    }
                });
                break;
            case URL_MAPSERVICECACHE:
                ArcGISTiledLayer mainArcGISTiledLayerURL = new ArcGISTiledLayer(urlOrPath);
                mainLayerResult.add(mainArcGISTiledLayerURL);
                mainLayerReturn.getLayer();
                break;
            case URL_FEATURESERVICE:
                final ServiceFeatureTable mainServiceFeatureTable = new ServiceFeatureTable(urlOrPath);
                FeatureLayer mainFeatureLayer = new FeatureLayer(mainServiceFeatureTable);
                mainLayerResult.add(mainFeatureLayer);
                mainLayerReturn.getLayer();
                break;
            case URL_MAPSERVICENOCACHE:
                ArcGISMapImageLayer mainMapImageLayer = new ArcGISMapImageLayer(urlOrPath);
                mainLayerResult.add(mainMapImageLayer);
                mainLayerReturn.getLayer();
                break;
        }

    }

    public ArrayList<Layer> getLayerResult() {
        return mainLayerResult;
    }
}

OpenLayersClass.java文件:

package esrichina.hymn.OpenLayers;

import com.esri.arcgisruntime.layers.Layer;

import java.util.ArrayList;

/**
 * Created by polyl on 2017/5/15.
 */

public class OpenLayersClass {
    protected ILayerResult mainLayerReturn;

    protected ArrayList<Layer> mainLayerResult;
    private int TotalCount = 0;
    private int LoadedCount = 0;
    private String[] urls;
    private ArrayList<OpenLayerClass> ResultOpenClass;
    public void OpenLayers(String[] urlOrPaths, LayerType layerType, ILayerResult layerReturn)
    {
        try {
            urls = urlOrPaths;
            TotalCount = urlOrPaths.length;
            this.mainLayerReturn = layerReturn;
            mainLayerResult = new ArrayList<>();
            ResultOpenClass = new ArrayList<>();
            for (int i = urlOrPaths.length-1; i > -1; i--) {
                String urlOrPath = urlOrPaths[i];
                final OpenLayerClass openLayer = new OpenLayerClass();
                openLayer.OpenLayer(
                        urlOrPath,
                        layerType,
                        new ILayerResult() {
                            @Override
                            public void getLayer() {
                                ResultOpenClass.add(openLayer);

                                LoadedCount++;
                                if(LoadedCount == TotalCount)
                                {
                                    for (int j = 0; j < urls.length; j++) {
                                        for (OpenLayerClass result:ResultOpenClass
                                             ) {
                                            if(urls[j].equals(result.url))
                                            {
                                                mainLayerResult.addAll(result.getLayerResult());
                                            }
                                        }
                                    }
                                    mainLayerReturn.getLayer();
                                }
                            }
                        }
                );
            }
        }
        catch (Exception e)
        {
            Exception ee = e;
        }
    }
    public ArrayList<Layer> getLayerResult() {
        return mainLayerResult;
    }

}

制作图层列表布局文件

这里写图片描述

业务图层采用ListView来展示。依托LinearLayout,包含main_map_basemapmanager_container布局文件。

main_map_basemapmanager_container文件:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:app="http://schemas.android.com/apk/res-auto">
    <esrichina.hymn.Bootstrap.BootstrapButton
        android:layout_width="match_parent"
        android:layout_height="@dimen/window_header_height"
        android:layout_marginTop="@dimen/window_inner"
        android:layout_marginLeft="@dimen/window_inner"
        android:layout_marginRight="@dimen/window_inner"
        android:clickable="false"
        app:bootstrapText="{fa_star}  基础底图  {fa_star}"
        app:bootstrapSize="sm"
        app:bootstrapBrand="info"/>
    <include
        layout="@layout/main_map_basemapmanager_container"/>
    <esrichina.hymn.Bootstrap.BootstrapButton
        android:layout_width="match_parent"
        android:layout_height="@dimen/window_header_height"
        android:layout_marginTop="@dimen/window_inner"
        android:layout_marginLeft="@dimen/window_inner"
        android:layout_marginRight="@dimen/window_inner"
        android:clickable="false"
        app:bootstrapText="{fa_star}  业务数据  {fa_star}"
        app:bootstrapSize="sm"
        app:bootstrapBrand="info"/>
    <ListView
        android:id="@+id/managerlayer_operation"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="@dimen/window_inner"
        android:layout_marginLeft="@dimen/window_inner"
        android:layout_marginRight="@dimen/window_inner"
        ></ListView>
</LinearLayout>

制作ListView填充模板(布局文件)

这里写图片描述

依托SwipeLayout,制作可侧滑的布局文件。对SwipeLayout感兴趣的,可以参考https://github.com/daimajia/AndroidSwipeLayout

main_operation_layer_item.xml文件:

<?xml version="1.0" encoding="utf-8" ?>
<esrichina.hymn.SwipeLayout.SwipeLayout
    xmlns:swipe="http://schemas.android.com/apk/res-auto"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/operation_layerlist_swipe"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    swipe:leftEdgeSwipeOffset="0dp"
    swipe:rightEdgeSwipeOffset="0dp"
    app:clickToClose="true">
    <LinearLayout
        android:tag="Bottom1"
        android:background="@color/colorBackground"
        android:id="@+id/operation_layer_wrapper"
        android:layout_width="wrap_content"
        android:weightSum="1"
        android:layout_height="match_parent">
        <esrichina.hymn.Bootstrap.BootstrapButtonGroup
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:orientation="horizontal"
            swipe:bootstrapBrand="info"
            swipe:bootstrapSize="xs">
            <esrichina.hymn.Bootstrap.BootstrapButton
                android:id="@+id/operation_layer_identity_button"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                app:fontAwesomeIcon="fa_search"
                swipe:bootstrapSize="xs"/>
            <esrichina.hymn.Bootstrap.BootstrapButton
                android:id="@+id/operation_layer_attribute_button"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                app:fontAwesomeIcon="fa_stack_overflow"
                swipe:bootstrapSize="xs"/>
            <esrichina.hymn.Bootstrap.BootstrapButton
                android:id="@+id/operation_layer_piechart_button"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                app:fontAwesomeIcon="fa_pie_chart"
                swipe:bootstrapSize="xs"/>
            <esrichina.hymn.Bootstrap.BootstrapButton
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                app:fontAwesomeIcon="fa_edit"
                swipe:bootstrapSize="xs"/>
        </esrichina.hymn.Bootstrap.BootstrapButtonGroup>
    </LinearLayout>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/bootstrap_brand_secondary_fill"
        android:padding="10dp">
        <CheckBox
            android:id="@+id/position"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:duplicateParentState="false" />
    </LinearLayout>
</esrichina.hymn.SwipeLayout.SwipeLayout>

制作ListView的填充模板(适配器)

这里写图片描述

OperationLayerAdapter.java文件:

package esrichina.hymn.usingmappingbyhymnlocal.Adapters;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.CompoundButton;

import com.esri.arcgisruntime.layers.FeatureLayer;

import java.util.ArrayList;

import esrichina.hymn.SwipeLayout.SwipeLayout;
import esrichina.hymn.SwipeLayout.adapters.BaseSwipeAdapter;
import esrichina.hymn.usingmappingbyhymnlocal.R;

/**
 * Created by HymnHan on 2017/5/15.
 */

public class OperationLayerAdapter extends BaseSwipeAdapter {
    private LayoutInflater mainInflater;
    private ArrayList<FeatureLayer> mainFeatureLayersAL;

    public OperationLayerAdapter(Context context, ArrayList<FeatureLayer> featureLayers) {
        super();
        this.mainInflater = LayoutInflater.from(context);
        mainFeatureLayersAL = featureLayers;
    }

    @Override
    public int getCount() {
        int count = mainFeatureLayersAL.size();

        return count;
    }

    @Override
    public Object getItem(int position) {
        Object result = null;
        if (mainFeatureLayersAL != null) {
            result = mainFeatureLayersAL.get(position);
        }
        return result;
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public int getSwipeLayoutResourceId(int position) {
        return R.id.operation_layerlist_swipe;
    }

    @Override
    public View generateView(int position, ViewGroup parent) {
        View convertView = null;
        try {
            OLAViewHolder holder = null;
            holder = new OLAViewHolder();
            final int positionInner = position;
            convertView = mainInflater.inflate(R.layout.main_operation_layer_item, null);
            CheckBox mCheckBox = (CheckBox) convertView.findViewById(R.id.position);
            SwipeLayout swipeLayout = (SwipeLayout) convertView.findViewById(getSwipeLayoutResourceId(position));
            holder.OLALayerCheckBox = mCheckBox;
            holder.OLAToolSwipeLayout = swipeLayout;
            holder.OLAFeatureLayer = mainFeatureLayersAL.get(position);
            swipeLayout.setShowMode(SwipeLayout.ShowMode.LayDown);
            swipeLayout.addDrag(SwipeLayout.DragEdge.Left, convertView.findViewById(R.id.operation_layer_wrapper));
            convertView.setTag(holder);
            convertView.findViewById(R.id.operation_layer_identity_button).setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    Integer index = positionInner;
                }
            });
        } catch (Exception e) {
            Exception ee = e;
        }
        return convertView;
    }

    @Override
    public void fillValues(int position, View convertView) {
        final OLAViewHolder holder = (OLAViewHolder) convertView.getTag();
        holder.OLALayerCheckBox.setText(holder.OLAFeatureLayer.getName());
        holder.OLALayerCheckBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                holder.OLAFeatureLayer.setVisible(isChecked);
            }
        });
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        if (convertView == null) {
            convertView = generateView(position, parent);
        }
        mItemManger.bind(convertView, position);
        fillValues(position, convertView);
        return convertView;
    }

    public final class OLAViewHolder {
        public CheckBox OLALayerCheckBox;
        public SwipeLayout OLAToolSwipeLayout;
        public FeatureLayer OLAFeatureLayer;
    }
}

MainManagerLayerComponent.java文件:

package esrichina.hymn.mapbasicframeworkbyhymn.Components;

import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;

import esrichina.hymn.Bootstrap.BootstrapThumbnail;
import esrichina.hymn.Methods.ConfigurationsClass;
import esrichina.hymn.SwipeLayout.SwipeLayout;
import esrichina.hymn.SwipeLayout.util.Attributes;
import esrichina.hymn.mapbasicframeworkbyhymn.Adapters.OperationLayerAdapter;
import esrichina.hymn.mapbasicframeworkbyhymn.R;

/**
 * Created by HymnHan on 2017/5/15.
 */

public class MainManagerLayerComponent extends BaseComponent {
    private BootstrapThumbnail mainVectorBCT;
    private BootstrapThumbnail mainRasterBCT;
    private ListView mOperationLayerLV;
    private OperationLayerAdapter mOperationLayerAdapter;
    public MainManagerLayerComponent() {
        mainVectorBCT = (BootstrapThumbnail) mainHymnActivity.findViewById(R.id.managerlayer_vector);
        mainVectorBCT.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ChangeBasemapFunction("vector");
            }
        });
        mainRasterBCT = (BootstrapThumbnail) mainHymnActivity.findViewById(R.id.managerlayer_raster);
        mainRasterBCT.setBorderDisplayed(false);
        mainRasterBCT.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ChangeBasemapFunction("raster");
            }
        });
        mOperationLayerLV = (ListView) mainHymnActivity.findViewById(R.id.managerlayer_operation);
        mOperationLayerAdapter = new OperationLayerAdapter(
                mainHymnActivity,
                mainConfigurations.getMainReadOperationsFL());
        mOperationLayerAdapter.setMode(Attributes.Mode.Single);
        mOperationLayerLV.setAdapter(mOperationLayerAdapter);
        mOperationLayerLV.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                ((SwipeLayout)(mOperationLayerLV.getChildAt(position - mOperationLayerLV.getFirstVisiblePosition()))).close(true);
            }
        });
        ConfigurationsClass.setListViewHeightBasedOnChildren(mOperationLayerLV);
        ChangeBasemapFunction(mainConfigurations.getMainDefaultBasemap());
    }
    public void RefreshOperationLayersFunction() {
        mOperationLayerLV.setAdapter(mOperationLayerAdapter);
        ConfigurationsClass.setListViewHeightBasedOnChildren(mOperationLayerLV);
        ChangeBasemapFunction(mainConfigurations.getMainDefaultBasemap());
    }
    protected void ChangeBasemapFunction(String type) {
        switch (type)
        {
            case "raster" :
                mainRasterBCT.setBorderDisplayed(true);
                mainVectorBCT.setBorderDisplayed(false);
                mainConfigurations.DisplayRasterBasemap();
                //mainConfigurations.CloseDrawerFunction();
                break;
            case "vector":
            default:
                mainVectorBCT.setBorderDisplayed(true);
                mainRasterBCT.setBorderDisplayed(false);
                mainConfigurations.DisplayVectorBasemap();
                //mainConfigurations.CloseDrawerFunction();
                break;

        }
    }
    private void RefreshMapFunction()
    {
        try {
            if(mainRasterBCT.isBorderDisplayed() == true)
            {
                mainConfigurations.DisplayVectorBasemap();
                mainConfigurations.DisplayRasterBasemap();
            }
            else {
                mainConfigurations.DisplayRasterBasemap();
                mainConfigurations.DisplayVectorBasemap();
            }
        }
        catch (Exception e)
        {

        }
    }
}

这里写图片描述

结尾

源程序请自行下载:
链接:http://pan.baidu.com/s/1eRXxrpS 密码:bmd1
若失效,可发邮件给韩源萌(polyline@126.com)索要。

展开阅读全文

没有更多推荐了,返回首页