POST
|
Hi coracoleman14, What is the showPopup() method that you have? I do not see it in the code you provided above. Thanks, Alexander
... View more
10-25-2017
06:34 AM
|
1
|
3
|
2992
|
POST
|
Did you try the above suggestions? Did those not work for you? Can you post your Manifest file?
... View more
10-25-2017
06:01 AM
|
1
|
1
|
1495
|
POST
|
Hi Anatoly Torbov, We are aware of this issue. Two things to try to circumvent this problem: 1) Add tools:replace="android:label" in the application tag of the Manifest file (Updating version 100.1.0 cause app name change to Android API · Issue #372 · Esri/arcgis-runtime-samples-android · GitHu… ) 2) Change your app_name string resource to a different name such as my_app_name and change the string resource referenced in the Manifest file to this. I hope this helps!
... View more
10-20-2017
08:28 AM
|
1
|
0
|
1495
|
POST
|
Would you kindly mark mine as the correct answer if it assisted in resolving this issue?
... View more
10-19-2017
08:52 AM
|
1
|
0
|
1630
|
POST
|
Hi Carlos López Moyano, After doing some research, and speaking with some of my colleagues, we are aiming to support elevation modes in the next release (update 2). At the moment we only draw draped features in a scene. In update 2 you will be able to elevate with the Z value. I hope this helps!
... View more
10-19-2017
06:09 AM
|
0
|
0
|
643
|
POST
|
I am fairly confident I know what might be occurring here. Let me check with my colleagues to confirm what I am seeing
... View more
10-19-2017
05:24 AM
|
0
|
0
|
643
|
POST
|
You have the permissions in the wrong location. They should be outside the application tag. <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="XXXXXXXXXXXXXXXXXXXXX">
<uses-permission android:name = "andriod.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-feature android:glEsVersion="0x00020000" android:required="true"/>
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".activities.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".activities.ArcGISMapActivity">
</activity>
</application>
</manifest> This documentation specified that is should be contained within the Manifest tag, not the application tag : | Android Developers I hope this helps!
... View more
10-19-2017
05:03 AM
|
2
|
2
|
1630
|
POST
|
That feature service does not look to be publicly available. Do you have a public feature service I can test with?
... View more
10-19-2017
04:51 AM
|
0
|
0
|
643
|
POST
|
If you just want to use them as basemap layers you could do something like this: Basemap b = new Basemap();
b.getBaseLayers().addAll(layersCollection);
ArcGISMap arcGISMap = new ArcGISMap(b);
mapView.setMap(arcGISMap); The layersCollection object would be of type Collection<? extends Layer> so you could create a list of layer objects and then load them into the basemap to then load into the mapview.
... View more
10-17-2017
06:48 AM
|
1
|
2
|
1271
|
POST
|
Jason Christian, On the map object, use the getOperationalLayers() and then use add(Layer layer) to add a layer to the operational layers list of the Map that is set in the mapview. ArcGISMap| arcgis-android <-- Should be bookmarked to the getOperationalLayers() method. Hope this helps! Thanks, Alexander
... View more
10-17-2017
06:03 AM
|
0
|
4
|
1271
|
POST
|
No problem! If it helped resolve your problem, could you kindly mark the answer as correct.
... View more
10-16-2017
01:09 PM
|
0
|
0
|
1059
|
POST
|
I took some time today and converted the 10.2.x sample to runtime 100: This is the MBTilesLayer.java class: package com.arcgis.apps.mbtiles;
import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.util.Log;
import com.esri.arcgisruntime.arcgisservices.LevelOfDetail;
import com.esri.arcgisruntime.arcgisservices.TileInfo;
import com.esri.arcgisruntime.data.TileKey;
import com.esri.arcgisruntime.geometry.Envelope;
import com.esri.arcgisruntime.geometry.GeometryEngine;
import com.esri.arcgisruntime.geometry.Point;
import com.esri.arcgisruntime.geometry.SpatialReferences;
import com.esri.arcgisruntime.layers.ImageTiledLayer;
import java.util.ArrayList;
import java.util.List;
/**
* The MBTilesLayer class allows you to work with a MBTiles stored in a SQLite
* database.
*
*/
public class MBTilesLayer extends ImageTiledLayer {
private SQLiteDatabase mapDb;
private int mLevels = 0;
/**
* The constructor to instantiate MBTiles from a path on device
*
* @param path
* path is expected to be of the form /sdcard/path/package.mbtiles
*/
public static MBTilesLayer init(String path) {
SQLiteDatabase mapDb;
int mLevels = 0;
try {
mapDb = SQLiteDatabase.openDatabase(path, null, SQLiteDatabase.OPEN_READONLY);
} catch (SQLException ex) {
Log.e("MBTiles", ex.getMessage());
throw (ex);
}
// Default TMS bounds = bounds of Web Mercator projection
Envelope envWGS = new Envelope(-180.0, -85.0511, 180.0, 85.0511, SpatialReferences.getWgs84());
// See if the MBTiles DB defines their own Bounds in the metadata table
Cursor bounds = mapDb.rawQuery("SELECT value FROM metadata WHERE name = 'bounds'", null);
if (bounds.moveToFirst()) {
String bs = bounds.getString(0);
String[] ba = bs.split(",", 4);
if (ba.length == 4) {
double leftLon = Double.parseDouble(ba[0]);
double topLat = Double.parseDouble(ba[3]);
double rightLon = Double.parseDouble(ba[2]);
double bottomLat = Double.parseDouble(ba[1]);
envWGS = new Envelope(leftLon, bottomLat, rightLon, topLat, SpatialReferences.getWgs84());
}
}
Envelope envWeb = (Envelope) GeometryEngine.project(envWGS,
SpatialReferences.getWebMercator());
Point origin = new Point(envWeb.getXMin(), envWeb.getYMax(), envWeb.getSpatialReference());
Cursor maxLevelCur = mapDb.rawQuery("SELECT MAX(zoom_level) AS max_zoom FROM tiles", null);
if (maxLevelCur.moveToFirst()) {
mLevels = maxLevelCur.getInt(0);
}
Log.i("TAG", "Max levels = " + Integer.toString(mLevels));
double[] resolution = new double[mLevels];
double[] scale = new double[mLevels];
List<LevelOfDetail> lod = new ArrayList<>(mLevels);
for (int i = 0; i < mLevels; i++) {
// see the TMS spec for derivation of the level 0 scale and resolution
// For each level the resolution (in meters per pixel) doubles
resolution[i] = 156543.032 / Math.pow(2, i);
// Level 0 scale is 1:554,678,932. Each level doubles this.
scale[i] = 554678932 / Math.pow(2, i);
lod.add(new LevelOfDetail(i, resolution[i], scale[i]));
}
/*
* Note, the constructor must set the following values or we won't send the
* status change events to listeners and the tiles will not be fetched
*
* Origin is Top Left (web Mercator) , the rest are defined by the TMS
* Global-mercator spec (scales, resolution, 96dpi 256x256 pixel tiles) See:
* http://wiki.osgeo.org/wiki/Tile_Map_Service_Specification#global-mercator
*/
TileInfo ti = new TileInfo(96, TileInfo.ImageFormat.PNG, lod, origin, origin.getSpatialReference(), 256, 256);
return new MBTilesLayer(ti, envWeb, mapDb, mLevels);
}
private MBTilesLayer(TileInfo tileInfo, Envelope fullExtent, SQLiteDatabase mapDb, int mLevels) {
super(tileInfo, fullExtent);
this.mapDb = mapDb;
this.mLevels = mLevels;
}
@Override
protected byte[] getTile(TileKey tileKey) {
// need to flip origin
int nRows = (1 << tileKey.getLevel()); // Num rows = 2^level
int tmsRow = nRows - 1 - tileKey.getRow();
Cursor imageCur = mapDb.rawQuery("SELECT tile_data FROM tiles WHERE zoom_level = " + Integer.toString(tileKey.getLevel())
+ " AND tile_column = " + Integer.toString(tileKey.getColumn()) + " AND tile_row = " + Integer.toString(tmsRow), null);
if (imageCur.moveToFirst()) {
return imageCur.getBlob(0);
}
return null; // Alternatively we might return a "no data" tile
}
} And here is how I called it: @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mapView = (MapView) findViewById(R.id.mapView);
MBTilesLayer mbTilesLayer = MBTilesLayer.init(Environment.getExternalStorageDirectory().getPath()
+ "/ArcGIS/mmpks/world_countries.mbtiles");
ArcGISMap arcGISMap = new ArcGISMap(new Basemap(mbTilesLayer));
mapView.setMap(arcGISMap);
} There are some things I am avoiding (like runtime permissions) but this should be a good start for you to implement this in your applications. I hope this helps!
... View more
10-16-2017
12:12 PM
|
1
|
2
|
1059
|
POST
|
Using the WebTiledLayer class from the new runtime and supplying a template url matching the URL found in the MapBox console, allows the user to see their MBTiles in their map. This is all from a connected application. I believe the URL needs to follow this convention : http://site.domain.com/something/{level}/{col}/{row}/?access_token=asdjhksdjfhaalksjdhflksadhjf The important bit being the {level}/{col}/{row} information. You can alternatively supplement this by extending the class and modifying the getTileURL(TileKey tileKey) method. If you are looking for the LocalMBTiles (generally a file stored on the device as a *.mbtile) and how to display them on a device, that might warrant a new question as this one was done to address the Nathan Miller follow up question. Hope this helps!
... View more
10-13-2017
02:07 PM
|
1
|
0
|
1306
|
Title | Kudos | Posted |
---|---|---|
1 | 07-15-2014 03:16 PM | |
1 | 01-06-2015 03:33 PM | |
1 | 12-02-2014 10:47 AM | |
1 | 07-15-2014 03:31 PM | |
1 | 09-23-2014 03:59 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|