许可优化
许可优化
产品
产品
解决方案
解决方案
服务支持
服务支持
关于
关于
软件库
当前位置:服务支持 >  软件文章 >  ArcGIS Runtime SDK for Android 100.x系列中去除水印和ESRI Logo的方法

ArcGIS Runtime SDK for Android 100.x系列中去除水印和ESRI Logo的方法

阅读数 18
点赞 0
article_banner

背景:

ArcGIS Runtime SDK for Android中一个展示 地图  的示例(https://developers.arcgis.com/android/latest/sample-code/display-map.htm),如下:

public class MainActivity extends AppCompatActivity {   private MapView mMapView;   @Override  protected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.activity_main);      // inflate MapView from layout    mMapView = (MapView) findViewById(R.id.mapView);    // create a map with the BasemapType topographic    ArcGISMap map = new ArcGISMap(Basemap.Type.TOPOGRAPHIC, 34.056295, -117.195800, 16);    // set the map to be displayed in this view    mMapView.setMap(map);  }   @Override  protected void onPause() {    super.onPause();    mMapView.pause();  }   @Override  protected void onResume() {    super.onResume();    mMapView.resume();  }   @Override  protected void onDestroy() {    super.onDestroy();    mMapView.dispose();  }}

运行完是这样的:

其中“Licensed For Developer Use Only”是水印,“Powered by Esri”是logo,如果不想在自己的地图视图显示水印和logo,怎样去除呢,方法如下:

1、ArcGIS Runtime SDK for Android 100.x系列中如何去除水印

在自己的代码中,在调用ArcGIS Runtime SDK for Android 的 api  代码段之前加上下述语句,

   // license with a license keyArcGISRuntimeEnvironment.setLicense("runtimelite,1000,rud4449636536,none,NKMFA0PL4S0DRJE15166");

即可在运行程序后清除水印,清除后的效果图如下:

但是,此时在我们的地图视图下方还能看到“Powered by Esri”logo,如何去除请往下看;

2、ArcGIS Runtime SDK for Android 100.x系列中如何去除ESRI logo信息

调用MapView的setAttributionTextVisible()这一方法,如下:

mMapView.setAttributionTextVisible(false);

注:在10.2.x系列上直接调用MapView的setEsriLogoVisible方法即可。

设置后,再次运行应用程序。

最终我们的清除水印和logo的代码如下:

public class MainActivity extends AppCompatActivity {   private MapView mMapView;   @Override  protected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.activity_main);     // license with a license key    ArcGISRuntimeEnvironment.setLicense("runtimelite,1000,rud4449636536,none,NKMFA0PL4S0DRJE15166");    // inflate MapView from layout    mMapView = (MapView) findViewById(R.id.mapView);     mMapView.setAttributionTextVisible(false);   // create a map with the BasemapType topographic    ArcGISMap map = new ArcGISMap(Basemap.Type.TOPOGRAPHIC, 34.056295, -117.195800, 16);   // set the map to be displayed in this view    mMapView.setMap(map);  }   @Override  protected void onPause() {    super.onPause();    mMapView.pause();  }   @Override  protected void onResume() {    super.onResume();    mMapView.resume();  }   @Override  protected void onDestroy() {    super.onDestroy();    mMapView.dispose();  }}

原理解析:

在上述中清除水印调用了ArcGISRuntimeEnvironment的setLicense方法,通过在setLicense中传入我们的licenseKey,也就是授权码就能够成功去除水印,在上述示例中的licenseKey我是传入自己的Lite级别的licenseKey。

在你可以在生产中使用你的应用程序之前,需要授权ArcGIS Runtime应用程序。Esri提供了四个ArcGIS Runtime许可级别:Lite、Basic、Standard和Advanced。每增加一个级别,就会为应用程序用户提供更多的可用功能。其中Lite级别是免费的,可以登录ArcGIS for Developers帐户,转到仪表板,将Runtime Lite许可证密钥复制到应用程序中,即可去除水印,但是Lite级别能够支持的功能是有限,如果你的应用程序还需要用到更高级的功能,那就需要购买其它级别(Basic、Standard和 Advanced )的Runtime许可了。

每种许可类型(:Lite、Basic、Standard和Advanced)支持的对应功能的具体介绍,可以参考 链接  https://developers.arcgis.com/android/license-and-deployment/license/

提示:我们开发测试时是可以使用所有功能的,只是这时运行的app界面会有“Licensed For Developer Use Only”水印。

如果是想获取Lite级别的Runtime licenseKey如何获取呢?请参考这个链接:https://developers.arcgis.com/pricing/licensing/

(提示:在下述示意图中需要注册developer账号,我是之前注册过所以直接输入账户名和密码即可登录ArcGIS for Developer。)


免责声明:本文系网络转载或改编,未找到原创作者,版权归原作者所有。如涉及版权,请联系删

相关文章
技术文档
QR Code
微信扫一扫,欢迎咨询~
customer

online

联系我们
武汉格发信息技术有限公司
湖北省武汉市经开区科技园西路6号103孵化器
电话:155-2731-8020 座机:027-59821821
邮件:tanzw@gofarlic.com
Copyright © 2023 Gofarsoft Co.,Ltd. 保留所有权利
遇到许可问题?该如何解决!?
评估许可证实际采购量? 
不清楚软件许可证使用数据? 
收到软件厂商律师函!?  
想要少购买点许可证,节省费用? 
收到软件厂商侵权通告!?  
有正版license,但许可证不够用,需要新购? 
联系方式 board-phone 155-2731-8020
close1
预留信息,一起解决您的问题
* 姓名:
* 手机:

* 公司名称:

姓名不为空

姓名不为空

姓名不为空
手机不正确

手机不正确

手机不正确
公司不为空

公司不为空

公司不为空